CoAP observe. More...
#include <stdlib.h>#include "core/net.h"#include "coap/coap_server.h"#include "coap/coap_server_observe.h"#include "coap/coap_server_misc.h"#include "coap/coap_debug.h"#include "debug.h"Go to the source code of this file.
Macros | |
| #define | TRACE_LEVEL COAP_TRACE_LEVEL |
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... | |
| CoapResource * | coapServerFindResource (CoapServerContext *context, const char_t *uri) |
| Search the list of resources for a given URI. More... | |
| CoapObserver * | coapServerCreateObserver (CoapServerContext *context, const uint8_t *token, size_t tokenLen, CoapResource *resource) |
| Create a new entry in the list of observers. More... | |
| CoapObserver * | coapServerFindObserver (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.
- Version
- 2.6.4
Definition in file coap_server_observe.c.
Macro Definition Documentation
◆ TRACE_LEVEL
| #define TRACE_LEVEL COAP_TRACE_LEVEL |
Definition at line 32 of file coap_server_observe.c.
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] context Pointer to the CoAP server context [in] token Pointer to the token specified by the client [in] tokenLen Length of the token, in bytes [in] resource Pointer 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] observer Pointer 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] context Pointer to the CoAP server context [in] token Pointer to the token specified by the client [in] tokenLen Length 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] context Pointer to the CoAP server context [in] uri NULL-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] context Pointer to the CoAP server context [in] observer Pointer 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] context Pointer 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] context Pointer 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] context Pointer 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] context Pointer 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] context Pointer to the CoAP server context [in] observer Pointer 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] context Pointer to the CoAP server context [in] observer Pointer to the registered observer
- Returns
- Error code
Definition at line 336 of file coap_server_observe.c.
