coap_server_observe.h File Reference

CoAP observe. More...

#include "core/net.h"
#include "coap/coap_server.h"

Go to the source code of this file.

Functions

void coapServerProcessObserveEvents (CoapServerContext *context)
 Process observe-related events. More...
 
error_t coapServerProcessRegistrationRequest (CoapServerContext *context)
 Process registration request. More...
 
void coapServerRestoreRegistrationRequest (CoapServerContext *context, CoapObserver *observer)
 Restore original registration request. More...
 
void coapServerInitNotificationResponse (CoapServerContext *context, CoapObserver *observer)
 Initialize notification response. More...
 
error_t coapServerSendNotificationResponse (CoapServerContext *context, CoapObserver *observer)
 Send notification response. More...
 
error_t coapServerProcessAck (CoapServerContext *context)
 Process Acknowledgement message. More...
 
error_t coapServerProcessReset (CoapServerContext *context)
 Process Reset message. More...
 
CoapResourcecoapServerFindResource (CoapServerContext *context, const char_t *uri)
 Search the list of resources for a given URI. More...
 
CoapObservercoapServerCreateObserver (CoapServerContext *context, const uint8_t *token, size_t tokenLen, CoapResource *resource)
 Create a new entry in the list of observers. More...
 
CoapObservercoapServerFindObserver (CoapServerContext *context, const uint8_t *token, size_t tokenLen)
 Search the list of observers for a given entry. More...
 
void coapServerDeleteObserver (CoapObserver *observer)
 Remove an entry from the list of observers. More...
 

Detailed Description

CoAP observe.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2026 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.6.4

Definition in file coap_server_observe.h.

Function Documentation

◆ coapServerCreateObserver()

CoapObserver* coapServerCreateObserver ( CoapServerContext context,
const uint8_t *  token,
size_t  tokenLen,
CoapResource resource 
)

Create a new entry in the list of observers.

Parameters
[in]contextPointer to the CoAP server context
[in]tokenPointer to the token specified by the client
[in]tokenLenLength of the token, in bytes
[in]resourcePointer to the target resource
Returns
Pointer to the newly created entry

Definition at line 686 of file coap_server_observe.c.

◆ coapServerDeleteObserver()

void coapServerDeleteObserver ( CoapObserver observer)

Remove an entry from the list of observers.

Parameters
[in]observerPointer to the entry to be removed

Definition at line 793 of file coap_server_observe.c.

◆ coapServerFindObserver()

CoapObserver* coapServerFindObserver ( CoapServerContext context,
const uint8_t *  token,
size_t  tokenLen 
)

Search the list of observers for a given entry.

Parameters
[in]contextPointer to the CoAP server context
[in]tokenPointer to the token specified by the client
[in]tokenLenLength of the token, in bytes
Returns
Pointer to the matching entry

Definition at line 752 of file coap_server_observe.c.

◆ coapServerFindResource()

CoapResource* coapServerFindResource ( CoapServerContext context,
const char_t uri 
)

Search the list of resources for a given URI.

Parameters
[in]contextPointer to the CoAP server context
[in]uriNULL-terminated string containing the path to the resource
Returns
Pointer to the matching resource

Definition at line 648 of file coap_server_observe.c.

◆ coapServerInitNotificationResponse()

void coapServerInitNotificationResponse ( CoapServerContext context,
CoapObserver observer 
)

Initialize notification response.

Parameters
[in]contextPointer to the CoAP server context
[in]observerPointer to the registered observer

Definition at line 289 of file coap_server_observe.c.

◆ coapServerProcessAck()

error_t coapServerProcessAck ( CoapServerContext context)

Process Acknowledgement message.

Parameters
[in]contextPointer to the CoAP server context
Returns
Error code

Definition at line 485 of file coap_server_observe.c.

◆ coapServerProcessObserveEvents()

void coapServerProcessObserveEvents ( CoapServerContext context)

Process observe-related events.

Parameters
[in]contextPointer to the CoAP server context

Definition at line 52 of file coap_server_observe.c.

◆ coapServerProcessRegistrationRequest()

error_t coapServerProcessRegistrationRequest ( CoapServerContext context)

Process registration request.

Parameters
[in]contextPointer to the CoAP server context
Returns
Error code

Definition at line 151 of file coap_server_observe.c.

◆ coapServerProcessReset()

error_t coapServerProcessReset ( CoapServerContext context)

Process Reset message.

Parameters
[in]contextPointer to the CoAP server context
Returns
Error code

Definition at line 578 of file coap_server_observe.c.

◆ coapServerRestoreRegistrationRequest()

void coapServerRestoreRegistrationRequest ( CoapServerContext context,
CoapObserver observer 
)

Restore original registration request.

Parameters
[in]contextPointer to the CoAP server context
[in]observerPointer to the registered observer

Definition at line 245 of file coap_server_observe.c.

◆ coapServerSendNotificationResponse()

error_t coapServerSendNotificationResponse ( CoapServerContext context,
CoapObserver observer 
)

Send notification response.

Parameters
[in]contextPointer to the CoAP server context
[in]observerPointer to the registered observer
Returns
Error code

Definition at line 336 of file coap_server_observe.c.