提交 3c27c1f8 authored 作者: Giovanni Maruzzelli's avatar Giovanni Maruzzelli

gsmopen: begin AT control with tcblib

上级 11ee736d
...@@ -523,6 +523,8 @@ struct private_object { ...@@ -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;
......
...@@ -57,6 +57,18 @@ int gettimeofday(struct timeval *tv, struct sk_timezone *tz) ...@@ -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) ...@@ -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) ...@@ -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) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论