gsmopen: begin AT control with tcblib

This commit is contained in:
Giovanni Maruzzelli 2012-04-02 12:56:26 +02:00
parent 11ee736da7
commit 3c27c1f823
2 changed files with 16 additions and 1 deletions

View File

@ -523,6 +523,8 @@ struct private_object {
switch_mutex_t *controldev_audio_lock; switch_mutex_t *controldev_audio_lock;
ctb::SerialPort* serialPort_serial_audio; ctb::SerialPort* serialPort_serial_audio;
ctb::SerialPort* serialPort_serial_control;
}; };
typedef struct private_object private_t; typedef struct private_object private_t;

View File

@ -57,6 +57,18 @@ int gettimeofday(struct timeval *tv, struct sk_timezone *tz)
int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed) int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed)
{ {
tech_pvt->serialPort_serial_control = new ctb::SerialPort();
if( tech_pvt->serialPort_serial_control->Open( "/dev/ttyUSB3", 115200, "8N1", ctb::SerialPort::NoFlowControl ) >= 0 ) {
ERRORA("port SUCCESS open\n", GSMOPEN_P_LOG);
} else {
ERRORA("port NOT open\n", GSMOPEN_P_LOG);
}
return 0;
#ifdef NOTDEF
int fd; int fd;
int rt; int rt;
struct termios tp; struct termios tp;
@ -135,6 +147,7 @@ int gsmopen_serial_init(private_t * tech_pvt, speed_t controldevice_speed)
return -1; return -1;
} }
return (fd); return (fd);
#endif// NOTDEF
} }
@ -393,7 +406,7 @@ int gsmopen_serial_config_AT(private_t * tech_pvt)
WARNINGA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, let's try with 'GSM'\n", GSMOPEN_P_LOG); WARNINGA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, let's try with 'GSM'\n", GSMOPEN_P_LOG);
tech_pvt->no_ucs2 = 1; tech_pvt->no_ucs2 = 1;
} }
#ifdef NOTDEF #ifdef NOTDEF //GSMLIB?
if (tech_pvt->no_ucs2) { if (tech_pvt->no_ucs2) {
res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"GSM\""); res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"GSM\"");
if (res) { if (res) {