python-OBD icon indicating copy to clipboard operation
python-OBD copied to clipboard

Passing Through Raw Vehicle Response Info In Custom Commands

Open peszaber opened this issue 2 years ago • 1 comments

I'm currently trying to request some non-standard OBD Modes/Service IDs using the Custom Command feature, the "OBDCommand" object.

I'd like to be able to get the response back I get from the vehicle without any sort of decoding, however this does not seem to be possible. Using a decoder function within the OBDCommand object that just returns the same input, the only output I get when I query the custom command is "<obd.OBDResponse.OBDResponse at 0x1fc7ac58130>", which I assume is just the memory address of the object. However, if I enable debugging I can see that I am actually able to see the byte array response from the vehicle, but since this is not a part of the actual output I am unable to manipulate it further.

peszaber avatar Feb 17 '23 17:02 peszaber

what you're looking for is the 'message' attribute for that response object that's returned by your custom command:

r = obd.query(my_custom_command)
print(r.message) # <--- your raw, un-decoded data should be here

csurf avatar Jul 03 '23 02:07 csurf