nsp specific components for the NSP version of the impact endpoint

Dependents:   mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet mbed_nsp_endpoint_nxp

Committer:
ansond
Date:
Wed Sep 17 05:45:12 2014 +0000
Revision:
26:8884ef443738
Parent:
25:d7f6769dd97e
yet more stability updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 2:a895137e9082 1 /* Copyright C2013 Doug Anson, MIT License
ansond 2:a895137e9082 2 *
ansond 2:a895137e9082 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
ansond 2:a895137e9082 4 * and associated documentation files the "Software", to deal in the Software without restriction,
ansond 2:a895137e9082 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
ansond 2:a895137e9082 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
ansond 2:a895137e9082 7 * furnished to do so, subject to the following conditions:
ansond 2:a895137e9082 8 *
ansond 2:a895137e9082 9 * The above copyright notice and this permission notice shall be included in all copies or
ansond 2:a895137e9082 10 * substantial portions of the Software.
ansond 2:a895137e9082 11 *
ansond 2:a895137e9082 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
ansond 2:a895137e9082 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
ansond 2:a895137e9082 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
ansond 2:a895137e9082 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
ansond 2:a895137e9082 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ansond 2:a895137e9082 17 */
ansond 2:a895137e9082 18
ansond 2:a895137e9082 19 #ifndef _NSP_DEFINITIONS_H_
ansond 2:a895137e9082 20 #define _NSP_DEFINITIONS_H_
ansond 2:a895137e9082 21
ansond 4:7f7fe167d9c0 22 // Our Endpoint Version Annoucement
ansond 4:7f7fe167d9c0 23 #define ENDPOINT_VERSION_ANNOUNCE "\r\nMBED NSP Endpoint v1.0"
ansond 4:7f7fe167d9c0 24
ansond 2:a895137e9082 25 // NSP Configuration
ansond 13:6998d9c2410e 26 #define NSP_ADDRESS "192.168.1.220" // Target NSP Service - (default)
ansond 13:6998d9c2410e 27 #define NSP_PORT 5683 // Target NSP Service Port Number
ansond 2:a895137e9082 28
ansond 2:a895137e9082 29 // Enable/Disable NSP Get and GetPut operations
ansond 13:6998d9c2410e 30 #define NSP_ENABLE_GET true // true - enable, false - disable
ansond 13:6998d9c2410e 31 #define NSP_ENABLE_GETPUT true // true - enable, false - disable
ansond 2:a895137e9082 32
ansond 2:a895137e9082 33 // Preference File Configuration
ansond 13:6998d9c2410e 34 #define PREFERENCES_FILE "/local/nsp.cfg" // preferences file for endpoint
ansond 2:a895137e9082 35
ansond 24:b62fec3ff73c 36 // Gateway REST API URL
ansond 24:b62fec3ff73c 37 #define GW_AUTOREGISTER_URL "http://%s:%s/NSP-IOC-Gateway/IOCRestAPI?ep=%s"
ansond 24:b62fec3ff73c 38
ansond 24:b62fec3ff73c 39 // Auto Register buffer sizes
ansond 24:b62fec3ff73c 40 #define AUTOREGISTER_URL_LENGTH 128
ansond 24:b62fec3ff73c 41 #define AUTOREGISTER_RESPONSE_LEN 128
ansond 24:b62fec3ff73c 42 #define GW_AUTOREGISTER_TIMEOUT_MS 2500
ansond 24:b62fec3ff73c 43
ansond 4:7f7fe167d9c0 44 // Personality Name Configuration
ansond 4:7f7fe167d9c0 45 #ifdef LIGHT_PERSONALITY
ansond 13:6998d9c2410e 46 #define PERSONALITY_NAME "light-nsp-%d" // name of each personality (i.e. light) in this endpoint
ansond 13:6998d9c2410e 47 #define NSP_NODE_TYPE LIGHT_TYPE_STRING // Node type
ansond 13:6998d9c2410e 48 #define PERSONALITY_TYPE LIGHT_TYPE_STRING // type of personality
ansond 13:6998d9c2410e 49 #define NSP_ENDPOINT_TYPE "MBED NSP Light Node" // mfg type
ansond 4:7f7fe167d9c0 50 #endif
ansond 7:0207dfb9c36b 51 #ifdef COPCAR_PERSONALITY
ansond 13:6998d9c2410e 52 #define PERSONALITY_NAME "copcar-nsp-%d" // name of each personality (i.e. copcar) in this endpoint
ansond 13:6998d9c2410e 53 #define NSP_NODE_TYPE "CopCar" // Node type
ansond 13:6998d9c2410e 54 #define PERSONALITY_TYPE "Cop Car" // type of personality
ansond 13:6998d9c2410e 55 #define NSP_ENDPOINT_TYPE "MBED NSP Cop Car" // mfg type
ansond 7:0207dfb9c36b 56 #endif
ansond 2:a895137e9082 57
ansond 2:a895137e9082 58 // NSP Configuration
ansond 26:8884ef443738 59 #define NSP_NODE_LIFETIME "9999" // Node lifetime (seconds) - 25 minutes
ansond 13:6998d9c2410e 60 #define RD_UPDATE_PERIOD 600 // The number of seconds between NSP (re)registration messages - 10 minutes
ansond 2:a895137e9082 61
ansond 2:a895137e9082 62 // NSP Registration Configuration
ansond 13:6998d9c2410e 63 #define NSP_RESOURCES_OBSERVABLE 1 // 1 - all resources will be registered as observable, 0 - not observable
ansond 13:6998d9c2410e 64 #define NSP_RESOURCES_REGISTERED 1 // 1 - all resources will be registered, 0 - not registered
ansond 2:a895137e9082 65
ansond 2:a895137e9082 66 // Transport Configuration
ansond 13:6998d9c2410e 67 #define NUM_TRANSPORTS 2 // Transports used
ansond 13:6998d9c2410e 68 #define NSP_TRANSPORT 0 // NSP Transport index
ansond 13:6998d9c2410e 69 #define HTTP_TRANSPORT 1 // HTTP Transport index
ansond 2:a895137e9082 70
ansond 2:a895137e9082 71 #endif // _NSP_DEFINITIONS_H_