I've been working for quite while on little project of mine with some XBee's. Until now all the code has been tested and working on a UBUNTU-SERVER 10.04 LTS, making use of the libftdi libraries for serial-usb simulation/conversion.
At the beginning of this week, I've tried to use the exact same code on a laptop with kubuntu 12.04 make using of the same library versions of libftdi.
The thing is that, in my Satellite L755 - 18K laptop, every time I now try to open my XBee device at /dev/ttyUSB0, it gives me "Bad file descriptor". From the log messages from dmesg, the device registers quite normally and can't seem to put my finger one it.
Here it is the part of code used to open the device:
cfmakeraw(&tio);
cfsetospeed(&tio,B9600); // 9600 baud
cfsetispeed(&tio,B9600); // 9600 baud
tio.c_cc[VMIN]=0;
tio.c_cc[VTIME]=10;
serial_fd=open("/dev/ttyUSB0", O_RDWR);
tcsetattr(serial_fd,TCSANOW,&tio);
if (serial_fd < 0){
cout << "Error while opening device... " << "errno = " << errno << endl;
printf("Something went wrong with open()! %s\n", strerror(errno));
exit(1);
}
Any thoughts on the subject would be greatly appreciated.
Regards