![](/media/cache/profiles/debfdc81854eac26ec993b55a659c6e1.jpg.50x50_q85.jpg)
mbed client lightswitch demo
Dependencies: mbed Socket lwip-eth lwip-sys lwip
Fork of mbed-client-classic-example-lwip by
mbed-client-c/source/libCoap/src/include/sn_coap_header_internal.h@11:cada08fc8a70, 2016-06-09 (annotated)
- Committer:
- mbedAustin
- Date:
- Thu Jun 09 17:08:36 2016 +0000
- Revision:
- 11:cada08fc8a70
Commit for public Consumption
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbedAustin | 11:cada08fc8a70 | 1 | /* |
mbedAustin | 11:cada08fc8a70 | 2 | * Copyright (c) 2011-2015 ARM Limited. All rights reserved. |
mbedAustin | 11:cada08fc8a70 | 3 | * SPDX-License-Identifier: Apache-2.0 |
mbedAustin | 11:cada08fc8a70 | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
mbedAustin | 11:cada08fc8a70 | 5 | * not use this file except in compliance with the License. |
mbedAustin | 11:cada08fc8a70 | 6 | * You may obtain a copy of the License at |
mbedAustin | 11:cada08fc8a70 | 7 | * |
mbedAustin | 11:cada08fc8a70 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
mbedAustin | 11:cada08fc8a70 | 9 | * |
mbedAustin | 11:cada08fc8a70 | 10 | * Unless required by applicable law or agreed to in writing, software |
mbedAustin | 11:cada08fc8a70 | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
mbedAustin | 11:cada08fc8a70 | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
mbedAustin | 11:cada08fc8a70 | 13 | * See the License for the specific language governing permissions and |
mbedAustin | 11:cada08fc8a70 | 14 | * limitations under the License. |
mbedAustin | 11:cada08fc8a70 | 15 | */ |
mbedAustin | 11:cada08fc8a70 | 16 | |
mbedAustin | 11:cada08fc8a70 | 17 | /** |
mbedAustin | 11:cada08fc8a70 | 18 | * \file sn_coap_header_internal.h |
mbedAustin | 11:cada08fc8a70 | 19 | * |
mbedAustin | 11:cada08fc8a70 | 20 | * \brief Header file for CoAP Header part |
mbedAustin | 11:cada08fc8a70 | 21 | * |
mbedAustin | 11:cada08fc8a70 | 22 | */ |
mbedAustin | 11:cada08fc8a70 | 23 | |
mbedAustin | 11:cada08fc8a70 | 24 | #ifdef __cplusplus |
mbedAustin | 11:cada08fc8a70 | 25 | extern "C" { |
mbedAustin | 11:cada08fc8a70 | 26 | #endif |
mbedAustin | 11:cada08fc8a70 | 27 | |
mbedAustin | 11:cada08fc8a70 | 28 | #ifndef SN_COAP_HEADER_INTERNAL_H_ |
mbedAustin | 11:cada08fc8a70 | 29 | #define SN_COAP_HEADER_INTERNAL_H_ |
mbedAustin | 11:cada08fc8a70 | 30 | |
mbedAustin | 11:cada08fc8a70 | 31 | |
mbedAustin | 11:cada08fc8a70 | 32 | /* * * * * * * * * * * */ |
mbedAustin | 11:cada08fc8a70 | 33 | /* * * * DEFINES * * * */ |
mbedAustin | 11:cada08fc8a70 | 34 | /* * * * * * * * * * * */ |
mbedAustin | 11:cada08fc8a70 | 35 | |
mbedAustin | 11:cada08fc8a70 | 36 | #define COAP_VERSION COAP_VERSION_1 /* Tells which IETF CoAP specification version the CoAP message supports. */ |
mbedAustin | 11:cada08fc8a70 | 37 | /* This value is written to CoAP message header part. */ |
mbedAustin | 11:cada08fc8a70 | 38 | |
mbedAustin | 11:cada08fc8a70 | 39 | /* CoAP Header defines */ |
mbedAustin | 11:cada08fc8a70 | 40 | #define COAP_HEADER_LENGTH 4 /* Fixed Header length of CoAP message as bytes */ |
mbedAustin | 11:cada08fc8a70 | 41 | #define COAP_HEADER_VERSION_MASK 0xC0 |
mbedAustin | 11:cada08fc8a70 | 42 | #define COAP_HEADER_MSG_TYPE_MASK 0x30 |
mbedAustin | 11:cada08fc8a70 | 43 | #define COAP_HEADER_TOKEN_LENGTH_MASK 0x0F |
mbedAustin | 11:cada08fc8a70 | 44 | #define COAP_HEADER_MSG_ID_MSB_SHIFT 8 |
mbedAustin | 11:cada08fc8a70 | 45 | |
mbedAustin | 11:cada08fc8a70 | 46 | /* CoAP Options defines */ |
mbedAustin | 11:cada08fc8a70 | 47 | #define COAP_OPTIONS_OPTION_NUMBER_SHIFT 4 |
mbedAustin | 11:cada08fc8a70 | 48 | |
mbedAustin | 11:cada08fc8a70 | 49 | /* * * * * * * * * * * * * * */ |
mbedAustin | 11:cada08fc8a70 | 50 | /* * * * ENUMERATIONS * * * */ |
mbedAustin | 11:cada08fc8a70 | 51 | /* * * * * * * * * * * * * * */ |
mbedAustin | 11:cada08fc8a70 | 52 | |
mbedAustin | 11:cada08fc8a70 | 53 | /* * * * * * * * * * * * * */ |
mbedAustin | 11:cada08fc8a70 | 54 | /* * * * STRUCTURES * * * */ |
mbedAustin | 11:cada08fc8a70 | 55 | /* * * * * * * * * * * * * */ |
mbedAustin | 11:cada08fc8a70 | 56 | |
mbedAustin | 11:cada08fc8a70 | 57 | /** |
mbedAustin | 11:cada08fc8a70 | 58 | * \brief This structure is returned by sn_coap_exec() for sending |
mbedAustin | 11:cada08fc8a70 | 59 | */ |
mbedAustin | 11:cada08fc8a70 | 60 | typedef struct sn_nsdl_transmit_ { |
mbedAustin | 11:cada08fc8a70 | 61 | sn_nsdl_addr_s *dst_addr_ptr; |
mbedAustin | 11:cada08fc8a70 | 62 | |
mbedAustin | 11:cada08fc8a70 | 63 | sn_nsdl_capab_e protocol; |
mbedAustin | 11:cada08fc8a70 | 64 | |
mbedAustin | 11:cada08fc8a70 | 65 | uint16_t packet_len; |
mbedAustin | 11:cada08fc8a70 | 66 | uint8_t *packet_ptr; |
mbedAustin | 11:cada08fc8a70 | 67 | } sn_nsdl_transmit_s; |
mbedAustin | 11:cada08fc8a70 | 68 | |
mbedAustin | 11:cada08fc8a70 | 69 | /* * * * * * * * * * * * * * * * * * * * * * */ |
mbedAustin | 11:cada08fc8a70 | 70 | /* * * * EXTERNAL FUNCTION PROTOTYPES * * * */ |
mbedAustin | 11:cada08fc8a70 | 71 | /* * * * * * * * * * * * * * * * * * * * * * */ |
mbedAustin | 11:cada08fc8a70 | 72 | extern int8_t sn_coap_header_validity_check(sn_coap_hdr_s *src_coap_msg_ptr, coap_version_e coap_version); |
mbedAustin | 11:cada08fc8a70 | 73 | |
mbedAustin | 11:cada08fc8a70 | 74 | #endif /* SN_COAP_HEADER_INTERNAL_H_ */ |
mbedAustin | 11:cada08fc8a70 | 75 | |
mbedAustin | 11:cada08fc8a70 | 76 | #ifdef __cplusplus |
mbedAustin | 11:cada08fc8a70 | 77 | } |
mbedAustin | 11:cada08fc8a70 | 78 | #endif |
mbedAustin | 11:cada08fc8a70 | 79 |