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 Peripheral_1 mbed nRF51822
Fork of Peripheral_1_serial by
Revision 3:3f4aa38b0fb7, committed 2015-10-01
- Comitter:
- ssenwkdw
- Date:
- Thu Oct 01 17:33:32 2015 +0000
- Parent:
- 2:ad8f5f00e490
- Commit message:
- aa
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Oct 01 17:10:50 2015 +0000
+++ b/main.cpp Thu Oct 01 17:33:32 2015 +0000
@@ -288,8 +288,8 @@
ble.init();
ble.gap().setAdvertisingType(GapAdvertisingParams::ADV_SCANNABLE_UNDIRECTED);
ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
- ble.accumulateAdvertisingPayload(GapAdvertisingData::RABOT_REDBEAR_BLE_NANO, (uint8_t *)secure_code, sizeof(secure_code));
- ble.setAdvertisingType(GapAdvertisingParams::ADV_NON_CONNECTABLE_UNDIRECTED);
+ ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::RABOT_REDBEAR_BLE_NANO, (uint8_t *)secure_code, sizeof(secure_code));
+ ble.setAdvertisingType(GapAdvertisingParams::ADV_SCANNABLE_UNDIRECTED);
ble.gap().setAdvertisingInterval(32);
ble.gap().startAdvertising();
@@ -320,14 +320,14 @@
//advertising for real experiment
printf("communication for connection is started\r\n");
- ble.onConnection(connectionCallback);
- ble.onDisconnection(disconnectionCallback);
+ ble.gap().onConnection(connectionCallback);
+ ble.gap().onDisconnection(disconnectionCallback);
ble.gattClient().onDataRead(triggerToggledWrite);
ble.gattClient().onDataWrite(onDataWriteCallback);
ble.gattServer().onDataWritten(onDataWrittenCallback);
ble.gap().setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
- ble.accumulateAdvertisingPayload(GapAdvertisingData::RABOT_REDBEAR_BLE_NANO, (uint8_t *)secure_code, sizeof(secure_code));
+ ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::RABOT_REDBEAR_BLE_NANO, (uint8_t *)secure_code, sizeof(secure_code));
ble.gap().setAdvertisingInterval(29);
ble.addService(customService);