mbed client lightswitch demo

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Fork of mbed-client-classic-example-lwip by Austin Blackstone

Committer:
mbedAustin
Date:
Thu Jun 09 17:08:36 2016 +0000
Revision:
11:cada08fc8a70
Commit for public Consumption

Who changed what in which revision?

UserRevisionLine numberNew 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_nsdl.h
mbedAustin 11:cada08fc8a70 19 *
mbedAustin 11:cada08fc8a70 20 * \brief libNsdl generic header file
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_NSDL_H_
mbedAustin 11:cada08fc8a70 29 #define SN_NSDL_H_
mbedAustin 11:cada08fc8a70 30
mbedAustin 11:cada08fc8a70 31 /* * * Common * * */
mbedAustin 11:cada08fc8a70 32
mbedAustin 11:cada08fc8a70 33 #define SN_NSDL_SUCCESS 0
mbedAustin 11:cada08fc8a70 34 #define SN_NSDL_FAILURE (-1)
mbedAustin 11:cada08fc8a70 35
mbedAustin 11:cada08fc8a70 36 /* * * * * * * * * * * * * * */
mbedAustin 11:cada08fc8a70 37 /* * * * ENUMERATIONS * * * */
mbedAustin 11:cada08fc8a70 38 /* * * * * * * * * * * * * * */
mbedAustin 11:cada08fc8a70 39
mbedAustin 11:cada08fc8a70 40
mbedAustin 11:cada08fc8a70 41 /**
mbedAustin 11:cada08fc8a70 42 * \brief Used protocol
mbedAustin 11:cada08fc8a70 43 */
mbedAustin 11:cada08fc8a70 44 typedef enum sn_nsdl_capab_ {
mbedAustin 11:cada08fc8a70 45 SN_NSDL_PROTOCOL_HTTP = 0x01, /**< Unsupported */
mbedAustin 11:cada08fc8a70 46 SN_NSDL_PROTOCOL_HTTPS = 0x02, /**< Unsupported */
mbedAustin 11:cada08fc8a70 47 SN_NSDL_PROTOCOL_COAP = 0x04 /**< Supported */
mbedAustin 11:cada08fc8a70 48 } sn_nsdl_capab_e;
mbedAustin 11:cada08fc8a70 49
mbedAustin 11:cada08fc8a70 50 /**
mbedAustin 11:cada08fc8a70 51 * \brief Address type of given address
mbedAustin 11:cada08fc8a70 52 */
mbedAustin 11:cada08fc8a70 53 typedef enum sn_nsdl_addr_type_ {
mbedAustin 11:cada08fc8a70 54 SN_NSDL_ADDRESS_TYPE_IPV6 = 0x01, /**< Supported */
mbedAustin 11:cada08fc8a70 55 SN_NSDL_ADDRESS_TYPE_IPV4 = 0x02, /**< Supported */
mbedAustin 11:cada08fc8a70 56 SN_NSDL_ADDRESS_TYPE_HOSTNAME = 0x03, /**< Unsupported */
mbedAustin 11:cada08fc8a70 57 SN_NSDL_ADDRESS_TYPE_NONE = 0xFF
mbedAustin 11:cada08fc8a70 58 } sn_nsdl_addr_type_e;
mbedAustin 11:cada08fc8a70 59
mbedAustin 11:cada08fc8a70 60
mbedAustin 11:cada08fc8a70 61 #define SN_NDSL_RESOURCE_NOT_REGISTERED 0
mbedAustin 11:cada08fc8a70 62 #define SN_NDSL_RESOURCE_REGISTERING 1
mbedAustin 11:cada08fc8a70 63 #define SN_NDSL_RESOURCE_REGISTERED 2
mbedAustin 11:cada08fc8a70 64
mbedAustin 11:cada08fc8a70 65
mbedAustin 11:cada08fc8a70 66 /* * * * * * * * * * * * * */
mbedAustin 11:cada08fc8a70 67 /* * * * STRUCTURES * * * */
mbedAustin 11:cada08fc8a70 68 /* * * * * * * * * * * * * */
mbedAustin 11:cada08fc8a70 69
mbedAustin 11:cada08fc8a70 70 /**
mbedAustin 11:cada08fc8a70 71 * \brief Address structure of Packet data
mbedAustin 11:cada08fc8a70 72 */
mbedAustin 11:cada08fc8a70 73 typedef struct sn_nsdl_addr_ {
mbedAustin 11:cada08fc8a70 74 sn_nsdl_addr_type_e type;
mbedAustin 11:cada08fc8a70 75
mbedAustin 11:cada08fc8a70 76 uint8_t addr_len;
mbedAustin 11:cada08fc8a70 77 uint8_t *addr_ptr;
mbedAustin 11:cada08fc8a70 78
mbedAustin 11:cada08fc8a70 79 uint16_t port;
mbedAustin 11:cada08fc8a70 80
mbedAustin 11:cada08fc8a70 81 } sn_nsdl_addr_s;
mbedAustin 11:cada08fc8a70 82
mbedAustin 11:cada08fc8a70 83 /**
mbedAustin 11:cada08fc8a70 84 * \brief Used for creating manually registration message with sn_coap_register()
mbedAustin 11:cada08fc8a70 85 */
mbedAustin 11:cada08fc8a70 86 typedef struct registration_info_ {
mbedAustin 11:cada08fc8a70 87 uint8_t *endpoint_ptr; /**< Endpoint name */
mbedAustin 11:cada08fc8a70 88 uint8_t endpoint_len;
mbedAustin 11:cada08fc8a70 89
mbedAustin 11:cada08fc8a70 90 uint8_t *endpoint_type_ptr; /**< Endpoint type */
mbedAustin 11:cada08fc8a70 91 uint8_t endpoint_type_len;
mbedAustin 11:cada08fc8a70 92
mbedAustin 11:cada08fc8a70 93 uint8_t *links_ptr; /**< Resource registration string */
mbedAustin 11:cada08fc8a70 94 uint16_t links_len;
mbedAustin 11:cada08fc8a70 95
mbedAustin 11:cada08fc8a70 96 } registration_info_t;
mbedAustin 11:cada08fc8a70 97
mbedAustin 11:cada08fc8a70 98 #endif /* SN_NSDL_H_ */
mbedAustin 11:cada08fc8a70 99
mbedAustin 11:cada08fc8a70 100 #ifdef __cplusplus
mbedAustin 11:cada08fc8a70 101 }
mbedAustin 11:cada08fc8a70 102 #endif
mbedAustin 11:cada08fc8a70 103