How to use the able.queue.ble_task function in able

To help you get started, we’ve selected a few able examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github b3b / able / able / dispatcher.py View on Github external
    @ble_task
    def write_descriptor(self, descriptor, value):
        """Set and write the value of a given descriptor to the associated
        remote device

        :param descriptor: BluetoothGattDescriptor Java object
        :param value: value to write
        """
        if not descriptor.setValue(force_convertible_to_java_array(value)):
            Logger.error("Error on set descriptor value")
            return
        if not self.gatt.writeDescriptor(descriptor):
            Logger.error("Error on descriptor write")
github b3b / able / able / dispatcher.py View on Github external
    @ble_task
    def write_characteristic(self, characteristic, value):
        """Write a given characteristic value to the associated remote device

        :param characteristic: BluetoothGattCharacteristic Java object
        :param value: value to write
        """
        self._ble.writeCharacteristic(characteristic,
                                      force_convertible_to_java_array(value))
github b3b / able / able / dispatcher.py View on Github external
    @ble_task
    def update_rssi(self):
        """Triggers an update for the RSSI from the associated remote device
        Event is dispatched at every RSSI update completed operation
        """
        self._ble.readRemoteRssi()
github b3b / able / able / dispatcher.py View on Github external
    @ble_task
    def read_characteristic(self, characteristic):
        """Read a given characteristic from the associated remote device

        :param characteristic: BluetoothGattCharacteristic Java object
        """
        self._ble.readCharacteristic(characteristic)