summaryrefslogtreecommitdiff
path: root/fxstest.c
diff options
context:
space:
mode:
Diffstat (limited to 'fxstest.c')
-rwxr-xr-xfxstest.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/fxstest.c b/fxstest.c
index f200c74..922a1a9 100755
--- a/fxstest.c
+++ b/fxstest.c
@@ -28,6 +28,7 @@ int main(int argc, char *argv[])
" stats - reports voltages\n"
" regdump - dumps ProSLIC registers\n"
" tones - plays a series of tones\n"
+ " polarity - tests polarity reversal\n"
" ring - rings phone\n");
exit(1);
}
@@ -46,6 +47,24 @@ int main(int argc, char *argv[])
fprintf(stderr, "Phone is ringing...\n");
sleep(2);
}
+ } else if (!strcasecmp(argv[2], "polarity")) {
+ fprintf(stderr, "Twiddling polarity...\n");
+ x = 0;
+ res = ioctl(fd, ZT_SETPOLARITY, &x);
+ if (res) {
+ fprintf(stderr, "Unable to polarity...\n");
+ } else {
+ fprintf(stderr, "Polarity is forward...\n");
+ sleep(2);
+ x = 1;
+ ioctl(fd, ZT_SETPOLARITY, &x);
+ fprintf(stderr, "Polarity is reversed...\n");
+ sleep(5);
+ x = 0;
+ ioctl(fd, ZT_SETPOLARITY, &x);
+ fprintf(stderr, "Polarity is forward...\n");
+ sleep(2);
+ }
} else if (!strcasecmp(argv[2], "tones")) {
int x = 0;
for (;;) {