Added support for obtaining BLE device name by parsing advertising data.
Fork of BLE_BlueNRG by
Diff: btle/src/btle.cpp
- Revision:
- 4:fa5b5693c1b5
- Parent:
- 3:9c4c13795643
- Child:
- 6:08cfc94b5f49
diff -r 9c4c13795643 -r fa5b5693c1b5 btle/src/btle.cpp --- a/btle/src/btle.cpp Mon Jul 21 14:10:22 2014 +0000 +++ b/btle/src/btle.cpp Tue Jul 22 09:20:20 2014 +0000 @@ -16,6 +16,10 @@ #include "btle.h" +#include "hw/Gap.h" +#include "hw/GapEvents.h" +#include "BlueNRGGap.h" +#include "BlueNRGGattServer.h" #ifdef __cplusplus extern "C" { @@ -162,7 +166,7 @@ case EVT_DISCONN_COMPLETE: { - //GAP_DisconnectionComplete_CB(); + BlueNRGGap::getInstance().handleEvent(GapEvents::GAP_EVENT_DISCONNECTED); } break; @@ -172,9 +176,12 @@ switch(evt->subevent){ case EVT_LE_CONN_COMPLETE: - { - //evt_le_connection_complete *cc = (void *)evt->data; - //GAP_ConnectionComplete_CB(cc->peer_bdaddr, cc->handle); + { + evt_le_connection_complete *cc = (evt_le_connection_complete *)evt->data; + + BlueNRGGap::getInstance().setConnectionHandle(cc->handle); + BlueNRGGap::getInstance().handleEvent(GapEvents::GAP_EVENT_CONNECTED); + } break; }