
MBED MQTT Lighting Endpoint for NXP Ublox (cellular enabled)
Dependencies: C027_Support C12832 StatusReporter LM75B MQTT-ansond c027_radios endpoint_core endpoint_mqtt mbed-rtos mbed
Definitions.h@296:ac3d95e584d8, 2014-09-19 (annotated)
- Committer:
- ansond
- Date:
- Fri Sep 19 21:39:31 2014 +0000
- Revision:
- 296:ac3d95e584d8
- Parent:
- 290:28094a495bde
updated copcar lighting
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ansond | 172:e996f6ce25f7 | 1 | /* Copyright C2013 Doug Anson, MIT License |
ansond | 172:e996f6ce25f7 | 2 | * |
ansond | 172:e996f6ce25f7 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
ansond | 172:e996f6ce25f7 | 4 | * and associated documentation files the "Software", to deal in the Software without restriction, |
ansond | 172:e996f6ce25f7 | 5 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
ansond | 172:e996f6ce25f7 | 6 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
ansond | 172:e996f6ce25f7 | 7 | * furnished to do so, subject to the following conditions: |
ansond | 172:e996f6ce25f7 | 8 | * |
ansond | 172:e996f6ce25f7 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
ansond | 172:e996f6ce25f7 | 10 | * substantial portions of the Software. |
ansond | 172:e996f6ce25f7 | 11 | * |
ansond | 172:e996f6ce25f7 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
ansond | 172:e996f6ce25f7 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
ansond | 172:e996f6ce25f7 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
ansond | 172:e996f6ce25f7 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
ansond | 172:e996f6ce25f7 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
ansond | 172:e996f6ce25f7 | 17 | */ |
ansond | 172:e996f6ce25f7 | 18 | |
ansond | 172:e996f6ce25f7 | 19 | #ifndef _DEFINITIONS_H_ |
ansond | 172:e996f6ce25f7 | 20 | #define _DEFINITIONS_H_ |
ansond | 172:e996f6ce25f7 | 21 | |
ansond | 172:e996f6ce25f7 | 22 | // platform |
ansond | 172:e996f6ce25f7 | 23 | #include "mbed.h" |
ansond | 172:e996f6ce25f7 | 24 | |
ansond | 173:b8f479524c92 | 25 | // Platform Switch |
ansond | 202:eb38b2ac75af | 26 | #define _ENDPOINT_UBLOX_PLATFORM true // uncomment for the U-Blox MBED platform |
ansond | 202:eb38b2ac75af | 27 | //#define _ENDPOINT_FREESCALE_PLATFORM true // uncomment for the Freescale Freedom MBED platform |
ansond | 202:eb38b2ac75af | 28 | //#define _ENDPOINT_NXP_PLATFORM true // uncomment for the NXP MBED platform |
ansond | 173:b8f479524c92 | 29 | |
ansond | 198:fa509ef2cafe | 30 | // Network Usage (default is Ethernet) |
ansond | 202:eb38b2ac75af | 31 | #define CELLULAR_NETWORK true // true - use cellular network, false - use ethernet (cannot co-exist together) |
ansond | 244:4f0b161ef331 | 32 | //#define CELLULAR_DEBUG true // true - debug enabled, undef - no |
ansond | 198:fa509ef2cafe | 33 | |
ansond | 290:28094a495bde | 34 | // Multitech Temp Probe customization |
ansond | 290:28094a495bde | 35 | //#define MULTITECH_TEMP_PROBE true // true - on, undef - off |
ansond | 290:28094a495bde | 36 | |
ansond | 190:bdf70b7aa906 | 37 | // what kind of personality we are... |
ansond | 250:4d37059d860d | 38 | //#define LIGHT_PERSONALITY true // the endpoint will be a (set of) lights |
ansond | 250:4d37059d860d | 39 | #define COPCAR_PERSONALITY true // the endpoint will emulate a cop car |
ansond | 190:bdf70b7aa906 | 40 | |
ansond | 272:ea5a8ecbb0bf | 41 | // special behavior for APM CopCar - steady state on/off for blinking |
ansond | 290:28094a495bde | 42 | //#define APM_COPCAR_ENABLE true // true - enabled, (undef) - disabled |
ansond | 272:ea5a8ecbb0bf | 43 | |
ansond | 263:d513dc4dc2f2 | 44 | // APM Demo Light Configuration |
ansond | 281:c2f37dec536b | 45 | //#define APM_LIGHT_ENABLE false // true - enable APM Demo light, undef - disable |
ansond | 263:d513dc4dc2f2 | 46 | |
ansond | 263:d513dc4dc2f2 | 47 | // External LED Light Configuration |
ansond | 263:d513dc4dc2f2 | 48 | #define EXT_LED_ENABLE true // true - enable external LED endpoint light, false - disable |
ansond | 263:d513dc4dc2f2 | 49 | |
ansond | 172:e996f6ce25f7 | 50 | // include common definitions |
ansond | 172:e996f6ce25f7 | 51 | #include "CommonDefinitions.h" |
ansond | 172:e996f6ce25f7 | 52 | |
ansond | 246:f890cc8aed31 | 53 | // Turn all these on for cellular |
ansond | 247:a0e09c7934f5 | 54 | #define EH_USE_MUTEXES true // true - yes, undef - no |
ansond | 247:a0e09c7934f5 | 55 | #define NETWORK_MUTEX true // true - yes, undef - no |
ansond | 247:a0e09c7934f5 | 56 | #define ENABLE_THREADS true // true - yes, undef - no |
ansond | 246:f890cc8aed31 | 57 | |
ansond | 174:4da75aabdd67 | 58 | // MQTT specific support |
ansond | 174:4da75aabdd67 | 59 | #include "MQTTDefinitions.h" |
ansond | 172:e996f6ce25f7 | 60 | |
ansond | 222:d1889af2bb23 | 61 | // OVERRIDES |
ansond | 222:d1889af2bb23 | 62 | #undef GW_IPADDRESS |
ansond | 251:132923e46d10 | 63 | #undef GW_PORT |
ansond | 222:d1889af2bb23 | 64 | #undef IOC_HOST_NAME |
ansond | 222:d1889af2bb23 | 65 | #undef MQTT_HOSTNAME |
ansond | 268:f854782b8229 | 66 | //#define GW_IPADDRESS "192.168.1.220" // Gateway Broker IP |
ansond | 268:f854782b8229 | 67 | //#define GW_PORT "8888" // Gateway Broker port (def: 8888) |
ansond | 268:f854782b8229 | 68 | |
ansond | 268:f854782b8229 | 69 | #define GW_IPADDRESS "72.182.18.233" // Gateway Broker IP (external) |
ansond | 268:f854782b8229 | 70 | #define GW_PORT "26278" // Gateway Broker port (external) |
ansond | 257:a1d02c9bbfc9 | 71 | |
ansond | 247:a0e09c7934f5 | 72 | #define IOC_HOST_NAME "193.60.130.112" // IOC Web - iocweb.bcu.ac.uk |
ansond | 247:a0e09c7934f5 | 73 | #define MQTT_HOSTNAME "193.60.130.110" // IOC MQTT Broker Host - iocana.bcu.ac.uk |
ansond | 222:d1889af2bb23 | 74 | |
ansond | 172:e996f6ce25f7 | 75 | // Philips Light Config |
ansond | 202:eb38b2ac75af | 76 | #define PL_ENABLE false // true - enable for endpoint light, false - disable |
ansond | 202:eb38b2ac75af | 77 | #define PL_LIGHT_ID PL_LIGHT_ID_BILL // Default light for Philips Light |
ansond | 172:e996f6ce25f7 | 78 | |
ansond | 180:a50a4e8c9345 | 79 | // Reset our config values if needed |
ansond | 180:a50a4e8c9345 | 80 | #ifdef _ENDPOINT_UBLOX_PLATFORM |
ansond | 188:a853e563f876 | 81 | #define UBLOX_GPS_FREQ 100000 // GPS freq in ns |
ansond | 188:a853e563f876 | 82 | #define UBLOX_GPS_POLL_MS 5000 // poll the GPS every 5 seconds |
ansond | 180:a50a4e8c9345 | 83 | #endif |
ansond | 180:a50a4e8c9345 | 84 | |
ansond | 264:49b7b7e68c49 | 85 | // Endpoint GPS Coordinates/Location |
ansond | 264:49b7b7e68c49 | 86 | //#define ENDPOINT_LOCATION "Las Vegas Police Dept" // Copcar location |
ansond | 264:49b7b7e68c49 | 87 | //#define ENDPOINT_GPS_COORDS "-115.147683 36.131735" // Las Vegas |
ansond | 280:9fc68227401c | 88 | //#define ENDPOINT_LOCATION "ISSUU Dept - Bilbao Spain" // Copcar location |
ansond | 280:9fc68227401c | 89 | //#define ENDPOINT_GPS_COORDS "-2.924335 43.262977" // Bilbao Spain |
ansond | 283:6821d9e35fb8 | 90 | #define ENDPOINT_LOCATION "Santa Clara PD" // Where this light/endpoint lives |
ansond | 283:6821d9e35fb8 | 91 | #define ENDPOINT_GPS_COORDS "-121.973001 37.403841" // Santa Clara, CA |
ansond | 264:49b7b7e68c49 | 92 | |
ansond | 172:e996f6ce25f7 | 93 | // MBED doesnt have a good notion of time - so we code it here |
ansond | 283:6821d9e35fb8 | 94 | #define ENDPOINT_STARTTIME "\"STARTDATETIME\":\"2014-08-09T22:03:06-07:00\"," |
ansond | 283:6821d9e35fb8 | 95 | #define ENDPOINT_STOPTIME "\"ENDDATETIME\":\"2015-11-10T03:35:55-07:00\"," |
ansond | 283:6821d9e35fb8 | 96 | #define ENDPOINT_TIMEZONE "\"TIMEZONEOFFSET\":\"-08:00\"" |
ansond | 172:e996f6ce25f7 | 97 | |
ansond | 174:4da75aabdd67 | 98 | // DEBUG Memory Debug Enable/Disable |
ansond | 174:4da75aabdd67 | 99 | // #define ENABLE_MEMORY_DEBUG true // false - disable, true - enable |
ansond | 172:e996f6ce25f7 | 100 | |
ansond | 174:4da75aabdd67 | 101 | // DEBUG Hush Logging |
ansond | 174:4da75aabdd67 | 102 | //#define HUSH_LOG true // false - logging output, true - no logging |
ansond | 172:e996f6ce25f7 | 103 | |
ansond | 174:4da75aabdd67 | 104 | // DEBUG Hush LED usage |
ansond | 220:9b566a5c88ae | 105 | //#define HUSH_LEDS true // false - enable LEDs, true - disable LEDs |
ansond | 172:e996f6ce25f7 | 106 | |
ansond | 174:4da75aabdd67 | 107 | // KEIL: our MAC address |
ansond | 174:4da75aabdd67 | 108 | //#define MAC_ADDRESS 0xa0,0x12,0xAB,0xE3,0x4F,0x56 |
ansond | 172:e996f6ce25f7 | 109 | |
ansond | 172:e996f6ce25f7 | 110 | #endif // _DEFINITIONS_H |