|
version 1.1, 2012/02/21 23:32:47
|
version 1.1.1.2, 2021/03/17 00:39:23
|
|
Line 116
|
Line 116
|
| static void ModemChatIdleResult(void *arg, int rslt, |
static void ModemChatIdleResult(void *arg, int rslt, |
| const char *msg); |
const char *msg); |
| |
|
| static int ModemSetCommand(Context ctx, int ac, char *av[], void *arg); | static int ModemSetCommand(Context ctx, int ac, const char *const av[], const void *arg); |
| static int ModemInstallNodes(Link l); |
static int ModemInstallNodes(Link l); |
| static int ModemGetNgStats(Link l, struct ng_async_stat *sp); |
static int ModemGetNgStats(Link l, struct ng_async_stat *sp); |
| |
|
|
Line 161
|
Line 161
|
| ModemSetCommand, NULL, 2, (void *) SET_SCRIPT_VAR }, |
ModemSetCommand, NULL, 2, (void *) SET_SCRIPT_VAR }, |
| { "watch [+|-cd] [+|-dsr]", "Set signals to monitor", |
{ "watch [+|-cd] [+|-dsr]", "Set signals to monitor", |
| ModemSetCommand, NULL, 2, (void *) SET_WATCH }, |
ModemSetCommand, NULL, 2, (void *) SET_WATCH }, |
| { NULL }, | { NULL, NULL, NULL, NULL, 0, NULL }, |
| }; |
}; |
| |
|
| /* |
/* |
|
Line 792 ModemGetNgStats(Link l, struct ng_async_stat *sp)
|
Line 792 ModemGetNgStats(Link l, struct ng_async_stat *sp)
|
| */ |
*/ |
| |
|
| static int |
static int |
| ModemSetCommand(Context ctx, int ac, char *av[], void *arg) | ModemSetCommand(Context ctx, int ac, const char *const av[], const void *arg) |
| { |
{ |
| Link const l = ctx->lnk; |
Link const l = ctx->lnk; |
| ModemInfo const m = (ModemInfo) l->info; |
ModemInfo const m = (ModemInfo) l->info; |
|
Line 847 ModemSetCommand(Context ctx, int ac, char *av[], void
|
Line 847 ModemSetCommand(Context ctx, int ac, char *av[], void
|
| case SET_WATCH: |
case SET_WATCH: |
| { |
{ |
| int bit, add; |
int bit, add; |
| |
const char *s; |
| |
|
| while (ac--) { |
while (ac--) { |
| switch (**av) { | s = *av; |
| | switch (*s) { |
| case '+': |
case '+': |
| (*av)++; | s++; |
| default: |
default: |
| add = TRUE; |
add = TRUE; |
| break; |
break; |
| case '-': |
case '-': |
| add = FALSE; |
add = FALSE; |
| (*av)++; | s++; |
| break; |
break; |
| } |
} |
| if (!strcasecmp(*av, "cd")) | if (!strcasecmp(s, "cd")) |
| bit = TIOCM_CAR; |
bit = TIOCM_CAR; |
| else if (!strcasecmp(*av, "dsr")) | else if (!strcasecmp(s, "dsr")) |
| bit = TIOCM_DSR; |
bit = TIOCM_DSR; |
| else { |
else { |
| Printf("[%s] modem signal \"%s\" is unknown\r\n", l->name, *av); | Printf("[%s] modem signal \"%s\" is unknown\r\n", l->name, s); |
| bit = 0; |
bit = 0; |
| } |
} |
| if (add) |
if (add) |
|
Line 901 ModemOriginated(Link l)
|
Line 903 ModemOriginated(Link l)
|
| static int |
static int |
| ModemIsSync(Link l) |
ModemIsSync(Link l) |
| { |
{ |
| |
(void)l; |
| return (0); |
return (0); |
| } |
} |
| |
|