Constructor
new DeviceHandle(options)
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
Extends
Members
(static) constants
DeviceHandle constants
Methods
(async, static) gpio(gpio, value)
Sets a GPIO output pin
Parameters:
Name | Type | Description |
---|---|---|
gpio |
number | The gpio number |
value |
Buffer | Either true or false |
(async) close()
Closes the device
(async) gpio()
Alias for DeviceHandle.gpio
(async) ioctl(direction, type, cmd, data)
Performs an ioctl on the device
Parameters:
Name | Type | Description |
---|---|---|
direction |
number | Either constants.IOCTL_NONE, IOCTL_READ, IOCTL_WRITE, IOCTL_RW |
type |
number | The ioctl type |
cmd |
number | The ioctl command |
data |
Buffer | The ioctl data, the data may be changed by the ioctl |
(async) ioctlRaw(cmd, data)
Performs a raw ioctl on the device
Parameters:
Name | Type | Description |
---|---|---|
cmd |
number | The ioctl command |
data |
Buffer | The ioctl data, the data may be changed by the ioctl |
isOpen() → {boolean}
Checks if the device is open
Returns:
True when the device is open, false otherwise
- Type
- boolean
(async) open() → {number}
Opens the device
Returns:
Device fd
- Type
- number