(self, args)
Handles the event for characteritic discovery.

        Adds the characteristic to the dictionary of characteristics or adds
        the descriptor to the dictionary of descriptors in the current
        characteristic. These events will be occur in an order similar to the
        following:
        1) primary service uuid
        2) 0 or more descriptors
        3) characteristic uuid
        4) 0 or more descriptors
        5) repeat steps 3-4

        args -- dictionary containing the characteristic handle ('chrhandle'),
        and characteristic UUID ('uuid')
Handles the event for characteritic discovery.
Handles the event for characteritic discovery .
def _ble_evt_attclient_find_information_found(self, args):
        """
        Handles the event for characteritic discovery.

        Adds the characteristic to the dictionary of characteristics or adds
        the descriptor to the dictionary of descriptors in the current
        characteristic. These events will be occur in an order similar to the
        following:
        1) primary service uuid
        2) 0 or more descriptors
        3) characteristic uuid
        4) 0 or more descriptors
        5) repeat steps 3-4

        args -- dictionary containing the characteristic handle ('chrhandle'),
        and characteristic UUID ('uuid')
        """
        raw_uuid = bytearray(reversed(args['uuid']))

        # Convert 4-byte UUID shorthand to a full, 16-byte UUID
        uuid_type = self._get_uuid_type(raw_uuid)
        if uuid_type != UUIDType.custom:
            uuid = uuid16_to_uuid(int(
                bgapi_address_to_hex(args['uuid']).replace(':', ''), 16))
        else:
            uuid = UUID(bytes=bytes(raw_uuid))

        # TODO is there a way to get the characteristic from the packet instead
        # of having to track the "current" characteristic?
        if (uuid_type == UUIDType.descriptor and
                self._current_characteristic is not None):
            self._current_characteristic.add_descriptor(uuid, args['chrhandle'])
        elif (uuid_type == UUIDType.custom or
                uuid_type == UUIDType.nonstandard or
                uuid_type == UUIDType.characteristic):
            if uuid_type == UUIDType.custom:
                log.info("Found custom characteristic %s" % uuid)
            elif uuid_type == UUIDType.characteristic:
                log.info("Found approved characteristic %s" % uuid)
            elif uuid_type == UUIDType.nonstandard:
                log.info("Found nonstandard 4-byte characteristic %s" % uuid)
            new_char = Characteristic(uuid, args['chrhandle'])
            self._current_characteristic = new_char
            self._characteristics[
                args['connection_handle']][uuid] = new_char
def _ble_evt_attclient_find_information_found ( self , args ) : raw_uuid = bytearray ( reversed ( args [ 'uuid' ] ) ) # Convert 4-byte UUID shorthand to a full, 16-byte UUID uuid_type = self . _get_uuid_type ( raw_uuid ) if uuid_type != UUIDType . custom : uuid = uuid16_to_uuid ( int ( bgapi_address_to_hex ( args [ 'uuid' ] ) . replace ( ':' , '' ) , 16 ) ) else : uuid = UUID ( bytes = bytes ( raw_uuid ) ) # TODO is there a way to get the characteristic from the packet instead # of having to track the "current" characteristic? if ( uuid_type == UUIDType . descriptor and self . _current_characteristic is not None ) : self . _current_characteristic . add_descriptor ( uuid , args [ 'chrhandle' ] ) elif ( uuid_type == UUIDType . custom or uuid_type == UUIDType . nonstandard or uuid_type == UUIDType . characteristic ) : if uuid_type == UUIDType . custom : log . info ( "Found custom characteristic %s" % uuid ) elif uuid_type == UUIDType . characteristic : log . info ( "Found approved characteristic %s" % uuid ) elif uuid_type == UUIDType . nonstandard : log . info ( "Found nonstandard 4-byte characteristic %s" % uuid ) new_char = Characteristic ( uuid , args [ 'chrhandle' ] ) self . _current_characteristic = new_char self . _characteristics [ args [ 'connection_handle' ] ] [ uuid ] = new_char