diff --git a/lib/hci-socket/gatt.js b/lib/hci-socket/gatt.js index ac42384..51d5c69 100644 --- a/lib/hci-socket/gatt.js +++ b/lib/hci-socket/gatt.js @@ -39,6 +39,7 @@ const GATT_INCLUDE_UUID = 0x2802; const GATT_CHARAC_UUID = 0x2803; const GATT_CLIENT_CHARAC_CFG_UUID = 0x2902; +const GATT_CLIENT_CHARAC_CFG_UUID_S = '2902' const GATT_SERVER_CHARAC_CFG_UUID = 0x2903; const ATT_ECODE_SUCCESS = 0x00; @@ -208,7 +209,7 @@ class Gatt extends EventEmitter { this._handles[clientCharacteristicConfigurationDescriptorHandle] = { type: 'descriptor', handle: clientCharacteristicConfigurationDescriptorHandle, - uuid: '2902', + uuid: GATT_CLIENT_CHARAC_CFG_UUID_S, attribute: characteristic, properties: (0x02 | 0x04 | 0x08), // read/write secure: (secure & 0x10) ? (0x02 | 0x04 | 0x08) : 0, @@ -223,7 +224,7 @@ class Gatt extends EventEmitter { //above, if the characteristic defines notify, the 2902 characteristic descriptor is added automatically //if the peripheral also declares this, we don't want to add it again //flags (properties, secure etc) above are better defined - if(descriptor.uuid == '2902') + if(descriptor.uuid == GATT_CLIENT_CHARAC_CFG_UUID_S) { continue; }