I have a situation where a user application could be run on either Nano or Xavier NX.
This application is supposed to communicate with a UART device connected to -
- Pins 8 and 10 on the J41 Header if device = Nano
- Pins 8 and 10 on the J12 Header if device = Xavier NX
However they map to different devices under /dev.
- Pins 8 and 10 on the J41 Header, device = Nano maps to /dev/ttyTHS1
- Pins 8 and 10 on the J12 Header, device = Xavier NX maps to /dev/ttyTHS0
I wanted to create symlink to map them to a symbolic path. (say /dev/uart/mydevice)
But I am not sure how I can check automatically within my user application whether the device is Nano or Xavier NX and deploy the appropriate udev rules file accordingly.
Is there any way to check this?