set command type to notify
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
BLEOTAClass::BLEOTAClass()
|
||||
: pVersionNumber_(new BLECharacteristic(VERSION_NUMBER_UUID, BLECharacteristic::PROPERTY_READ)),
|
||||
pVersionNumberDescriptor_(new BLEDescriptor(VERSION_NUMBER_DESCRIPTOR_UUID)),
|
||||
pOTACommand_(new BLECharacteristic(OTA_COMMAND_UUID, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE)),
|
||||
pOTACommand_(new BLECharacteristic(OTA_COMMAND_UUID, BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_WRITE)),
|
||||
pOTACommandDescriptor_(new BLEDescriptor(OTA_COMMAND_DESCRIPTOR_UUID)),
|
||||
pOTAFile_(new BLECharacteristic(OTA_FILE_UUID, BLECharacteristic::PROPERTY_WRITE)),
|
||||
pOTAFileDescriptor_(new BLEDescriptor(OTA_FILE_DESCRIPTOR_UUID)) {
|
||||
@@ -45,6 +45,7 @@ void BLEOTAClass::setOTAcommand(otaCommand cmd) {
|
||||
uint8_t commandBuffer[1] = {};
|
||||
commandBuffer[0] = cmd;
|
||||
pOTACommand_->setValue(commandBuffer, 1);
|
||||
pOTACommand_->notify();
|
||||
currentCommand_ = cmd;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user