-
Notifications
You must be signed in to change notification settings - Fork 6
Overview
The API is designed to reflect, as much as possible, the structure of the Bluetooth LE concepts. Thus, you have a device, which contains services, which contain characteristics.
There is a global connect method, which you use to gain access to a device. You pass a Bluetooth destination address (which looks something like BC:6A:29:C3:52:A9, and which you can discover using an external tool such as hcitool), and it passes you the device object in the callback, like so:
device.connect('BC:6A:29:C3:52:A9', function(err, device) {
// Do something with the device
}
Bluetooth has a concept of a UUID (Universally Unique ID), which they use to specify a variety of things in the system. This has been encapsulated into an object here. The UUID object includes the long string representation of the UUID, the short string (e.g. 0x1801) if it exists, and a binary buffer representation which is used in the C++ layer.