![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
This is a basic program that provides the necessary BLE service to allow communications with the UPAS
Dependencies: BLE_API mbed nRF51822 CronoDot EEPROM NCP5623BMUTBG ADS1115 BME280 Calibration_one MCP40D17 SDFileSystem LSM303 SI1145 STC3100
Fork of BLE_Button by
Diff: main.cpp
- Revision:
- 16:e066ab7e8fb3
- Parent:
- 15:c9c93454dd56
- Child:
- 17:077712e4e5e3
--- a/main.cpp Tue Nov 03 01:41:53 2015 +0000 +++ b/main.cpp Tue Nov 03 20:33:27 2015 +0000 @@ -8,15 +8,14 @@ #include "NCP5623BMUTBG.h" -BLE ble; -//DigitalOut led1(LED1); //Use of leds is important for debugging DigitalOut blower(p29, 0); DigitalOut pbKill(p18, 1); DigitalOut GPS_EN(p4,0); EEPROM E2PROM(p22, p20); CronoDot RTC(p22, p20); NCP5623BMUTBG RGB_LED(p22, p20); - + +BLE ble; /*EEPROM ADDRESSING: 0:Status bit-Unused 1-15:Device Name @@ -36,8 +35,6 @@ 55-56: Menu Options 57+ Nothing*/ -Timeout stop; //This is the stop call back object -Timeout logg; //This is the logging call back object const static char DEVICE_NAME[] = "UPAS"; //Will hold the actual name of the whichever UPAS is being connected to static const uint16_t uuid16_list[] = {UPAS_Service::UPAS_SERVICE_UUID}; //Currently a custom 16-bit representation of 128-bit UUID @@ -62,7 +59,7 @@ void writeCharacteristicCallback(const GattWriteCallbackParams *params) { uint8_t *writeData = const_cast<uint8_t*>(params->data); - + RGB_LED.set_led(2,3,1); // check to see what characteristic was written, by handle if(params->handle == upasServicePtr->rtcCharacteristic.getValueHandle()) { @@ -125,6 +122,6 @@ //Loop keeps device in infinite loop waiting for events to occur while (1) { - ble.waitForEvent(); + //ble.waitForEvent(); } }