I'm working on a CAN sniffer/logger for and will connect to ECUs that may send out CANopen, J1939 or UDS. Most often two or even all of them in one session (For what I have understood this is not recommended but this is the case).
I know CANopen (non fd) has an 11-bit identifier unlike J1939 and UDS that uses 29-bit identifier. To sort out the 11-bit is easy but is there any known way to know if an unknown message with 29-bit identifier is UDS or J1939? My guess is no...
I found some code using (29bit_id & 0x70000)==0x70000 to sort it as J1939 but that misses some J1939 and it must be likely that UDS might have these bits set also. Any suggestions?