#NEWLINE# def identify_connection( self ) : #NEWLINE# #INDENT# 'Identifies which processor this serial connection is talking to.' #NEWLINE# msg = '' #NEWLINE# while True : #NEWLINE# #INDENT# self . platform . log . debug ( "Sending 'ID:' command to port '%s'" , self . serial_connection . name ) #NEWLINE# self . serial_connection . write ( 'ID:\r' ) #NEWLINE# msg = self . serial_io . readline ( ) #NEWLINE# if msg . startswith ( 'ID:' ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# ( self . remote_processor , self . remote_model , self . remote_firmware ) = msg [ 3 : ] . split ( ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# ( self . remote_processor , self . remote_model ) = msg [ 3 : ] . split ( ) #NEWLINE# #UNINDENT# self . platform . log . info ( 'Received ID acknowledgement. Processor: %s, Board: %s, Firmware: %s' , self . remote_processor , self . remote_model , self . remote_firmware ) #NEWLINE# if ( self . remote_processor == 'DMD' ) : #NEWLINE# #INDENT# min_version = DMD_MIN_FW #NEWLINE# latest_version = DMD_LATEST_FW #NEWLINE# self . dmd = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . remote_processor == 'NET' ) : #NEWLINE# #INDENT# min_version = NET_MIN_FW #NEWLINE# latest_version = NET_LATEST_FW #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# min_version = RGB_MIN_FW #NEWLINE# latest_version = RGB_LATEST_FW #NEWLINE# #UNINDENT# #UNINDENT# if ( StrictVersion ( min_version ) > StrictVersion ( min_version . remote_firmware ) ) : #NEWLINE# #INDENT# self . platform . log . critical ( 'Firmware version mismatch. MPF requires the %s processor to be firmware %s, but yours is %s' , self . remote_processor , min_version , self . remote_firmware ) #NEWLINE# sys . exit ( ) #NEWLINE# #UNINDENT# if ( ( self . remote_processor == 'NET' ) and ( self . platform . machine_type == 'fast' ) ) : #NEWLINE# #INDENT# self . query_fast_io_boards ( )