mirror of
https://github.com/chirimen-oh/node-web-i2c.git
synced 2025-01-18 16:08:06 +00:00
set this.name property
This commit is contained in:
parent
b13125daec
commit
7f66c4ba38
1 changed files with 6 additions and 1 deletions
7
index.ts
7
index.ts
|
@ -76,7 +76,12 @@ export interface I2CSlaveDevice {
|
|||
write16(registerNumber: number, value: number): Promise<number>;
|
||||
}
|
||||
|
||||
export class OperationError extends Error {}
|
||||
export class OperationError extends Error {
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
this.name = this.constructor.name;
|
||||
}
|
||||
}
|
||||
|
||||
export async function requestI2CAccess(): Promise<I2CAccess> {
|
||||
const ports = new I2CPortMap(
|
||||
|
|
Loading…
Add table
Reference in a new issue