(self, args)
Handles the event for reporting the contents of an advertising or scan
        response packet.
        This event will occur during device discovery but not direct connection.

        args -- dictionary containing the RSSI value ('rssi'), packet type
                ('packet_type'), address of packet sender ('sender'), address
                type ('address_type'), existing bond handle ('bond'), and
                scan resonse data list ('data')
Handles the event for reporting the contents of an advertising or scan
        response packet.
        This event will occur during device discovery but not direct connection.
Handles the event for reporting the contents of an advertising or scan response packet . This event will occur during device discovery but not direct connection .
def _ble_evt_gap_scan_response(self, args):
        """
        Handles the event for reporting the contents of an advertising or scan
        response packet.
        This event will occur during device discovery but not direct connection.

        args -- dictionary containing the RSSI value ('rssi'), packet type
                ('packet_type'), address of packet sender ('sender'), address
                type ('address_type'), existing bond handle ('bond'), and
                scan resonse data list ('data')
        """
        # Parse packet
        packet_type = constants.scan_response_packet_type[args['packet_type']]
        address = bgapi_address_to_hex(args['sender'])
        name, data_dict = self._scan_rsp_data(args['data'])

        # Store device information
        if address not in self._devices_discovered:
            self._devices_discovered[address] = AdvertisingAndScanInfo()
        dev = self._devices_discovered[address]
        if dev.name == "":
            dev.name = name
        if dev.address == "":
            dev.address = address
        if (packet_type not in dev.packet_data or
                len(dev.packet_data[packet_type]) < len(data_dict)):
            dev.packet_data[packet_type] = data_dict
        dev.rssi = args['rssi']
        log.debug("Received a scan response from %s with rssi=%d dBM "
                  "and data=%s", address, args['rssi'], data_dict)

        if self._scan_cb is not None:
            if self._scan_cb(self._devices_discovered, address, packet_type):
                self._evt.clear()
def _ble_evt_gap_scan_response ( self , args ) : # Parse packet packet_type = constants . scan_response_packet_type [ args [ 'packet_type' ] ] address = bgapi_address_to_hex ( args [ 'sender' ] ) name , data_dict = self . _scan_rsp_data ( args [ 'data' ] ) # Store device information if address not in self . _devices_discovered : self . _devices_discovered [ address ] = AdvertisingAndScanInfo ( ) dev = self . _devices_discovered [ address ] if dev . name == "" : dev . name = name if dev . address == "" : dev . address = address if ( packet_type not in dev . packet_data or len ( dev . packet_data [ packet_type ] ) < len ( data_dict ) ) : dev . packet_data [ packet_type ] = data_dict dev . rssi = args [ 'rssi' ] log . debug ( "Received a scan response from %s with rssi=%d dBM " "and data=%s" , address , args [ 'rssi' ] , data_dict ) if self . _scan_cb is not None : if self . _scan_cb ( self . _devices_discovered , address , packet_type ) : self . _evt . clear ( )