( left ( from , strlen ( sender ) ) == sender ) {
if
allowed = 1;
break
}
}
}
( allowed == 0) {
if
nb_syslog (
" "
;
return
}
{
else
nb_syslog (
}
}
}
{
else
/* saw text line */
( AUTH && tlnr == 0) {
if
/* first line of message must contain the password */
( left ( line , strlen ( ADMPWD ) ) != ADMPWD ) {
if
nb_syslog (
" "
;
return
}
{
else
nb_syslog (
}
}
(( AUTH && tlnr == 1) || (! AUTH && tlnr == 0) ) {
else if
/* this line must contain the command */
( left ( line , 6) ==
if
" reboot "
return
}
( left ( line , 7) ==
else if
" connect "
return
}
( left ( line , 10) ==
else if
" disconnect "
return
}
( left ( line , 6) ==
else if
" status "
return
}
( left ( line , 6) ==
else if
printf (
" parsed msg : % s \ n "
left ( line , 13) ;
return
}
}
{
else
;
break
}
tlnr ++;
}
}
nb_syslog (
" no command detected "
" "
;
return
}
setdio ( string cmd )
int
{
newstate = substr ( cmd , 9 , 3) ;
port = substr ( cmd , 7 , 1) ;
( port !=
" 1 "
&& port !=
if
nb_syslog (
" invalid DIO port % s \ n "
-1;
return
}
( newstate ==
" on "
) {
if
st = 1;
}
( newstate ==
" off "
else if
st = 0;
}
{
else
nb_syslog (
" invalid new DIO state % s \ n "
-1;
return
}
rc = nb_dio_set ( sprintf (
" out % s "
( rc ) {
if
nb_syslog (
" Unable to set state % s for DIO output port % s \ n "
-1;
return
}
{
else
nb_syslog (
" Setting state % s for DIO output port % s \ n "
0;
return
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - main - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* check if we got stressed */
LASTFILE =
" / tmp / sms - control . last "
last = 0;
NB2700 User Manual
;
" rejecting message from unknown sender % s "
" sender % s can pass "
, from ) ;
" aut henti cation failed "
) ;
" aut henti cation succeeded "
) ;
" reboot "
) {
;
" connect "
) {
;
" disconnect "
) {
;
" status "
) {
;
" output "
) {
, left ( line , 6) ) ;
) ;
" 2 "
) {
, port ) ;
) {
, newstate ) ;
, port ) , st ) ;
;
141
, from ) ;
, newstate , dout ) ;
, newstate , dout ) ;
Need help?
Do you have a question about the NB2700 and is the answer not in the manual?