jacdac-ts
Advanced tools
Comparing version 1.0.16 to 1.0.17
@@ -11,3 +11,2 @@ import { Device } from "./device"; | ||
constructor(device: Device, service_number: number); | ||
static fromFirstServiceClass(device: Device, service_class: number): SensorClient; | ||
setStreamingAsync(on: boolean): Promise<void>; | ||
@@ -17,1 +16,2 @@ calibrateAsync(): Promise<void>; | ||
} | ||
export declare function sensorsFromDevice(device: Device, service_class: number): SensorClient[]; |
{ | ||
"name": "jacdac-ts", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -13,2 +13,3 @@ import { Device } from "./device"; | ||
const pkt = Packet.packed(CMD_SET_REG | reg, "i", [value]); | ||
pkt.dev = this.device; | ||
pkt.service_number = this.service_number; | ||
@@ -20,2 +21,3 @@ return pkt.sendCmdAsync(this.device); | ||
const pkt = Packet.onlyHeader(cmd); | ||
pkt.dev = this.device; | ||
pkt.service_number = this.service_number; | ||
@@ -33,11 +35,2 @@ return pkt.sendCmdAsync(this.device); | ||
static fromFirstServiceClass(device: Device, service_class: number): SensorClient { | ||
const n = device.serviceLength; | ||
for (let i = 0; i < n; ++i) { | ||
if (device.serviceClassAt(i) == service_class) | ||
return new SensorClient(device, i); | ||
} | ||
return undefined; | ||
} | ||
public setStreamingAsync(on: boolean) { | ||
@@ -54,2 +47,12 @@ return this.setRegIntAsync(REG_IS_STREAMING, on ? 1 : 0) | ||
} | ||
} | ||
export function sensorsFromDevice(device: Device, service_class: number): SensorClient[] { | ||
let sensors = []; | ||
const n = device.serviceLength; | ||
for (let i = 0; i < n; ++i) { | ||
if (device.serviceClassAt(i) == service_class) | ||
sensors.push(new SensorClient(device, i)); | ||
} | ||
return sensors; | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
504933
6753