correct HAP chr properties
This commit is contained in:
1 parent
63eaf009b4
commit
e311486be0
3 files changed
+7
-19
No files matched your search
@@ -61,12 +61,8 @@ void HAPCharacteristic::setHapProperties(uint16_t prop)
|
||||
{
|
||||
_hap_props = prop;
|
||||
|
||||
uint8_t chrprop = 0;
|
||||
|
||||
if ((prop & HAP_CHR_PROPS_READ ) || (prop & HAP_CHR_PROPS_SECURE_READ )) chrprop |= CHR_PROPS_READ;
|
||||
if ((prop & HAP_CHR_PROPS_WRITE ) || (prop & HAP_CHR_PROPS_SECURE_WRITE )) chrprop |= CHR_PROPS_WRITE;
|
||||
uint8_t chrprop = CHR_PROPS_READ | CHR_PROPS_WRITE;
|
||||
if ((prop & HAP_CHR_PROPS_NOTIFY) || (prop & HAP_CHR_PROPS_NOTIFY_DISCONNECTED)) chrprop |= CHR_PROPS_INDICATE;
|
||||
|
||||
setProperties(chrprop);
|
||||
}
|
||||
|
||||
@@ -113,13 +109,6 @@ err_t HAPCharacteristic::_addChrIdDescriptor(void)
|
||||
return addDescriptor(_g_uuid_cid, &_cid, sizeof(_cid), SECMODE_OPEN, SECMODE_NO_ACCESS);
|
||||
}
|
||||
|
||||
err_t HAPCharacteristic::_addHapDescriptor(void)
|
||||
{
|
||||
// HAPCharacteristic
|
||||
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
void HAPCharacteristic::_eventHandler(ble_evt_t* event)
|
||||
{
|
||||
switch(event->header.evt_id)
|
||||
@@ -267,11 +256,11 @@ void HAPCharacteristic::_eventHandler(ble_evt_t* event)
|
||||
|
||||
VERIFY_STATUS( sd_ble_gatts_rw_authorize_reply(Bluefruit.connHandle(), &reply), );
|
||||
|
||||
// if ( _hap_resp )
|
||||
// {
|
||||
// rtos_free(_hap_resp);
|
||||
// _hap_resp = NULL;
|
||||
// }
|
||||
if ( _hap_resp )
|
||||
{
|
||||
rtos_free(_hap_resp);
|
||||
_hap_resp = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -72,7 +72,6 @@ class HAPCharacteristic : public BLECharacteristic
|
||||
HAPResponse_t* _hap_resp;
|
||||
|
||||
err_t _addChrIdDescriptor(void);
|
||||
err_t _addHapDescriptor (void);
|
||||
};
|
||||
|
||||
#endif /* HAPCHARACTERISTIC_H_ */
|
||||
@@ -80,7 +80,7 @@ err_t HAPAccessoryInfo::begin(void)
|
||||
VERIFY_STATUS( _model.begin() );
|
||||
|
||||
// Name
|
||||
_mfr.setHapProperties(HAP_CHR_PROPS_READ);
|
||||
_name.setHapProperties(HAP_CHR_PROPS_READ);
|
||||
_name.setPermission(/*SECMODE_ENC_NO_MITM*/SECMODE_OPEN, SECMODE_NO_ACCESS);
|
||||
VERIFY_STATUS( _name.begin() );
|
||||
|
||||
|
||||
Reference in new issue
Block a user