I have a device which returns a string in response to commands written to the device file. I am able to write commands to the device and read the return string in C with code that looks like:
int dev = open("/dev/USBDev251", O_RDWR);
write(dev, data, sizeof(data));
read(dev, buff, 16);
I am trying to do the same in Python with:
dev = os.open("/dev/USBDev251", os.O_RDWR)
os.write(dev, data)
os.read(dev, 16)
The write is successful, but only an empty string is returned. What am I missing here?