add HAP Procedure define
This commit is contained in:
1 parent
5f40578b27
commit
988ed2d37f
2 files changed
+108
-1
No files matched your search
@@ -47,11 +47,21 @@ HAPCharacteristic::HAPCharacteristic(BLEUuid bleuuid, uint8_t format, uint16_t u
|
||||
setPresentationFormatDescriptor(format, 0, unit, 1, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* GATT Descriptor includes: Instance ID
|
||||
* HAP Descriptor includes: HAP Properties, User String, Presentation Format,
|
||||
* Valid Range (GATT), Step Value, Valid Values, Valid Values Range
|
||||
* @return
|
||||
*/
|
||||
err_t HAPCharacteristic::begin(void)
|
||||
{
|
||||
uint8_t temp = _format_desc.format;
|
||||
_format_desc.format = 0; // invalid to prevent adding presentation format
|
||||
|
||||
VERIFY_STATUS( BLECharacteristic::begin() );
|
||||
_format_desc.format = temp;
|
||||
|
||||
VERIFY_STATUS( _addChrIdDescriptor() );
|
||||
VERIFY_STATUS( _addHapDescriptor() );
|
||||
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user