-
Notifications
You must be signed in to change notification settings - Fork 6
Devices
This is an event emitter with the following events:
function(err, device) { }
Emitted on a connect if no callback is passed to the connect function.
function() { }
Emitted when the connection is closed, either by a call to the close method, or for some other reason.
function(err) { }
Emitted when there is a general error that doesn't have an associated callback.
- handle
Number - callback
Function
Adds a listener for a notification on a specific handle. The callback is called every time there is a notification on that handle
Close the connection to the device. The Device object is no longer usable. A close event is emitted when the close is completed.
- startHandle
Number - endHandle
Number - callback
Function
Find type (UUID) information about the given handle range, between startHandle and endHandle inclusive. The callback returns a list containing objects with property handle containing the handle, and type, containing the UUID type.
- type
String - callback
Function
Find a service with the given UUID. If the UUID is null, returns all services for the given device.
- startHandle
Number - endHandle
Number - type
String - value
Buffer - callback
Function
Find an attribute with a given UUID and value within the range of handles provided. To search all handles, specify startHandle as 0 and endHandle as 0xFFFF.
- startHandle
Number - endHandle
Number - groupType
String - callback
Function
Read the values of an attribute with the given group type (as determined by a higher-level specification, e.g., GATT) within the range of handles provided. To search all handles, specify startHandle as 0 and endHandle as 0xFFFF.
- startHandle
Number - endHandle
Number - type
String - callback
Function
Read the values of an attribute with a given UUID within the range of handles provided. To search all handles, specify startHandle as 0 and endHandle as 0xFFFF.
- handle
Number - callback
function
Read the value of an attribute with the given handle.
- handle
Number - data
Buffer - callback
Function
Write the given data to the attribute with the given handle