[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with libmod-1.5
While running SMSLink, a sms to email gateway, in AXIS devboard 82 I get an
unusual problem while connecting to the gsm modem. The package SMSLink uses
libmodem-1.5 and i'm monitoring ttyS2 with sermon. Everything works fine
with the the first initialization string.
>sermon /dev/ttyS2 9600
sniffing /dev/ttyS2 at 9600baud
ATZ0 (the initialization string)
OK (the response from the modem)
---
after that I get an error from libmodem-1.5 routines:
lopen_mdm_line():FD was not set when select returned (timeout)
examining the code in libmodem-1.5 I see:
#define EMDMNOFDSET 23 /* FD was not set when select returned
(timeout) */
that returns from this piece of code
cfm = '\0';
FD_ZERO(&readfds);
FD_SET(fd, &readfds);
tmout.tv_sec = device->dl;
tmout.tv_usec = 0;
ret = select(FD_SETSIZE, &readfds, NULL, NULL, &tmout);
if (ret < 0) {
mdmfree(cmdbuffer);
mdmfree(cmdmodem);
return (mdmerrno = -EMDMSEL);
}
if (!FD_ISSET(fd, &readfds)) {
mdmfree(cmdbuffer);
mdmfree(cmdmodem);
return (mdmerrno = -EMDMNOFDSET);
}
From the man pages for UNIX:
FD_ZERO(&fdset)
Initializes the file descriptor set fdset to have zero
bits for all file descriptors.
FD_SET(fd, &fdset)
Sets the bit for the file descriptor fd in the file
descriptor set fdset.
FD_ISSET(fd, &fdset)
Returns a non-zero value if the bit for the file
descriptor fd is set in the file descriptor set
pointed to by fdset, and 0 otherwise.
For the purpose of this program I think the file descriptor is /dev/ttyS2
wich I am using to communicate with the modem. Since the /dev tree is
read-only, the probable cause is that the program tries to write in a
filesystem which is read-only.
I have no way of redirecting the modem port in config file of libmodem
(modems) to other directory since libmodem-1.5 config files assume all
devices are in /dev tree.
Is there any way of making this directory also writable?
Thank You