Provide BLE API to parse the iBeacon packet and print the message. Leverage the BLE scan_start, scan_stop API to get iBeacon.

Dependents:   BLE_iBeaconScan BLE_iBeaconScan

Use the following API to complete the iBeacon parser:

iBeaconInit() - Use BLE API to initialize the BLE stack

iBeaconStartScan() - Use BLE API to start BLE scan

iBeaconStopScan() - Use BLE API to stop BLE scan

AdvertisementReportCallback - Parse the iBeacon to uuid, major number, minor number, tx power field

iBeaconScan.cpp

Committer:
marcusC
Date:
2015-11-26
Revision:
0:2c8c5bd785f4

File content as of revision 0:2c8c5bd785f4:

#include "BLE.h"
#include "iBeaconScan.h"

BLE bleIBeacon;
extern void AdvertisementReportCallback(const Gap::AdvertisementCallbackParams_t *params);

void iBeaconInit(void)
{
    bleIBeacon.init();
}

void iBeaconStartScan(void)
{
    bleIBeacon.startScan(AdvertisementReportCallback); 
}

void iBeaconStopScan(void)
{
    bleIBeacon.stopScan();
}