Skip to content

Commit

Permalink
jsdoc fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
seizu committed Oct 7, 2024
1 parent 062feb3 commit 435be4a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/GattServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,38 +54,38 @@ class GattServer {

throw new Error('Service not available')
}

/**
* Find the service UUID and characteristic UUID based on a characteristic handle
* @param {number} charHandle
* @returns {<Object|null>}
* @returns {Object|null}
*/
async getUUIDbyHandle(charHandle) {
const handle = charHandle - 1;
const handleStr = 'char' + handle.toString(16).padStart(4, '0');
async getUUIDbyHandle (charHandle) {
const handle = charHandle - 1
const handleStr = 'char' + handle.toString(16).padStart(4, '0')

for (const key in this.dbus._matchRules) {
if (key.includes(handleStr)) {
const match = key.match(/service[0-9a-fA-F]+/);
const match = key.match(/service[0-9a-fA-F]+/)
if (match) {
const service = match[0];
const services = this._services;
const service = match[0]
const services = this._services
for (const skey in services) {
if (services[skey].service === service) {
const characteristics = services[skey]._characteristics;
const characteristics = services[skey]._characteristics
for (const ckey in characteristics) {
if (characteristics[ckey].characteristic === handleStr) {
return { 'service': skey, 'char': ckey };
return { service: skey, char: ckey }
}
}
return null;
return null
}
}
}
}
}
return null;
}
return null
}
}

module.exports = GattServer

0 comments on commit 435be4a

Please sign in to comment.