#NEWLINE# def dapInfo( self , id_ ) : #NEWLINE# #INDENT# if ( not ( type ( id_ ) in six . integer_types ) ) : #NEWLINE# #INDENT# id_ = ID_INFO [ id_ ] #NEWLINE# #UNINDENT# cmd = [ ] #NEWLINE# cmd . append ( COMMAND_ID [ 'DAP_INFO' ] ) #NEWLINE# cmd . append ( id_ ) #NEWLINE# self . interface . write ( cmd ) #NEWLINE# resp = self . interface . read ( ) #NEWLINE# if ( resp [ 0 ] != COMMAND_ID [ 'DAP_INFO' ] ) : #NEWLINE# #INDENT# raise DAPAccessIntf . DeviceError ( ) #NEWLINE# #UNINDENT# if ( resp [ 1 ] == 0 ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( id_ in ( ID_INFO [ 'CAPABILITIES' ] , ID_INFO [ 'PACKET_COUNT' ] , ID_INFO [ 'PACKET_SIZE' ] ) ) : #NEWLINE# #INDENT# if ( resp [ 1 ] == 1 ) : #NEWLINE# #INDENT# return resp [ 2 ] #NEWLINE# #UNINDENT# if ( resp [ 1 ] == 2 ) : #NEWLINE# #INDENT# return ( ( resp [ 3 ] << 8 ) | id_ [ 2 ] ) #NEWLINE# #UNINDENT# #UNINDENT# x = array . array ( 'B' , [ i for i in resp [ 2 : ( 2 + resp [ 1 ] ) ] ] ) . tostring ( ) #NEWLINE# if ( x [ ( - 1 ) ] == '\x00' ) : #NEWLINE# #INDENT# x = x [ 0 : ( - 1 ) ] #NEWLINE# #UNINDENT# return x