Definitions common to CoAP client and server. More...
#include "core/net.h"Go to the source code of this file.
Macros | |
| #define | COAP_PORT 5683 |
| #define | COAPS_PORT 5684 |
| #define | COAP_HEADER_SIZE 4 |
| #define | COAP_MAX_TOKEN_LEN 8 |
| #define | COAP_PAYLOAD_MARKER 0xFF |
| #define | COAP_CODE(c, d) ((((c) & 0x07U) << 5U) | ((d) & 0x1FU)) |
| #define | COAP_GET_CODE_CLASS(code) (((code) >> 5U) & 0x07U) |
| #define | COAP_GET_CODE_SUBCLASS(code) ((code) & 0x1FU) |
Variables | |
| typedef | __packed_struct |
| CoAP message format. More... | |
| uint8_t | type |
| uint8_t | version |
| uint8_t | code |
| uint16_t | mid |
| uint8_t | token [] |
| CoapMessageHeader | |
| uint8_t | delta |
| CoapOptionHeader | |
Detailed Description
Definitions common to CoAP client and 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_common.h.
Macro Definition Documentation
◆ COAP_CODE
Definition at line 51 of file coap_common.h.
◆ COAP_GET_CODE_CLASS
Definition at line 54 of file coap_common.h.
◆ COAP_GET_CODE_SUBCLASS
Definition at line 56 of file coap_common.h.
◆ COAP_HEADER_SIZE
| #define COAP_HEADER_SIZE 4 |
Definition at line 43 of file coap_common.h.
◆ COAP_MAX_TOKEN_LEN
| #define COAP_MAX_TOKEN_LEN 8 |
Definition at line 45 of file coap_common.h.
◆ COAP_PAYLOAD_MARKER
| #define COAP_PAYLOAD_MARKER 0xFF |
Definition at line 48 of file coap_common.h.
◆ COAP_PORT
| #define COAP_PORT 5683 |
Definition at line 38 of file coap_common.h.
◆ COAPS_PORT
| #define COAPS_PORT 5684 |
Definition at line 40 of file coap_common.h.
Enumeration Type Documentation
◆ CoapCode
| enum CoapCode |
CoAP method and response codes.
Definition at line 112 of file coap_common.h.
◆ CoapCodeClass
| enum CoapCodeClass |
CoAP code classes.
| Enumerator | |
|---|---|
| COAP_CODE_CLASS_SUCCESS | |
| COAP_CODE_CLASS_CLIENT_ERROR | |
| COAP_CODE_CLASS_SERVER_ERROR | |
Definition at line 100 of file coap_common.h.
◆ CoapMessageType
| enum CoapMessageType |
CoAP message types.
| Enumerator | |
|---|---|
| COAP_TYPE_CON | Confirmable message. |
| COAP_TYPE_NON | Non-confirmable message. |
| COAP_TYPE_ACK | Acknowledgment message. |
| COAP_TYPE_RST | Reset message. |
Definition at line 87 of file coap_common.h.
◆ CoapProtocolLevel
| enum CoapProtocolLevel |
CoAP version numbers.
| Enumerator | |
|---|---|
| COAP_VERSION_1 | CoAP version 1. |
Definition at line 68 of file coap_common.h.
◆ CoapTransportProtocol
CoAP transport protocols.
| Enumerator | |
|---|---|
| COAP_TRANSPORT_PROTOCOL_UDP | UDP protocol. |
| COAP_TRANSPORT_PROTOCOL_DTLS | DTLS protocol. |
Definition at line 77 of file coap_common.h.
Variable Documentation
◆ __packed_struct
| typedef __packed_struct |
CoAP message format.
CoAP option format.
Definition at line 168 of file coap_common.h.
◆ CoapMessageHeader
| CoapMessageHeader |
Definition at line 182 of file coap_common.h.
◆ CoapOptionHeader
| CoapOptionHeader |
Definition at line 198 of file coap_common.h.
◆ code
| uint8_t code |
Definition at line 179 of file coap_common.h.
◆ delta
| uint8_t delta |
Definition at line 196 of file coap_common.h.
◆ mid
| uint16_t mid |
Definition at line 180 of file coap_common.h.
◆ token
| uint8_t token[] |
Definition at line 181 of file coap_common.h.
◆ type
| uint8_t type |
Definition at line 176 of file coap_common.h.
◆ version
| uint8_t version |
Definition at line 177 of file coap_common.h.
