Skip to content

Commit

Permalink
Change hardcoded literal '2902' to use const GATT_CLIENT_CHARAC_CFG_U…
Browse files Browse the repository at this point in the history
…UID_S
  • Loading branch information
gareth-evans-sniper committed Jan 19, 2025
1 parent 26103b7 commit dfbe41d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/hci-socket/gatt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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;
}
Expand Down

0 comments on commit dfbe41d

Please sign in to comment.