NSDL C library

Dependents:   NSDL_HelloWorld_WiFi UbloxModemNanoServiceClient IOT-NSDL_HelloWorld LWM2M_NanoService_Ethernet ... more

Fork of nsdl_lib by Tero Heinonen

Note that use of this software requires acceptance of the Sensinode EULA: http://mbed.org/teams/Sensinode/code/nsdl_lib/wiki/EULA

Committer:
terohoo
Date:
Mon Oct 14 11:00:30 2013 +0000
Revision:
5:da1db64e7fb9
Parent:
0:58c4f13c4b9a
Child:
6:1caf76131c9a
- New library build; - Header cleaning

Who changed what in which revision?

UserRevisionLine numberNew contents of line
terohoo 0:58c4f13c4b9a 1 /**
terohoo 0:58c4f13c4b9a 2 * \file sn_nsdl.h
terohoo 0:58c4f13c4b9a 3 *
terohoo 0:58c4f13c4b9a 4 * \brief NanoService Devices Library generic header file
terohoo 0:58c4f13c4b9a 5 *
terohoo 0:58c4f13c4b9a 6 * Created on: Aug 23, 2011
terohoo 0:58c4f13c4b9a 7 * Author: tero
terohoo 0:58c4f13c4b9a 8 *
terohoo 0:58c4f13c4b9a 9 */
terohoo 0:58c4f13c4b9a 10
terohoo 0:58c4f13c4b9a 11 #ifdef __cplusplus
terohoo 0:58c4f13c4b9a 12 extern "C" {
terohoo 0:58c4f13c4b9a 13 #endif
terohoo 0:58c4f13c4b9a 14
terohoo 0:58c4f13c4b9a 15 #ifndef SN_NSDL_H_
terohoo 0:58c4f13c4b9a 16 #define SN_NSDL_H_
terohoo 0:58c4f13c4b9a 17
terohoo 0:58c4f13c4b9a 18 /* * * * * * * * * * * */
terohoo 0:58c4f13c4b9a 19 /* * * * DEFINES * * * */
terohoo 0:58c4f13c4b9a 20 /* * * * * * * * * * * */
terohoo 0:58c4f13c4b9a 21
terohoo 0:58c4f13c4b9a 22 #define SN_GRS_VERSION 0x0101
terohoo 0:58c4f13c4b9a 23
terohoo 0:58c4f13c4b9a 24 #ifndef SN_NSDL_HAVE_HTTP_CAPABILITY
terohoo 0:58c4f13c4b9a 25 #define SN_NSDL_HAVE_HTTP_CAPABILITY 0
terohoo 0:58c4f13c4b9a 26 #endif
terohoo 0:58c4f13c4b9a 27
terohoo 0:58c4f13c4b9a 28 #ifndef SN_NSDL_HAVE_HTTPS_CAPABILITY
terohoo 5:da1db64e7fb9 29 #define SN_NSDL_HAVE_HTTPS_CAPABILITY 0
terohoo 0:58c4f13c4b9a 30 #endif
terohoo 0:58c4f13c4b9a 31
terohoo 0:58c4f13c4b9a 32 #ifndef SN_NSDL_HAVE_COAP_CAPABILITY
terohoo 0:58c4f13c4b9a 33 #define SN_NSDL_HAVE_COAP_CAPABILITY 1
terohoo 0:58c4f13c4b9a 34 #endif
terohoo 0:58c4f13c4b9a 35
terohoo 0:58c4f13c4b9a 36 /* * * Common * * */
terohoo 0:58c4f13c4b9a 37
terohoo 0:58c4f13c4b9a 38 #define SN_NSDL_SUCCESS 0
terohoo 0:58c4f13c4b9a 39 #define SN_NSDL_FAILURE (-1)
terohoo 0:58c4f13c4b9a 40
terohoo 0:58c4f13c4b9a 41 /* * * * * * * * * * * * * * */
terohoo 0:58c4f13c4b9a 42 /* * * * ENUMERATIONS * * * */
terohoo 0:58c4f13c4b9a 43 /* * * * * * * * * * * * * * */
terohoo 0:58c4f13c4b9a 44
terohoo 0:58c4f13c4b9a 45
terohoo 5:da1db64e7fb9 46 /**
terohoo 5:da1db64e7fb9 47 * \brief Used protocol
terohoo 5:da1db64e7fb9 48 */
terohoo 0:58c4f13c4b9a 49 typedef enum sn_nsdl_capab_
terohoo 0:58c4f13c4b9a 50 {
terohoo 5:da1db64e7fb9 51 SN_NSDL_PROTOCOL_HTTP = 0x01, /**< Unsupported */
terohoo 5:da1db64e7fb9 52 SN_NSDL_PROTOCOL_HTTPS = 0x02, /**< Unsupported */
terohoo 5:da1db64e7fb9 53 SN_NSDL_PROTOCOL_COAP = 0x04 /**< Supported */
terohoo 0:58c4f13c4b9a 54 } sn_nsdl_capab_e;
terohoo 0:58c4f13c4b9a 55
terohoo 5:da1db64e7fb9 56 /**
terohoo 5:da1db64e7fb9 57 * \brief Address type of given address
terohoo 5:da1db64e7fb9 58 */
terohoo 0:58c4f13c4b9a 59 typedef enum sn_nsdl_addr_type_
terohoo 0:58c4f13c4b9a 60 {
terohoo 5:da1db64e7fb9 61 SN_NSDL_ADDRESS_TYPE_IPV6 = 0x01, /**< Supported */
terohoo 5:da1db64e7fb9 62 SN_NSDL_ADDRESS_TYPE_IPV4 = 0x02, /**< Supported */
terohoo 5:da1db64e7fb9 63 SN_NSDL_ADDRESS_TYPE_HOSTNAME = 0x03, /**< Unsupported */
terohoo 0:58c4f13c4b9a 64 SN_NSDL_ADDRESS_TYPE_NONE = 0xFF
terohoo 0:58c4f13c4b9a 65 } sn_nsdl_addr_type_e;
terohoo 0:58c4f13c4b9a 66
terohoo 0:58c4f13c4b9a 67
terohoo 0:58c4f13c4b9a 68 /* * * * * * * * * * * * * */
terohoo 0:58c4f13c4b9a 69 /* * * * STRUCTURES * * * */
terohoo 0:58c4f13c4b9a 70 /* * * * * * * * * * * * * */
terohoo 0:58c4f13c4b9a 71
terohoo 5:da1db64e7fb9 72 /**
terohoo 5:da1db64e7fb9 73 * \brief Address structure of Packet data
terohoo 5:da1db64e7fb9 74 */
terohoo 0:58c4f13c4b9a 75 typedef struct sn_nsdl_addr_
terohoo 0:58c4f13c4b9a 76 {
terohoo 0:58c4f13c4b9a 77 sn_nsdl_addr_type_e type;
terohoo 0:58c4f13c4b9a 78
terohoo 0:58c4f13c4b9a 79 uint8_t addr_len;
terohoo 0:58c4f13c4b9a 80 uint8_t *addr_ptr;
terohoo 0:58c4f13c4b9a 81
terohoo 0:58c4f13c4b9a 82 uint16_t port;
terohoo 0:58c4f13c4b9a 83
terohoo 0:58c4f13c4b9a 84 void *socket_information;
terohoo 0:58c4f13c4b9a 85
terohoo 0:58c4f13c4b9a 86 } sn_nsdl_addr_s;
terohoo 0:58c4f13c4b9a 87
terohoo 5:da1db64e7fb9 88 /**
terohoo 5:da1db64e7fb9 89 * \brief Used for creating manually NSP registration message with sn_coap_register()
terohoo 5:da1db64e7fb9 90 */
terohoo 0:58c4f13c4b9a 91 typedef struct registration_info_
terohoo 0:58c4f13c4b9a 92 {
terohoo 5:da1db64e7fb9 93 uint8_t *endpoint_ptr; /**< Endpoint name */
terohoo 0:58c4f13c4b9a 94 uint8_t endpoint_len;
terohoo 0:58c4f13c4b9a 95
terohoo 5:da1db64e7fb9 96 uint8_t *endpoint_type_ptr; /**< Endpoint type */
terohoo 0:58c4f13c4b9a 97 uint8_t endpoint_type_len;
terohoo 0:58c4f13c4b9a 98
terohoo 5:da1db64e7fb9 99 uint8_t *links_ptr; /**< Resource registration string */
terohoo 0:58c4f13c4b9a 100 uint16_t links_len;
terohoo 0:58c4f13c4b9a 101
terohoo 5:da1db64e7fb9 102 } registration_info_t;
terohoo 0:58c4f13c4b9a 103
terohoo 0:58c4f13c4b9a 104 #endif /* SN_NSDL_H_ */
terohoo 0:58c4f13c4b9a 105
terohoo 0:58c4f13c4b9a 106 #ifdef __cplusplus
terohoo 0:58c4f13c4b9a 107 }
terohoo 5:da1db64e7fb9 108 #endif