Apr-09-2023, 05:00 PM
Dear all,
As the title already states I'd like to convert a line , read via the readline() function, I am already Googling all afternoon but cant find a solution.
This is the code I currently have , I would like to convert the variable response into an array of numbers (each byte translated into a number), 27 in total, well maybe without the 27th (<cr>).
This is the code I have :
236d01206c206d02206c2000205ff920280212d020e7203c20090d
As the title already states I'd like to convert a line , read via the readline() function, I am already Googling all afternoon but cant find a solution.
This is the code I currently have , I would like to convert the variable response into an array of numbers (each byte translated into a number), 27 in total, well maybe without the 27th (<cr>).
This is the code I have :
ser.open() #reset_input_buffer() #reset_output_buffer() # Write query command logging.info("Writing query command") ser.write(b'QS\r') logging.info("Read response") #response = ser.read(27) # read up to xx bytes response = ser.readline() print( response.hex() ) #print( response(0))response.hex:
236d01206c206d02206c2000205ff920280212d020e7203c20090d