Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API mbed nRF51822
Fork of BLE_EvothingsExample_GATT by
main.cpp
- Committer:
- mbedAustin
- Date:
- 2015-02-14
- Revision:
- 1:94152e7d8b5c
- Parent:
- 0:cd5b6733aeb1
- Child:
- 2:e84c13abc479
File content as of revision 1:94152e7d8b5c:
#include "mbed.h"
#include "BLEDevice.h"
#include "CustomService.h"
// BLE object
BLEDevice ble;
// LED object
DigitalOut led(LED1);
const static char DEVICE_NAME[] = "MyDeviceName"; // change this
static const uint16_t uuid16_list[] = {0xFF}; //Custom UUID, FF is reserved for development
// Restart advertising when phone app disconnects
void disconnectionCallback(Gap::Handle_t handle, Gap::DisconnectionReason_t reason)
{
ble.startAdvertising(); // restart advertising
}
int
main(void)
{
led = 0; // turn LED off
ble.init(); // initialize BLE
// TODO: impliment the rest of triggering for LED based on Write of characteristic.
// TODO: impliment a read characteristic that sends text back to app
// take a look at http://developer.mbed.org/teams/Bluetooth-Low-Energy/code/BLE_GroveColourSensor/file/000c8f8c7f03/main.cpp for inspiration.
}
