Lightly modified version of the BLE stack, that doesn't bring up a DFUService by default... as we have our own.
Fork of BLE_API by
Diff: services/URIBeaconConfigService.h
- Revision:
- 210:0c14030d1bd0
- Parent:
- 209:c92872ad8935
- Child:
- 211:f181effe5de3
diff -r c92872ad8935 -r 0c14030d1bd0 services/URIBeaconConfigService.h --- a/services/URIBeaconConfigService.h Mon Dec 01 14:31:18 2014 +0000 +++ b/services/URIBeaconConfigService.h Mon Dec 01 14:31:18 2014 +0000 @@ -89,7 +89,7 @@ } strcpy(reinterpret_cast<char *>(uriData), uriDataIn); - configure(); + configureGAP(); if (initSucceeded) { saveDefaults(); } @@ -129,7 +129,7 @@ */ void setFlags(uint8_t flagsIn) { flags = flagsIn; - configure(); + configureGAP(); } /** @@ -144,7 +144,7 @@ */ void useTxPowerMode(TXPowerModes_t mode) { effectiveTxPower = powerLevels[mode]; - configure(); + configureGAP(); } /** @@ -154,14 +154,14 @@ */ void setBeaconPeriod(uint16_t beaconPeriodIn) { beaconPeriod = beaconPeriodIn; - configure(); + configureGAP(); } private: /** * Setup the advertisement payload and GAP settings. */ - void configure(void) { + void configureGAP(void) { const uint8_t BEACON_UUID[] = {0xD8, 0xFE}; payloadIndex = 0; @@ -302,7 +302,7 @@ } else if (params->charHandle == resetChar.getValueAttribute().getHandle()) { resetDefaults(); } - configure(); + configureGAP(); ble.setAdvertisingPayload(); } @@ -324,8 +324,6 @@ ble.updateCharacteristicValue(uriDataChar.getValueAttribute().getHandle(), uriData, uriDataLength); ble.updateCharacteristicValue(flagsChar.getValueAttribute().getHandle(), &flags, 1 /* size */); ble.updateCharacteristicValue(beaconPeriodChar.getValueAttribute().getHandle(), reinterpret_cast<uint8_t *>(&beaconPeriod), sizeof(uint16_t)); - - configure(); } private: