This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
configuration:telephone-on-serial [2017/10/23 16:20] – [SDK-Script] fachet | configuration:telephone-on-serial [2017/10/23 16:35] – [SDK-Script] fachet | ||
---|---|---|---|
Line 76: | Line 76: | ||
- | /* DESC: This script can be used to write a message | + | /* DESC: This script can be used to write calling phone numbers |
- | * Copyright (C) 2017 NetModule AG, Switzerland | + | * CR/LF terminated |
+ | * | ||
+ | * Copyright (C) 2017 NetModule AG, Switzerland | ||
*/ | */ | ||
DEV = " | DEV = " | ||
- | + | /* open serial port */ | |
- | void usage() | + | fd = nb_serial_open(DEV); |
- | { | + | if (fd < 0) { |
- | | + | |
- | exit(1); | + | exit(2); |
} | } | ||
- | if (argc < 1) | ||
- | usage(); | ||
- | |||
- | |||
- | /* open serial port */ | ||
ret = nb_serial_setattr(DEV, | ret = nb_serial_setattr(DEV, | ||
if (ret != 0) { | if (ret != 0) { | ||
nb_syslog(" | nb_syslog(" | ||
- | exit(2); | ||
- | } | ||
- | fd = nb_serial_open(DEV); | ||
- | if (fd < 0) { | ||
- | nb_syslog(" | ||
exit(3); | exit(3); | ||
} | } | ||
+ | |||
while (true) { | while (true) { |