This is a fork due to permission issues
Dependencies: mbed Socket lwip-eth lwip-sys lwip
Fork of 6_songs-from-the-cloud by
mbed-client/mbed-client-c/nsdl-c/sn_nsdl.h@0:f7c60d3e7b8a, 2016-05-18 (annotated)
- Committer:
- maclobdell
- Date:
- Wed May 18 19:06:32 2016 +0000
- Revision:
- 0:f7c60d3e7b8a
clean version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
maclobdell | 0:f7c60d3e7b8a | 1 | /* |
maclobdell | 0:f7c60d3e7b8a | 2 | * Copyright (c) 2011-2015 ARM Limited. All rights reserved. |
maclobdell | 0:f7c60d3e7b8a | 3 | * SPDX-License-Identifier: Apache-2.0 |
maclobdell | 0:f7c60d3e7b8a | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
maclobdell | 0:f7c60d3e7b8a | 5 | * not use this file except in compliance with the License. |
maclobdell | 0:f7c60d3e7b8a | 6 | * You may obtain a copy of the License at |
maclobdell | 0:f7c60d3e7b8a | 7 | * |
maclobdell | 0:f7c60d3e7b8a | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
maclobdell | 0:f7c60d3e7b8a | 9 | * |
maclobdell | 0:f7c60d3e7b8a | 10 | * Unless required by applicable law or agreed to in writing, software |
maclobdell | 0:f7c60d3e7b8a | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
maclobdell | 0:f7c60d3e7b8a | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
maclobdell | 0:f7c60d3e7b8a | 13 | * See the License for the specific language governing permissions and |
maclobdell | 0:f7c60d3e7b8a | 14 | * limitations under the License. |
maclobdell | 0:f7c60d3e7b8a | 15 | */ |
maclobdell | 0:f7c60d3e7b8a | 16 | |
maclobdell | 0:f7c60d3e7b8a | 17 | /** |
maclobdell | 0:f7c60d3e7b8a | 18 | * \file sn_nsdl.h |
maclobdell | 0:f7c60d3e7b8a | 19 | * |
maclobdell | 0:f7c60d3e7b8a | 20 | * \brief libNsdl generic header file |
maclobdell | 0:f7c60d3e7b8a | 21 | * |
maclobdell | 0:f7c60d3e7b8a | 22 | */ |
maclobdell | 0:f7c60d3e7b8a | 23 | |
maclobdell | 0:f7c60d3e7b8a | 24 | #ifdef __cplusplus |
maclobdell | 0:f7c60d3e7b8a | 25 | extern "C" { |
maclobdell | 0:f7c60d3e7b8a | 26 | #endif |
maclobdell | 0:f7c60d3e7b8a | 27 | |
maclobdell | 0:f7c60d3e7b8a | 28 | #ifndef SN_NSDL_H_ |
maclobdell | 0:f7c60d3e7b8a | 29 | #define SN_NSDL_H_ |
maclobdell | 0:f7c60d3e7b8a | 30 | |
maclobdell | 0:f7c60d3e7b8a | 31 | /* * * Common * * */ |
maclobdell | 0:f7c60d3e7b8a | 32 | |
maclobdell | 0:f7c60d3e7b8a | 33 | #define SN_NSDL_SUCCESS 0 |
maclobdell | 0:f7c60d3e7b8a | 34 | #define SN_NSDL_FAILURE (-1) |
maclobdell | 0:f7c60d3e7b8a | 35 | |
maclobdell | 0:f7c60d3e7b8a | 36 | /* * * * * * * * * * * * * * */ |
maclobdell | 0:f7c60d3e7b8a | 37 | /* * * * ENUMERATIONS * * * */ |
maclobdell | 0:f7c60d3e7b8a | 38 | /* * * * * * * * * * * * * * */ |
maclobdell | 0:f7c60d3e7b8a | 39 | |
maclobdell | 0:f7c60d3e7b8a | 40 | |
maclobdell | 0:f7c60d3e7b8a | 41 | /** |
maclobdell | 0:f7c60d3e7b8a | 42 | * \brief Used protocol |
maclobdell | 0:f7c60d3e7b8a | 43 | */ |
maclobdell | 0:f7c60d3e7b8a | 44 | typedef enum sn_nsdl_capab_ { |
maclobdell | 0:f7c60d3e7b8a | 45 | SN_NSDL_PROTOCOL_HTTP = 0x01, /**< Unsupported */ |
maclobdell | 0:f7c60d3e7b8a | 46 | SN_NSDL_PROTOCOL_HTTPS = 0x02, /**< Unsupported */ |
maclobdell | 0:f7c60d3e7b8a | 47 | SN_NSDL_PROTOCOL_COAP = 0x04 /**< Supported */ |
maclobdell | 0:f7c60d3e7b8a | 48 | } sn_nsdl_capab_e; |
maclobdell | 0:f7c60d3e7b8a | 49 | |
maclobdell | 0:f7c60d3e7b8a | 50 | /** |
maclobdell | 0:f7c60d3e7b8a | 51 | * \brief Address type of given address |
maclobdell | 0:f7c60d3e7b8a | 52 | */ |
maclobdell | 0:f7c60d3e7b8a | 53 | typedef enum sn_nsdl_addr_type_ { |
maclobdell | 0:f7c60d3e7b8a | 54 | SN_NSDL_ADDRESS_TYPE_IPV6 = 0x01, /**< Supported */ |
maclobdell | 0:f7c60d3e7b8a | 55 | SN_NSDL_ADDRESS_TYPE_IPV4 = 0x02, /**< Supported */ |
maclobdell | 0:f7c60d3e7b8a | 56 | SN_NSDL_ADDRESS_TYPE_HOSTNAME = 0x03, /**< Unsupported */ |
maclobdell | 0:f7c60d3e7b8a | 57 | SN_NSDL_ADDRESS_TYPE_NONE = 0xFF |
maclobdell | 0:f7c60d3e7b8a | 58 | } sn_nsdl_addr_type_e; |
maclobdell | 0:f7c60d3e7b8a | 59 | |
maclobdell | 0:f7c60d3e7b8a | 60 | |
maclobdell | 0:f7c60d3e7b8a | 61 | #define SN_NDSL_RESOURCE_NOT_REGISTERED 0 |
maclobdell | 0:f7c60d3e7b8a | 62 | #define SN_NDSL_RESOURCE_REGISTERING 1 |
maclobdell | 0:f7c60d3e7b8a | 63 | #define SN_NDSL_RESOURCE_REGISTERED 2 |
maclobdell | 0:f7c60d3e7b8a | 64 | |
maclobdell | 0:f7c60d3e7b8a | 65 | |
maclobdell | 0:f7c60d3e7b8a | 66 | /* * * * * * * * * * * * * */ |
maclobdell | 0:f7c60d3e7b8a | 67 | /* * * * STRUCTURES * * * */ |
maclobdell | 0:f7c60d3e7b8a | 68 | /* * * * * * * * * * * * * */ |
maclobdell | 0:f7c60d3e7b8a | 69 | |
maclobdell | 0:f7c60d3e7b8a | 70 | /** |
maclobdell | 0:f7c60d3e7b8a | 71 | * \brief Address structure of Packet data |
maclobdell | 0:f7c60d3e7b8a | 72 | */ |
maclobdell | 0:f7c60d3e7b8a | 73 | typedef struct sn_nsdl_addr_ { |
maclobdell | 0:f7c60d3e7b8a | 74 | sn_nsdl_addr_type_e type; |
maclobdell | 0:f7c60d3e7b8a | 75 | |
maclobdell | 0:f7c60d3e7b8a | 76 | uint8_t addr_len; |
maclobdell | 0:f7c60d3e7b8a | 77 | uint8_t *addr_ptr; |
maclobdell | 0:f7c60d3e7b8a | 78 | |
maclobdell | 0:f7c60d3e7b8a | 79 | uint16_t port; |
maclobdell | 0:f7c60d3e7b8a | 80 | |
maclobdell | 0:f7c60d3e7b8a | 81 | } sn_nsdl_addr_s; |
maclobdell | 0:f7c60d3e7b8a | 82 | |
maclobdell | 0:f7c60d3e7b8a | 83 | /** |
maclobdell | 0:f7c60d3e7b8a | 84 | * \brief Used for creating manually registration message with sn_coap_register() |
maclobdell | 0:f7c60d3e7b8a | 85 | */ |
maclobdell | 0:f7c60d3e7b8a | 86 | typedef struct registration_info_ { |
maclobdell | 0:f7c60d3e7b8a | 87 | uint8_t *endpoint_ptr; /**< Endpoint name */ |
maclobdell | 0:f7c60d3e7b8a | 88 | uint8_t endpoint_len; |
maclobdell | 0:f7c60d3e7b8a | 89 | |
maclobdell | 0:f7c60d3e7b8a | 90 | uint8_t *endpoint_type_ptr; /**< Endpoint type */ |
maclobdell | 0:f7c60d3e7b8a | 91 | uint8_t endpoint_type_len; |
maclobdell | 0:f7c60d3e7b8a | 92 | |
maclobdell | 0:f7c60d3e7b8a | 93 | uint8_t *links_ptr; /**< Resource registration string */ |
maclobdell | 0:f7c60d3e7b8a | 94 | uint16_t links_len; |
maclobdell | 0:f7c60d3e7b8a | 95 | |
maclobdell | 0:f7c60d3e7b8a | 96 | } registration_info_t; |
maclobdell | 0:f7c60d3e7b8a | 97 | |
maclobdell | 0:f7c60d3e7b8a | 98 | #endif /* SN_NSDL_H_ */ |
maclobdell | 0:f7c60d3e7b8a | 99 | |
maclobdell | 0:f7c60d3e7b8a | 100 | #ifdef __cplusplus |
maclobdell | 0:f7c60d3e7b8a | 101 | } |
maclobdell | 0:f7c60d3e7b8a | 102 | #endif |
maclobdell | 0:f7c60d3e7b8a | 103 |