coap_server.c File Reference

CoAP server. More...

#include <stdlib.h>
#include "coap/coap_server.h"
#include "coap/coap_server_transport.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 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-2024 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.4.0

Definition in file coap_server.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   COAP_TRACE_LEVEL

Definition at line 32 of file coap_server.c.

Function Documentation

◆ coapServerDeinit()

void coapServerDeinit ( CoapServerContext context)

Release CoAP server context.

Parameters
[in]contextPointer to the CoAP server context

Definition at line 397 of file coap_server.c.

◆ coapServerGetDefaultSettings()

void coapServerGetDefaultSettings ( CoapServerSettings settings)

Initialize settings with default values.

Parameters
[out]settingsStructure 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]contextPointer to the CoAP server context
[in]settingsCoAP 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]contextPointer to the CoAP server context
[in]cookieSecretPointer to the secret key
[in]cookieSecretLenLength 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]contextPointer 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]contextPointer 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]contextPointer to the CoAP server context

Definition at line 319 of file coap_server.c.