Skip to content

Commit

Permalink
Fix all linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 authored and rzr committed Jan 6, 2023
1 parent 98de7f0 commit 084ef2b
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 103 deletions.
2 changes: 1 addition & 1 deletion examples/enter-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ noble.on('discover', function (peripheral) {

if (entered) {
inRange[id] = {
peripheral: peripheral
peripheral
};

console.log(
Expand Down
66 changes: 33 additions & 33 deletions lib/distributed/bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ NobleBindings.prototype._onMessage = function (ws, event) {
// TODO: handle duplicate peripheralUuid's
this._peripherals[peripheralUuid] = {
uuid: peripheralUuid,
address: address,
advertisement: advertisement,
rssi: rssi,
ws: ws
address,
advertisement,
rssi,
ws
};

this.emit('discover', peripheralUuid, address, addressType, connectable, advertisement, rssi);
Expand Down Expand Up @@ -139,8 +139,8 @@ NobleBindings.prototype._sendCommand = function (ws, command) {
NobleBindings.prototype.startScanning = function (serviceUuids, allowDuplicates) {
this._startScanCommand = {
action: 'startScanning',
serviceUuids: serviceUuids,
allowDuplicates: allowDuplicates
serviceUuids,
allowDuplicates
};

this._sendCommand(null, this._startScanCommand);
Expand Down Expand Up @@ -191,7 +191,7 @@ NobleBindings.prototype.discoverServices = function (deviceUuid, uuids) {
this._sendCommand(peripheral.ws, {
action: 'discoverServices',
peripheralUuid: peripheral.uuid,
uuids: uuids
uuids
});
};

Expand All @@ -201,8 +201,8 @@ NobleBindings.prototype.discoverIncludedServices = function (deviceUuid, service
this._sendCommand(peripheral.ws, {
action: 'discoverIncludedServices',
peripheralUuid: peripheral.uuid,
serviceUuid: serviceUuid,
serviceUuids: serviceUuids
serviceUuid,
serviceUuids
});
};

Expand All @@ -212,8 +212,8 @@ NobleBindings.prototype.discoverCharacteristics = function (deviceUuid, serviceU
this._sendCommand(peripheral.ws, {
action: 'discoverCharacteristics',
peripheralUuid: peripheral.uuid,
serviceUuid: serviceUuid,
characteristicUuids: characteristicUuids
serviceUuid,
characteristicUuids
});
};

Expand All @@ -223,8 +223,8 @@ NobleBindings.prototype.read = function (deviceUuid, serviceUuid, characteristic
this._sendCommand(peripheral.ws, {
action: 'read',
peripheralUuid: peripheral.uuid,
serviceUuid: serviceUuid,
characteristicUuid: characteristicUuid
serviceUuid,
characteristicUuid
});
};

Expand All @@ -234,10 +234,10 @@ NobleBindings.prototype.write = function (deviceUuid, serviceUuid, characteristi
this._sendCommand(peripheral.ws, {
action: 'write',
peripheralUuid: peripheral.uuid,
serviceUuid: serviceUuid,
characteristicUuid: characteristicUuid,
serviceUuid,
characteristicUuid,
data: data.toString('hex'),
withoutResponse: withoutResponse
withoutResponse
});
};

Expand All @@ -247,9 +247,9 @@ NobleBindings.prototype.broadcast = function (deviceUuid, serviceUuid, character
this._sendCommand(peripheral.ws, {
action: 'broadcast',
peripheralUuid: peripheral.uuid,
serviceUuid: serviceUuid,
characteristicUuid: characteristicUuid,
broadcast: broadcast
serviceUuid,
characteristicUuid,
broadcast
});
};

Expand All @@ -259,9 +259,9 @@ NobleBindings.prototype.notify = function (deviceUuid, serviceUuid, characterist
this._sendCommand(peripheral.ws, {
action: 'notify',
peripheralUuid: peripheral.uuid,
serviceUuid: serviceUuid,
characteristicUuid: characteristicUuid,
notify: notify
serviceUuid,
characteristicUuid,
notify
});
};

Expand All @@ -271,8 +271,8 @@ NobleBindings.prototype.discoverDescriptors = function (deviceUuid, serviceUuid,
this._sendCommand(peripheral.ws, {
action: 'discoverDescriptors',
peripheralUuid: peripheral.uuid,
serviceUuid: serviceUuid,
characteristicUuid: characteristicUuid
serviceUuid,
characteristicUuid
});
};

Expand All @@ -282,9 +282,9 @@ NobleBindings.prototype.readValue = function (deviceUuid, serviceUuid, character
this._sendCommand(peripheral.ws, {
action: 'readValue',
peripheralUuid: peripheral.uuid,
serviceUuid: serviceUuid,
characteristicUuid: characteristicUuid,
descriptorUuid: descriptorUuid
serviceUuid,
characteristicUuid,
descriptorUuid
});
};

Expand All @@ -294,9 +294,9 @@ NobleBindings.prototype.writeValue = function (deviceUuid, serviceUuid, characte
this._sendCommand(peripheral.ws, {
action: 'writeValue',
peripheralUuid: peripheral.uuid,
serviceUuid: serviceUuid,
characteristicUuid: characteristicUuid,
descriptorUuid: descriptorUuid,
serviceUuid,
characteristicUuid,
descriptorUuid,
data: data.toString('hex')
});
};
Expand All @@ -307,7 +307,7 @@ NobleBindings.prototype.readHandle = function (deviceUuid, handle) {
this._sendCommand(peripheral.ws, {
action: 'readHandle',
peripheralUuid: peripheral.uuid,
handle: handle
handle
});
};

Expand All @@ -317,9 +317,9 @@ NobleBindings.prototype.writeHandle = function (deviceUuid, handle, data, withou
this._sendCommand(peripheral.ws, {
action: 'readHandle',
peripheralUuid: peripheral.uuid,
handle: handle,
handle,
data: data.toString('hex'),
withoutResponse: withoutResponse
withoutResponse
});
};

Expand Down
8 changes: 4 additions & 4 deletions lib/hci-socket/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ function swap (input) {
}

module.exports = {
r: r,
c1: c1,
s1: s1,
e: e
r,
c1,
s1,
e
};
24 changes: 12 additions & 12 deletions lib/hci-socket/gap.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ Gap.prototype.onHciLeAdvertisingReport = function (
const scannable = type === LE_META_EVENT_TYPE_SCANNABLE;

this._discoveries[address] = {
address: address,
addressType: addressType,
connectable: connectable,
advertisement: advertisement,
rssi: rssi,
address,
addressType,
connectable,
advertisement,
rssi,
count: discoveryCount,
hasScanResponse: hasScanResponse
hasScanResponse
};

// only report after a scan response event or if non-connectable or more than one discovery without a scan response, so more data can be collected
Expand Down Expand Up @@ -225,13 +225,13 @@ Gap.prototype.onHciLeExtendedAdvertisingReport = function (
const incomplete = type & LE_META_EXTENDED_EVENT_TYPE_INCOMPLETE_MASK ? 1 : 0;

this._discoveries[address] = {
address: address,
addressType: addressType,
connectable: connectable,
advertisement: advertisement,
rssi: rssi,
address,
addressType,
connectable,
advertisement,
rssi,
count: discoveryCount,
hasScanResponse: hasScanResponse
hasScanResponse
};

// only report after a scan response event or if non-connectable or more than one discovery without a scan response, so more data can be collected
Expand Down
6 changes: 3 additions & 3 deletions lib/hci-socket/gatt.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ Gatt.prototype.errorResponse = function (opcode, handle, status) {

Gatt.prototype._queueCommand = function (buffer, callback, writeCallback) {
this._commandQueue.push({
buffer: buffer,
callback: callback,
writeCallback: writeCallback
buffer,
callback,
writeCallback
});

if (this._currentCommand === null) {
Expand Down
4 changes: 2 additions & 2 deletions lib/hci-socket/hci.js
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,8 @@ Hci.prototype.onSocketData = function (data) {
this.emit('aclDataPkt', handle, cid, pktData);
} else {
this._handleBuffers[handle] = {
length: length,
cid: cid,
length,
cid,
data: pktData
};
}
Expand Down
4 changes: 2 additions & 2 deletions lib/webbluetooth/bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ NobleBindings.prototype.startScanning = function (options, allowDuplicates) {

self._peripherals[address] = {
uuid: address,
address: address,
address,
advertisement: { localName: device.name }, // advertisement,
device: device,
device,
cachedServices: {},
localName: device.name,
serviceUuids: options.services
Expand Down

0 comments on commit 084ef2b

Please sign in to comment.