<code c sms-to-serial.are>
/* DESC: This script can be used to write a received SMS to the serial port.
* Copyright (C) 2012 NetModule AG, Switzerland
*/
DEV = "SERIAL1";
MAXLINES = 100;
nb_syslog("sms-to-serial started");
/* check serial port config */
st = nb_config_get("serial.0.status");
if (st != "2") {
nb_syslog("Serial port is not enabled for us");
exit(1);
}
/* check whether SMS daemon is enabled */
st = nb_config_get("smsd.status");
if (st != "1") {
nb_syslog("SMS daemon is not enabled");
exit(1);
}
/* set port attributes first */
ret = nb_serial_setattr(DEV, 115200, 8, 1, 0, 0);
if (ret != 0) {