mirror of
https://github.com/chirimen-oh/node-web-gpio.git
synced 2025-01-18 16:08:00 +00:00
set this.name property
This commit is contained in:
parent
1eca0efb67
commit
832143b725
1 changed files with 14 additions and 2 deletions
16
index.ts
16
index.ts
|
@ -225,9 +225,21 @@ export class GPIOPort extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class InvalidAccessError extends Error {}
|
export class InvalidAccessError extends Error {
|
||||||
|
constructor(message: string) {
|
||||||
|
super(message);
|
||||||
|
|
||||||
export class OperationError extends Error {}
|
this.name = this.constructor.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class OperationError extends Error {
|
||||||
|
constructor(message: string) {
|
||||||
|
super(message);
|
||||||
|
|
||||||
|
this.name = this.constructor.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export async function requestGPIOAccess(): Promise<GPIOAccess> {
|
export async function requestGPIOAccess(): Promise<GPIOAccess> {
|
||||||
const ports = new GPIOPortMap(
|
const ports = new GPIOPortMap(
|
||||||
|
|
Loading…
Add table
Reference in a new issue