![](/media/cache/group/arm_mbed.PNG.50x50_q85.png)
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
Diff: Definitions.h
- Revision:
- 0:ae2a45502448
- Child:
- 8:45f9a920e82c
diff -r 000000000000 -r ae2a45502448 Definitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Definitions.h Tue Feb 25 16:56:31 2014 +0000 @@ -0,0 +1,63 @@ +/* Copyright C2013 Doug Anson, MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software + * and associated documentation files the "Software", to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _DEFINITIONS_H_ +#define _DEFINITIONS_H_ + +// platform +#include "mbed.h" + +// Our Endpoint Version Annoucement +#define ENDPOINT_VERSION_ANNOUNCE "\r\nMBED IMPACT(MQTT) Endpoint v1.0" + +// Error Handler +#define MAX_LOG_MESSAGE 256 // maximum size of a logging message + +// Light Configuration +#define NUM_LIGHTS 1 // number of lights in this endpoint +#define LIGHT_NAME "mbed-mqtt-light-%d" // name of each light in this endpoint +#define LIGHT_NAME_LEN 64 // buffer size for the light name +#define LIGHT_ON_STATE "0" // initial state of each light in this endpoint +#define LIGHT_DIM_STATE "25" // initial dimming state of each light in this endpoint + +// Resource Configuration +#define RESOURCE_NAME_LEN 64 // Resource name max length +#define RESOURCE_VALUE_LEN 64 // Resource value max length + +// Transport Configuration +#define NUM_TRANSPORTS 2 // MQTT, HTTP +#define MQTT_TRANSPORT 0 // MQTT Transport index +#define HTTP_TRANSPORT 1 // HTTP Transport index + +// MQTT connect information +#define MQTT_HOSTNAME "iocana.bcu.ac.uk" // IOC MQTT Broker Host - iocana.bcu.ac.uk +#define MQTT_HOSTPORT 1883 // IOC MQTT Broker Port +#define MQTT_ENDPOINT_ID "mbed%d" // IOC MQTT Endpoint ID template +#define MQTT_MAXID_VALUE 99 // IOC MQTT Endpoint ID maximum integer value +#define MQTT_ENDPOINT_IDLEN 64 // IOC MQTT Endpoint ID length (max) +#define MQTT_IOC_TOPIC "ARM/sensinode/control/#" // IOC MQTT Topic +#define MQTT_USERNAME "" // IOC MQTT Username +#define MQTT_PASSWORD "" // IOC MQTT Password + +// Main Loop +#define MAIN_LOOP_SLEEP 100 // sleep time (ms) between main loop iterations + +// LED Blink Time +#define BLINK_TIME 100 // LED blink times + +#endif // _DEFINITIONS_H \ No newline at end of file