if def for entire PF service

This commit is contained in:
Sam Kent 2018-09-07 13:33:16 +01:00
parent 26d7b6d420
commit e08535a647
2 changed files with 3 additions and 10 deletions

View file

@ -383,6 +383,9 @@ void MicroBitBLEManager::init(ManagedString deviceName, ManagedString serialNumb
// Bring up core BLE services.
#if CONFIG_ENABLED(MICROBIT_BLE_DFU_SERVICE)
new MicroBitDFUService(*ble);
#endif
#if CONFIG_ENABLED(MICROBIT_BLE_PARTIAL_FLASHING)
new MicroBitPartialFlashingService(*ble, messageBus);
#endif

View file

@ -113,7 +113,6 @@ void MicroBitPartialFlashingService::onDataWritten(const GattWriteCallbackParams
break;
}
#if CONFIG_ENABLED(MICROBIT_BLE_PARTIAL_FLASHING)
case FLASH_DATA:
{
// Process FLASH data packet
@ -130,7 +129,6 @@ void MicroBitPartialFlashingService::onDataWritten(const GattWriteCallbackParams
MicroBitEvent evt(MICROBIT_ID_PARTIAL_FLASHING, END_OF_TRANSMISSION);
break;
}
#endif
case MICROBIT_STATUS:
{
/*
@ -159,14 +157,6 @@ void MicroBitPartialFlashingService::onDataWritten(const GattWriteCallbackParams
}
break;
}
default:
{
/* Return command unknown
*/
uint8_t unknownCommandBuffer[] = {data[0], 0xAB, 0xCD, 0xEF};
ble.gattServer().notify(partialFlashCharacteristicHandle, (const uint8_t *)unknownCommandBuffer, sizeof(unknownCommandBuffer));
break;
}
}
}
}