def sense_ttb(self, target):
        """Sense for a Type B Target is supported for 106, 212 and 424
        kbps. However, there may not be any target that understands the
        activation command in other than 106 kbps.

        """
        log.debug("polling for NFC-B technology")

        if target.brty not in ("106B", "212B", "424B"):
            message = "unsupported bitrate {0}".format(target.brty)
            raise nfc.clf.UnsupportedTargetError(message)

        self.chipset.in_set_rf(target.brty)
        self.chipset.in_set_protocol(self.chipset.in_set_protocol_defaults)
        self.chipset.in_set_protocol(initial_guard_time=20, add_sof=1,
                                     check_sof=1, add_eof=1, check_eof=1)

        sensb_req = (target.sensb_req if target.sensb_req else
                     bytearray.fromhex("050010"))

        log.debug("send SENSB_REQ " + hexlify(sensb_req))
        try:
            sensb_res = self.chipset.in_comm_rf(sensb_req, 30)
        except CommunicationError as error:
            if error != "RECEIVE_TIMEOUT_ERROR":
                log.debug(error)
            return None

        if len(sensb_res) >= 12 and sensb_res[0] == 0x50:
            log.debug("rcvd SENSB_RES " + hexlify(sensb_res))
            return nfc.clf.RemoteTarget(target.brty, sensb_res=sensb_res)
def sense_ttb ( self , target ) : log . debug ( "polling for NFC-B technology" ) if target . brty not in ( "106B" , "212B" , "424B" ) : message = "unsupported bitrate {0}" . format ( target . brty ) raise nfc . clf . UnsupportedTargetError ( message ) self . chipset . in_set_rf ( target . brty ) self . chipset . in_set_protocol ( self . chipset . in_set_protocol_defaults ) self . chipset . in_set_protocol ( initial_guard_time = 20 , add_sof = 1 , check_sof = 1 , add_eof = 1 , check_eof = 1 ) sensb_req = ( target . sensb_req if target . sensb_req else bytearray . fromhex ( "050010" ) ) log . debug ( "send SENSB_REQ " + hexlify ( sensb_req ) ) try : sensb_res = self . chipset . in_comm_rf ( sensb_req , 30 ) except CommunicationError as error : if error != "RECEIVE_TIMEOUT_ERROR" : log . debug ( error ) return None if len ( sensb_res ) >= 12 and sensb_res [ 0 ] == 0x50 : log . debug ( "rcvd SENSB_RES " + hexlify ( sensb_res ) ) return nfc . clf . RemoteTarget ( target . brty , sensb_res = sensb_res )
Sense for a Type B Target is supported for 106, 212 and 424
        kbps. However, there may not be any target that understands the
        activation command in other than 106 kbps.