MBED NanoService Lighting Endpoint for NXP Ublox (Ethernet enabled)
Dependencies: C027 C12832 EthernetInterface StatusReporter LM75B endpoint_core endpoint_nsp mbed-rtos mbed nsp_resources
Definitions.h@148:56bf8bad4567, 2014-03-26 (annotated)
- Committer:
- ansond
- Date:
- Wed Mar 26 19:55:02 2014 +0000
- Revision:
- 148:56bf8bad4567
- Child:
- 149:3a2fe9f6bcb1
updates
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ansond | 148:56bf8bad4567 | 1 | /* Copyright C2013 Doug Anson, MIT License |
ansond | 148:56bf8bad4567 | 2 | * |
ansond | 148:56bf8bad4567 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
ansond | 148:56bf8bad4567 | 4 | * and associated documentation files the "Software", to deal in the Software without restriction, |
ansond | 148:56bf8bad4567 | 5 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
ansond | 148:56bf8bad4567 | 6 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
ansond | 148:56bf8bad4567 | 7 | * furnished to do so, subject to the following conditions: |
ansond | 148:56bf8bad4567 | 8 | * |
ansond | 148:56bf8bad4567 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
ansond | 148:56bf8bad4567 | 10 | * substantial portions of the Software. |
ansond | 148:56bf8bad4567 | 11 | * |
ansond | 148:56bf8bad4567 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
ansond | 148:56bf8bad4567 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
ansond | 148:56bf8bad4567 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
ansond | 148:56bf8bad4567 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
ansond | 148:56bf8bad4567 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
ansond | 148:56bf8bad4567 | 17 | */ |
ansond | 148:56bf8bad4567 | 18 | |
ansond | 148:56bf8bad4567 | 19 | #ifndef _DEFINITIONS_H_ |
ansond | 148:56bf8bad4567 | 20 | #define _DEFINITIONS_H_ |
ansond | 148:56bf8bad4567 | 21 | |
ansond | 148:56bf8bad4567 | 22 | // platform |
ansond | 148:56bf8bad4567 | 23 | #include "mbed.h" |
ansond | 148:56bf8bad4567 | 24 | |
ansond | 148:56bf8bad4567 | 25 | // include common definitions |
ansond | 148:56bf8bad4567 | 26 | #include "CommonDefinitions.h" |
ansond | 148:56bf8bad4567 | 27 | |
ansond | 148:56bf8bad4567 | 28 | // NSP Configuration |
ansond | 148:56bf8bad4567 | 29 | #define NSP_ADDRESS "192.168.1.220" // Target NSP Service - (default) |
ansond | 148:56bf8bad4567 | 30 | #define NSP_PORT 5683 // Target NSP Service Port Number |
ansond | 148:56bf8bad4567 | 31 | |
ansond | 148:56bf8bad4567 | 32 | // Hush Logging |
ansond | 148:56bf8bad4567 | 33 | //#define HUSH_LOG true // false - logging output, true - no logging |
ansond | 148:56bf8bad4567 | 34 | |
ansond | 148:56bf8bad4567 | 35 | // Hush LED usage |
ansond | 148:56bf8bad4567 | 36 | //#define HUSH_LEDS true // false - enable LEDs, true - disable LEDs |
ansond | 148:56bf8bad4567 | 37 | |
ansond | 148:56bf8bad4567 | 38 | // Memory Debug Enable/Disable |
ansond | 148:56bf8bad4567 | 39 | //#define ENABLE_MEMORY_DEBUG true // false - disable, true - enable (for all error_handler->log() operations) |
ansond | 148:56bf8bad4567 | 40 | //#define MEMORY_LOGGING true // false - disable, true - enable (for error_handler->log_memory() operations only) |
ansond | 148:56bf8bad4567 | 41 | |
ansond | 148:56bf8bad4567 | 42 | // Enable/Disable NSP Get and GetPut operations |
ansond | 148:56bf8bad4567 | 43 | #define NSP_ENABLE_GET true // true - enable, false - disable |
ansond | 148:56bf8bad4567 | 44 | #define NSP_ENABLE_GETPUT true // true - enable, false - disable |
ansond | 148:56bf8bad4567 | 45 | |
ansond | 148:56bf8bad4567 | 46 | // our MAC address |
ansond | 148:56bf8bad4567 | 47 | //#define MAC_ADDRESS 0x00,0x1e,0xAB,0xE3,0x4F,0x55 |
ansond | 148:56bf8bad4567 | 48 | |
ansond | 148:56bf8bad4567 | 49 | // Our Endpoint Version Annoucement |
ansond | 148:56bf8bad4567 | 50 | #define ENDPOINT_VERSION_ANNOUNCE "\r\nMBED IMPACT(NSP) Endpoint v1.0" |
ansond | 148:56bf8bad4567 | 51 | |
ansond | 148:56bf8bad4567 | 52 | // Preference File Configuration |
ansond | 148:56bf8bad4567 | 53 | #define PREFERENCES_FILE "/local/nsp.cfg"// preferences file for endpoint |
ansond | 148:56bf8bad4567 | 54 | |
ansond | 148:56bf8bad4567 | 55 | // Light Configuration |
ansond | 148:56bf8bad4567 | 56 | #define LIGHT_NAME "light-nsp-%d" // name of each light in this endpoint |
ansond | 148:56bf8bad4567 | 57 | #define LIGHT_BLINK_WAIT_MS 1000 // time between blinks (ms) |
ansond | 148:56bf8bad4567 | 58 | #define LIGHT_NAME_INDEX 1 // start index for the ID of the light name |
ansond | 148:56bf8bad4567 | 59 | |
ansond | 148:56bf8bad4567 | 60 | // Philips Light Config |
ansond | 148:56bf8bad4567 | 61 | #define PL_ENABLE false // true - enable for endpoint light, false - disable |
ansond | 148:56bf8bad4567 | 62 | #define PL_LIGHT_ID PL_LIGHT_ID_BILL // Default light for Philips Light |
ansond | 148:56bf8bad4567 | 63 | |
ansond | 148:56bf8bad4567 | 64 | // External LED Light Configuration |
ansond | 148:56bf8bad4567 | 65 | #define EXT_LED_ENABLE true // true - enable external LED endpoint light, false - disable |
ansond | 148:56bf8bad4567 | 66 | #define EXT_LED_PIN p21 // pin to use for external LED cathode |
ansond | 148:56bf8bad4567 | 67 | |
ansond | 148:56bf8bad4567 | 68 | // NSP Configuration |
ansond | 148:56bf8bad4567 | 69 | #define NSP_NODE_TYPE "Light" // Node type |
ansond | 148:56bf8bad4567 | 70 | #define NSP_NODE_LIFETIME "3600" // Node lifetime (seconds) - 1 hour |
ansond | 148:56bf8bad4567 | 71 | #define RD_UPDATE_PERIOD 1700 // The number of seconds between NSP (re)registration messages - 28.3 minutes |
ansond | 148:56bf8bad4567 | 72 | |
ansond | 148:56bf8bad4567 | 73 | // NSP Registration Configuration |
ansond | 148:56bf8bad4567 | 74 | #define NSP_RESOURCES_OBSERVABLE 1 // 1 - all resources will be registered as observable, 0 - not observable |
ansond | 148:56bf8bad4567 | 75 | #define NSP_RESOURCES_REGISTERED 1 // 1 - all resources will be registered, 0 - not registered |
ansond | 148:56bf8bad4567 | 76 | |
ansond | 148:56bf8bad4567 | 77 | // Endpoint GPS Coordinates |
ansond | 148:56bf8bad4567 | 78 | #define ENDPOINT_LOCATION "Las Vegas Country Club"// Where this light/endpoint lives |
ansond | 148:56bf8bad4567 | 79 | #define ENDPOINT_GPS_COORDS "36.131258,-115.144414" // golf course 36.131258,-115.144414 |
ansond | 148:56bf8bad4567 | 80 | |
ansond | 148:56bf8bad4567 | 81 | // Transport Configuration |
ansond | 148:56bf8bad4567 | 82 | #define NUM_TRANSPORTS 2 // Transports used |
ansond | 148:56bf8bad4567 | 83 | #define NSP_TRANSPORT 0 // NSP Transport index |
ansond | 148:56bf8bad4567 | 84 | #define HTTP_TRANSPORT 1 // HTTP Transport index |
ansond | 148:56bf8bad4567 | 85 | |
ansond | 148:56bf8bad4567 | 86 | #endif // _DEFINITIONS_H |