def _debug_string(self, debug, data):
        """
        Annotate a frames data, if debug is True.
        """
        if not debug:
            return data
        if self.command in [
            SLOT.CONFIG,
            SLOT.CONFIG2,
            SLOT.UPDATE1,
            SLOT.UPDATE2,
            SLOT.SWAP,
        ]:
            # annotate according to config_st (see ykdef.h)
            if yubico_util.ord_byte(data[-1]) == 0x80:
                return (data, "FFFFFFF")  # F = Fixed data (16 bytes)
            if yubico_util.ord_byte(data[-1]) == 0x81:
                return (data, "FFFFFFF")
            if yubico_util.ord_byte(data[-1]) == 0x82:
                return (data, "FFUUUUU")  # U = UID (6 bytes)
            if yubico_util.ord_byte(data[-1]) == 0x83:
                return (data, "UKKKKKK")  # K = Key (16 bytes)
            if yubico_util.ord_byte(data[-1]) == 0x84:
                return (data, "KKKKKKK")
            if yubico_util.ord_byte(data[-1]) == 0x85:
                return (data, "KKKAAAA")  # A = Access code to set (6 bytes)
            if yubico_util.ord_byte(data[-1]) == 0x86:
                return (data, "AAlETCr")  # l = Length of fixed field (1 byte)
                                          # E = extFlags (1 byte)
                                          # T = tktFlags (1 byte)
                                          # C = cfgFlags (1 byte)
                                          # r = RFU (2 bytes)
            if yubico_util.ord_byte(data[-1]) == 0x87:
                return (data, "rCRaaaa")  # CR = CRC16 checksum (2 bytes)
                                          # a = Access code to use (6 bytes)
            if yubico_util.ord_byte(data[-1]) == 0x88:
                return (data, 'aa')
            # after payload
            if yubico_util.ord_byte(data[-1]) == 0x89:
                return (data, " Scr")

        return (data, '')
def _debug_string ( self , debug , data ) : if not debug : return data if self . command in [ SLOT . CONFIG , SLOT . CONFIG2 , SLOT . UPDATE1 , SLOT . UPDATE2 , SLOT . SWAP , ] : if yubico_util . ord_byte ( data [ - 1 ] ) == 0x80 : return ( data , "FFFFFFF" ) if yubico_util . ord_byte ( data [ - 1 ] ) == 0x81 : return ( data , "FFFFFFF" ) if yubico_util . ord_byte ( data [ - 1 ] ) == 0x82 : return ( data , "FFUUUUU" ) if yubico_util . ord_byte ( data [ - 1 ] ) == 0x83 : return ( data , "UKKKKKK" ) if yubico_util . ord_byte ( data [ - 1 ] ) == 0x84 : return ( data , "KKKKKKK" ) if yubico_util . ord_byte ( data [ - 1 ] ) == 0x85 : return ( data , "KKKAAAA" ) if yubico_util . ord_byte ( data [ - 1 ] ) == 0x86 : return ( data , "AAlETCr" ) if yubico_util . ord_byte ( data [ - 1 ] ) == 0x87 : return ( data , "rCRaaaa" ) if yubico_util . ord_byte ( data [ - 1 ] ) == 0x88 : return ( data , 'aa' ) if yubico_util . ord_byte ( data [ - 1 ] ) == 0x89 : return ( data , " Scr" ) return ( data , '' )
Annotate a frames data, if debug is True.