CoAP server. More...
#include "core/net.h"#include "coap/coap_common.h"#include "coap/coap_message.h"#include "coap/coap_option.h"#include "core/crypto.h"#include "tls.h"Go to the source code of this file.
Data Structures | |
| struct | CoapServerSettings |
| CoAP server settings. More... | |
| struct | _CoapDtlsSession |
| DTLS session. More... | |
| struct | _CoapServerContext |
| CoAP server context. More... | |
Macros | |
| #define | COAP_SERVER_SUPPORT ENABLED |
| #define | COAP_SERVER_DTLS_SUPPORT DISABLED |
| #define | COAP_SERVER_STACK_SIZE 650 |
| #define | COAP_SERVER_MAX_SESSIONS 4 |
| #define | COAP_SERVER_TICK_INTERVAL 500 |
| #define | COAP_SERVER_SESSION_TIMEOUT 60000 |
| #define | COAP_SERVER_BUFFER_SIZE 2048 |
| #define | COAP_SERVER_MAX_COOKIE_SECRET_SIZE 32 |
| #define | COAP_SERVER_MAX_URI_LEN 128 |
| #define | COAP_SERVER_PRIORITY OS_TASK_PRIORITY_NORMAL |
| #define | COAP_SERVER_PRIVATE_CONTEXT |
| #define | CoapServerContext struct _CoapServerContext |
| #define | CoapDtlsSession struct _CoapDtlsSession |
Typedefs | |
| typedef error_t(* | CoapServerUdpInitCallback) (CoapServerContext *context, Socket *socket) |
| UDP initialization callback function. More... | |
| typedef error_t(* | CoapServerDtlsInitCallback) (CoapServerContext *context, TlsContext *dtlsContext) |
| DTLS initialization callback. More... | |
| typedef error_t(* | CoapServerRequestCallback) (CoapServerContext *context, CoapCode method, const char_t *uri) |
| CoAP request callback function. More... | |
Functions | |
| void | coapServerGetDefaultSettings (CoapServerSettings *settings) |
| Initialize settings with default values. More... | |
| error_t | coapServerInit (CoapServerContext *context, const CoapServerSettings *settings) |
| CoAP server initialization. More... | |
| error_t | coapServerSetCookieSecret (CoapServerContext *context, const uint8_t *cookieSecret, size_t cookieSecretLen) |
| Set cookie secret. More... | |
| error_t | coapServerStart (CoapServerContext *context) |
| Start CoAP server. More... | |
| error_t | coapServerStop (CoapServerContext *context) |
| Stop CoAP server. More... | |
| void | coapServerTask (CoapServerContext *context) |
| CoAP server task. More... | |
| void | coapServerDeinit (CoapServerContext *context) |
| Release CoAP server context. More... | |
Detailed Description
CoAP server.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2025 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.5.4
Definition in file coap_server.h.
Macro Definition Documentation
◆ COAP_SERVER_BUFFER_SIZE
| #define COAP_SERVER_BUFFER_SIZE 2048 |
Definition at line 84 of file coap_server.h.
◆ COAP_SERVER_DTLS_SUPPORT
| #define COAP_SERVER_DTLS_SUPPORT DISABLED |
Definition at line 49 of file coap_server.h.
◆ COAP_SERVER_MAX_COOKIE_SECRET_SIZE
| #define COAP_SERVER_MAX_COOKIE_SECRET_SIZE 32 |
Definition at line 91 of file coap_server.h.
◆ COAP_SERVER_MAX_SESSIONS
| #define COAP_SERVER_MAX_SESSIONS 4 |
Definition at line 63 of file coap_server.h.
◆ COAP_SERVER_MAX_URI_LEN
| #define COAP_SERVER_MAX_URI_LEN 128 |
Definition at line 98 of file coap_server.h.
◆ COAP_SERVER_PRIORITY
| #define COAP_SERVER_PRIORITY OS_TASK_PRIORITY_NORMAL |
Definition at line 105 of file coap_server.h.
◆ COAP_SERVER_PRIVATE_CONTEXT
| #define COAP_SERVER_PRIVATE_CONTEXT |
Definition at line 110 of file coap_server.h.
◆ COAP_SERVER_SESSION_TIMEOUT
| #define COAP_SERVER_SESSION_TIMEOUT 60000 |
Definition at line 77 of file coap_server.h.
◆ COAP_SERVER_STACK_SIZE
| #define COAP_SERVER_STACK_SIZE 650 |
Definition at line 56 of file coap_server.h.
◆ COAP_SERVER_SUPPORT
| #define COAP_SERVER_SUPPORT ENABLED |
Definition at line 42 of file coap_server.h.
◆ COAP_SERVER_TICK_INTERVAL
| #define COAP_SERVER_TICK_INTERVAL 500 |
Definition at line 70 of file coap_server.h.
◆ CoapDtlsSession
| #define CoapDtlsSession struct _CoapDtlsSession |
Definition at line 125 of file coap_server.h.
◆ CoapServerContext
| #define CoapServerContext struct _CoapServerContext |
Definition at line 121 of file coap_server.h.
Typedef Documentation
◆ CoapServerDtlsInitCallback
| typedef error_t(* CoapServerDtlsInitCallback) (CoapServerContext *context, TlsContext *dtlsContext) |
DTLS initialization callback.
Definition at line 148 of file coap_server.h.
◆ CoapServerRequestCallback
| typedef error_t(* CoapServerRequestCallback) (CoapServerContext *context, CoapCode method, const char_t *uri) |
CoAP request callback function.
Definition at line 158 of file coap_server.h.
◆ CoapServerUdpInitCallback
| typedef error_t(* CoapServerUdpInitCallback) (CoapServerContext *context, Socket *socket) |
UDP initialization callback function.
Definition at line 137 of file coap_server.h.
Function Documentation
◆ coapServerDeinit()
| void coapServerDeinit | ( | CoapServerContext * | context | ) |
Release CoAP server context.
- Parameters
-
[in] context Pointer to the CoAP server context
Definition at line 399 of file coap_server.c.
◆ coapServerGetDefaultSettings()
| void coapServerGetDefaultSettings | ( | CoapServerSettings * | settings | ) |
Initialize settings with default values.
- Parameters
-
[out] settings Structure that contains CoAP server settings
Definition at line 51 of file coap_server.c.
◆ coapServerInit()
| error_t coapServerInit | ( | CoapServerContext * | context, |
| const CoapServerSettings * | settings | ||
| ) |
CoAP server initialization.
- Parameters
-
[in] context Pointer to the CoAP server context [in] settings CoAP server specific settings
- Returns
- Error code
Definition at line 84 of file coap_server.c.
◆ coapServerSetCookieSecret()
| error_t coapServerSetCookieSecret | ( | CoapServerContext * | context, |
| const uint8_t * | cookieSecret, | ||
| size_t | cookieSecretLen | ||
| ) |
Set cookie secret.
This function specifies the cookie secret used while generating and verifying a cookie during the DTLS handshake
- Parameters
-
[in] context Pointer to the CoAP server context [in] cookieSecret Pointer to the secret key [in] cookieSecretLen Length of the secret key, in bytes
- Returns
- Error code
Definition at line 140 of file coap_server.c.
◆ coapServerStart()
| error_t coapServerStart | ( | CoapServerContext * | context | ) |
Start CoAP server.
- Parameters
-
[in] context Pointer to the CoAP server context
- Returns
- Error code
Definition at line 170 of file coap_server.c.
◆ coapServerStop()
| error_t coapServerStop | ( | CoapServerContext * | context | ) |
Stop CoAP server.
- Parameters
-
[in] context Pointer to the CoAP server context
- Returns
- Error code
Definition at line 268 of file coap_server.c.
◆ coapServerTask()
| void coapServerTask | ( | CoapServerContext * | context | ) |
CoAP server task.
- Parameters
-
[in] context Pointer to the CoAP server context
Definition at line 321 of file coap_server.c.
