:py:mod:`expliot.core.protocols.radio.ble` ========================================== .. py:module:: expliot.core.protocols.radio.ble .. autoapi-nested-parse:: Support for BLE. Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: expliot.core.protocols.radio.ble.Ble expliot.core.protocols.radio.ble.BleScanner expliot.core.protocols.radio.ble.BlePeripheral expliot.core.protocols.radio.ble.BleNotifyDelegate Attributes ~~~~~~~~~~ .. autoapisummary:: expliot.core.protocols.radio.ble.DEFAULT_NOTIFY_TIMEOUT .. py:data:: DEFAULT_NOTIFY_TIMEOUT :annotation: = 10 .. py:class:: Ble A wrapper around simple BLE operations. .. py:attribute:: ADTYPE_NAME :annotation: = 9 .. py:method:: scan(iface=0, tout=10) :staticmethod: Scan for BLE devices. .. py:class:: BleScanner Bases: :py:obj:`bluepy.btle.Scanner` A wrapper around bluepy Scanner class. .. py:class:: BlePeripheral Bases: :py:obj:`bluepy.btle.Peripheral` A wrapper around bluepy Peripheral class. .. py:method:: enable_notify(delegate, handle, write_response=False) Enables notification for a specific characteristic on a Peripheral. It's a Wrapper on Peripheral class methods for setting Delegate and writing to the characteristic(handle + 1) the value "x01" to enable the notification as per the BLE spec. Args: delegate (DefaultDelegate): Overriden DefaultDelegate Object handle (int): The handle of the characteristic for notification write_response (bool): True, if sending write command and False if sending only write request (for which there is no response from the peripheral). Default is False. .. py:class:: BleNotifyDelegate(callback) Bases: :py:obj:`bluepy.btle.DefaultDelegate` Delegate class for reading notification data as required by Bluepy .. py:method:: count() Count of the no. of times handleNotification() is called. Args: None Returns: (int) Returns the count .. py:method:: handleNotification(cHandle, data) Callback method as defined by Bluepy. Args: cHandle(integer): handle for the characteristic - this can be used to distinguish between notifications from multiple sources on the same peripheral. data(bytes): The characteristic data received. Returns: Nothing