MBED NanoService Lighting Endpoint for NXP Ublox (cellular enabled)
Dependencies: C027_Support C12832 StatusReporter LM75B c027_radios endpoint_core endpoint_nsp nsp_resources mbed mbed-rtos
Definitions.h@6:c780baa3b7f1, 2014-02-28 (annotated)
- Committer:
- ansond
- Date:
- Fri Feb 28 04:57:02 2014 +0000
- Revision:
- 6:c780baa3b7f1
- Parent:
- 5:9e795e139e45
- Child:
- 7:cca3a2adb6b8
updates
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ansond | 0:dcced975fb52 | 1 | /* Copyright C2013 Doug Anson, MIT License |
ansond | 0:dcced975fb52 | 2 | * |
ansond | 0:dcced975fb52 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
ansond | 0:dcced975fb52 | 4 | * and associated documentation files the "Software", to deal in the Software without restriction, |
ansond | 0:dcced975fb52 | 5 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
ansond | 0:dcced975fb52 | 6 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
ansond | 0:dcced975fb52 | 7 | * furnished to do so, subject to the following conditions: |
ansond | 0:dcced975fb52 | 8 | * |
ansond | 0:dcced975fb52 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
ansond | 0:dcced975fb52 | 10 | * substantial portions of the Software. |
ansond | 0:dcced975fb52 | 11 | * |
ansond | 0:dcced975fb52 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
ansond | 0:dcced975fb52 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
ansond | 0:dcced975fb52 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
ansond | 0:dcced975fb52 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
ansond | 0:dcced975fb52 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
ansond | 0:dcced975fb52 | 17 | */ |
ansond | 0:dcced975fb52 | 18 | |
ansond | 0:dcced975fb52 | 19 | #ifndef _DEFINITIONS_H_ |
ansond | 0:dcced975fb52 | 20 | #define _DEFINITIONS_H_ |
ansond | 0:dcced975fb52 | 21 | |
ansond | 0:dcced975fb52 | 22 | // platform |
ansond | 0:dcced975fb52 | 23 | #include "mbed.h" |
ansond | 0:dcced975fb52 | 24 | |
ansond | 0:dcced975fb52 | 25 | // Our Endpoint Version Annoucement |
ansond | 0:dcced975fb52 | 26 | #define ENDPOINT_VERSION_ANNOUNCE "\r\nMBED IMPACT(NSP) Endpoint v1.0" |
ansond | 0:dcced975fb52 | 27 | |
ansond | 0:dcced975fb52 | 28 | // Error Handler |
ansond | 5:9e795e139e45 | 29 | #define MAX_LOG_MESSAGE 768 // maximum size of a logging message |
ansond | 5:9e795e139e45 | 30 | |
ansond | 5:9e795e139e45 | 31 | // Resource Configuration |
ansond | 5:9e795e139e45 | 32 | #define RESOURCE_NAME_LEN 20 // Resource name max length |
ansond | 5:9e795e139e45 | 33 | #define RESOURCE_VALUE_LEN 20 // Resource value max length |
ansond | 5:9e795e139e45 | 34 | |
ansond | 5:9e795e139e45 | 35 | // MapEntry Name length |
ansond | 5:9e795e139e45 | 36 | #define MAX_NAME_LENGTH 20 |
ansond | 5:9e795e139e45 | 37 | |
ansond | 5:9e795e139e45 | 38 | // Number of Resources our Endpoint has |
ansond | 5:9e795e139e45 | 39 | #define NUM_RESOURCES 16 |
ansond | 5:9e795e139e45 | 40 | |
ansond | 5:9e795e139e45 | 41 | // IOC <--> Resource Mapping |
ansond | 5:9e795e139e45 | 42 | #define NUM_MAPPINGS NUM_RESOURCES // matches the number of resources |
ansond | 0:dcced975fb52 | 43 | |
ansond | 0:dcced975fb52 | 44 | // Light Configuration |
ansond | 0:dcced975fb52 | 45 | #define NUM_LIGHTS 1 // number of lights in this endpoint |
ansond | 0:dcced975fb52 | 46 | #define LIGHT_NAME "mbed-nsp-light-%d" // name of each light in this endpoint |
ansond | 0:dcced975fb52 | 47 | #define LIGHT_NAME_LEN 64 // buffer size for the light name |
ansond | 0:dcced975fb52 | 48 | #define LIGHT_ON_STATE "0" // initial state of each light in this endpoint |
ansond | 0:dcced975fb52 | 49 | #define LIGHT_DIM_STATE "25" // initial dimming state of each light in this endpoint |
ansond | 0:dcced975fb52 | 50 | #define NSP_NODE_TYPE "MBED NSP light node" // Node type |
ansond | 0:dcced975fb52 | 51 | #define NSP_NODE_LIFETIME "1200" // Node lifetime |
ansond | 0:dcced975fb52 | 52 | #define RD_UPDATE_PERIOD 60 // The number of seconds between NSP registration messages |
ansond | 0:dcced975fb52 | 53 | |
ansond | 4:2469fd2fba1c | 54 | // Endpoint GPS Coordinates |
ansond | 4:2469fd2fba1c | 55 | #define ENDPOINT_LOCATION "Oulo Finland" // Where this light/endpoint lives |
ansond | 4:2469fd2fba1c | 56 | #define ENDPOINT_GPS_COORDS "65.017210,25.492411" // Where this light/endpoint lives |
ansond | 4:2469fd2fba1c | 57 | |
ansond | 0:dcced975fb52 | 58 | // Transport Configuration |
ansond | 0:dcced975fb52 | 59 | #define NUM_TRANSPORTS 1 // NSP Only |
ansond | 0:dcced975fb52 | 60 | #define NSP_TRANSPORT 0 // NSP Transport index |
ansond | 0:dcced975fb52 | 61 | |
ansond | 0:dcced975fb52 | 62 | #define NSP_ADDRESS "192.168.1.150" // Target NSP Service |
ansond | 0:dcced975fb52 | 63 | #define NSP_PORT 8080 // Target NSP Service Port Number |
ansond | 0:dcced975fb52 | 64 | |
ansond | 0:dcced975fb52 | 65 | // Main Loop |
ansond | 0:dcced975fb52 | 66 | #define MAIN_LOOP_SLEEP 100 // sleep time (ms) between main loop iterations |
ansond | 0:dcced975fb52 | 67 | |
ansond | 0:dcced975fb52 | 68 | // LED Blink Time |
ansond | 5:9e795e139e45 | 69 | #define BLINK_TIME 100 // LED blink times |
ansond | 0:dcced975fb52 | 70 | |
ansond | 6:c780baa3b7f1 | 71 | // Philips Light Support |
ansond | 6:c780baa3b7f1 | 72 | #define PL_ENABLE false // true - enable for endpoint light, false - disable |
ansond | 6:c780baa3b7f1 | 73 | #define PL_LIGHT_ID_DOUG 1 // Dougs Light |
ansond | 6:c780baa3b7f1 | 74 | #define PL_LIGHT_ID_BILL 2 // Bills Light |
ansond | 6:c780baa3b7f1 | 75 | #define PL_LIGHT_ID_KERRY 3 // Kerrys Light |
ansond | 6:c780baa3b7f1 | 76 | #define PL_LIGHT_ID PL_LIGHT_ID_DOUG // Default light |
ansond | 6:c780baa3b7f1 | 77 | #define PL_GW_ADDRESS "192.168.1.178" // Philips Gateway in IOT lab (Austin) |
ansond | 6:c780baa3b7f1 | 78 | #define PL_DEFAULT_STATE 1 // on |
ansond | 6:c780baa3b7f1 | 79 | #define PL_DEFAULT_DIM 11 // dim value |
ansond | 6:c780baa3b7f1 | 80 | #define PL_URL_BUFFER_LEN 128 |
ansond | 6:c780baa3b7f1 | 81 | #define PL_PAYLOAD_BUFFER_LEN 128 |
ansond | 6:c780baa3b7f1 | 82 | #define PL_RESPONSE_BUFFER_LEN 128 |
ansond | 6:c780baa3b7f1 | 83 | #define PL_URL_TEMPLATE "http://%s/api/newdeveloper/lights/%d/state" |
ansond | 6:c780baa3b7f1 | 84 | #define PL_ON_COMMAND_TEMPLATE "{\"on\":%s,\"sat\":211,\"bri\":%d,\"hue\":13122}" |
ansond | 6:c780baa3b7f1 | 85 | |
ansond | 0:dcced975fb52 | 86 | #endif // _DEFINITIONS_H |