Skip to content
Jack Lund edited this page Oct 16, 2013 · 5 revisions

Table of Contents

API

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.

connect

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
}

UUID

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.

Clone this wiki locally