Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-client-c by
sn_nsdl.h
00001 /* 00002 * Copyright (c) 2011-2015 ARM Limited. All rights reserved. 00003 * SPDX-License-Identifier: Apache-2.0 00004 * Licensed under the Apache License, Version 2.0 (the License); you may 00005 * not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an AS IS BASIS, WITHOUT 00012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 /** 00018 * \file sn_nsdl.h 00019 * 00020 * \brief libNsdl generic header file 00021 * 00022 */ 00023 00024 #ifdef __cplusplus 00025 extern "C" { 00026 #endif 00027 00028 #ifndef SN_NSDL_H_ 00029 #define SN_NSDL_H_ 00030 00031 /* * * Common * * */ 00032 00033 #define SN_NSDL_SUCCESS 0 00034 #define SN_NSDL_FAILURE (-1) 00035 00036 /* * * * * * * * * * * * * * */ 00037 /* * * * ENUMERATIONS * * * */ 00038 /* * * * * * * * * * * * * * */ 00039 00040 00041 /** 00042 * \brief Used protocol 00043 */ 00044 typedef enum sn_nsdl_capab_ { 00045 SN_NSDL_PROTOCOL_HTTP = 0x01, /**< Unsupported */ 00046 SN_NSDL_PROTOCOL_HTTPS = 0x02, /**< Unsupported */ 00047 SN_NSDL_PROTOCOL_COAP = 0x04 /**< Supported */ 00048 } sn_nsdl_capab_e; 00049 00050 /** 00051 * \brief Address type of given address 00052 */ 00053 typedef enum sn_nsdl_addr_type_ { 00054 SN_NSDL_ADDRESS_TYPE_IPV6 = 0x01, /**< Supported */ 00055 SN_NSDL_ADDRESS_TYPE_IPV4 = 0x02, /**< Supported */ 00056 SN_NSDL_ADDRESS_TYPE_HOSTNAME = 0x03, /**< Unsupported */ 00057 SN_NSDL_ADDRESS_TYPE_NONE = 0xFF 00058 } sn_nsdl_addr_type_e; 00059 00060 00061 #define SN_NDSL_RESOURCE_NOT_REGISTERED 0 00062 #define SN_NDSL_RESOURCE_REGISTERING 1 00063 #define SN_NDSL_RESOURCE_REGISTERED 2 00064 00065 00066 /* * * * * * * * * * * * * */ 00067 /* * * * STRUCTURES * * * */ 00068 /* * * * * * * * * * * * * */ 00069 00070 /** 00071 * \brief Address structure of Packet data 00072 */ 00073 typedef struct sn_nsdl_addr_ { 00074 sn_nsdl_addr_type_e type; 00075 00076 uint8_t addr_len; 00077 uint8_t *addr_ptr; 00078 00079 uint16_t port; 00080 00081 } sn_nsdl_addr_s; 00082 00083 /** 00084 * \brief Used for creating manually registration message with sn_coap_register() 00085 */ 00086 typedef struct registration_info_ { 00087 uint8_t *endpoint_ptr; /**< Endpoint name */ 00088 uint8_t endpoint_len; 00089 00090 uint8_t *endpoint_type_ptr; /**< Endpoint type */ 00091 uint8_t endpoint_type_len; 00092 00093 uint8_t *links_ptr; /**< Resource registration string */ 00094 uint16_t links_len; 00095 00096 } registration_info_t; 00097 00098 #endif /* SN_NSDL_H_ */ 00099 00100 #ifdef __cplusplus 00101 } 00102 #endif
Generated on Wed Jul 13 2022 17:43:56 by
1.7.2
