This commit is contained in:
bluetooth-mdw 2015-10-23 13:12:13 +01:00
commit 8924cab6da
2 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{
"name": "microbit-dal",
"version": "1.2.3",
"version": "1.2.4",
"license": "Apache2",
"description": "The runtime library for the BBC micro:bit, developed by Lancaster University",
"keywords": [

View File

@ -60,18 +60,18 @@ int main()
uBit.ble = new BLEDevice();
uBit.ble->init();
uBit.ble->onDisconnection(bleDisconnectionCallback);
// Ensure we're advertising.
uBit.ble->accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
uBit.ble->accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)MICROBIT_BLE_DEVICE_NAME, sizeof(MICROBIT_BLE_DEVICE_NAME));
uBit.ble->setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
uBit.ble->setAdvertisingInterval(Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(200));
uBit.ble->startAdvertising();
}
if (!uBit.ble_firmware_update_service)
uBit.ble_firmware_update_service = new MicroBitDFUService(*uBit.ble);
// Ensure we're advertising.
uBit.ble->accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
uBit.ble->accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)MICROBIT_BLE_DEVICE_NAME, strlen(MICROBIT_BLE_DEVICE_NAME)+1);
uBit.ble->setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
uBit.ble->setAdvertisingInterval(Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(1000));
uBit.ble->startAdvertising();
// enter BLUE ZONE mode.
uBit.ble_firmware_update_service->pair();
}