def _on_device_found(self, success, device, failure_reason):
        """Callback function called when a device has been scanned.
        It is executed in the baBLE working thread: should not be blocking.

        Args:
            success (bool): A bool indicating that the operation is successful or not
            device (dict): The scanned device information
              - type (int): Indicates if it is an advertising report or a scan response
              - uuid (uuid.UUID): The service uuid
              - manufacturer_data (bytes): The manufacturer data
              - address (str): The device BT address
              - address_type (str): The device address type (either 'random' or 'public')
              - rssi (int): The signal strength
            failure_reason (any): An object indicating the reason why the operation is not successful (else None)
        """
        if not success:
            self._logger.error("on_device_found() callback called with error: ", failure_reason)
            return

        # If it is an adverting report
        if device['type'] in [0x00, 0x01, 0x02]:
            # If it has the TileBusService
            if device['uuid'] == TileBusService.uuid:
                if len(device['manufacturer_data']) != 6:
                    self._logger.error("Received advertisement response with wrong manufacturer data length "
                                       "(expected=6, received=%d)", len(device['manufacturer_data']))
                    return

                device_uuid, flags = unpack("<LH", device['manufacturer_data'])

                pending = bool(flags & (1 << 0))
                low_voltage = bool(flags & (1 << 1))
                user_connected = bool(flags & (1 << 2))

                info = {
                    'user_connected': user_connected,
                    'connection_string': '{},{}'.format(device['address'], device['address_type']),
                    'uuid': device_uuid,
                    'pending_data': pending,
                    'low_voltage': low_voltage,
                    'signal_strength': device['rssi']
                }

                if not self._active_scan:
                    # If scan is not active, we won't receive a scan response so we trigger the `on_scan` callback
                    self._trigger_callback('on_scan', self.id, info, self.get_config('expiration_time'))
                else:
                    # Else we register the information to get them on scan response received
                    self.partial_scan_responses[device['address']] = info

        # If it is a scan response
        elif device['type'] == 0x04 and device['address'] in self.partial_scan_responses:
            if len(device['manufacturer_data']) != 16:
                self._logger.error("Received scan response with wrong manufacturer data length "
                                   "(expected=16, received=%d)", len(device['manufacturer_data']))
                return

            voltage, stream, reading, reading_time, curr_time = unpack("<HHLLL", device['manufacturer_data'])

            info = self.partial_scan_responses[device['address']]
            info['voltage'] = voltage / 256.0
            info['current_time'] = curr_time
            info['last_seen'] = datetime.datetime.now()

            # If there is a valid reading on the advertising data, broadcast it
            if stream != 0xFFFF:
                reading = IOTileReading(reading_time, stream, reading, reading_time=datetime.datetime.utcnow())
                report = BroadcastReport.FromReadings(info['uuid'], [reading], curr_time)
                self._trigger_callback('on_report', None, report)

            del self.partial_scan_responses[device['address']]
            self._trigger_callback('on_scan', self.id, info, self.get_config('expiration_time'))