BLE
ble is a global table which provides functions to interact with the ble simulator.
Functions
ble.createDevice (device_name)
Used to create a Device object.
Params
- device_name
stringThe name of the device. This should be unique.
Returns: a new Device object
ble.createService (service_uuid)
Used to create a Service object.
Params
- service_uuid
stringThe uuid of the Service
Returns: a new Service object
ble.createCharacteristic (characterisitc_uuid)
Used to create a Characteristic object.
Params
- characterisitc_uuid
stringThe uuid of the Characteristic
Returns: a new Characteristic object
ble.createDescriptor (descriptor_uuid)
Used to create a Descriptor object.
Params
- descriptor_uuid
stringThe uuid of the Descriptor
Returns: a new Descriptor object
ble.registerDevice (device)
Creates a new virtual controller for the device. Registers the device with bluez and adds it to the internal list of active devices.
Params
- device
Devicethe device to register
Returns: bool indicating the success of the operation