#NEWLINE# def scan( controller , bus = None ) : #NEWLINE# #INDENT# print ( 'Beginning sequential scan of all OBD-II PIDs' ) #NEWLINE# for pid in range ( 0 , 136 ) : #NEWLINE# #INDENT# response = controller . create_diagnostic_request ( 2015 , mode = 1 , bus = bus , wait_for_first_response = True , pid = pid ) #NEWLINE# if ( response is not None ) : #NEWLINE# #INDENT# print ( ( 'PID 0x%x responded with: %s' % ( pid , response ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# print ( ( 'PID 0x%x did not respond' % bus ) )