diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-05-11 23:43:11 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-05-11 23:43:11 +0000 |
commit | 3957d619bb756563a03b3d15b9bffec5239dac19 (patch) | |
tree | a9fbeabe0fa07864461f2d753de4c9dee84218a2 /fxstest.c | |
parent | 0afdce07bf03c4ef19cd6754a7e6d8e2785e5e03 (diff) |
Add support for polarity reversal
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@641 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'fxstest.c')
-rwxr-xr-x | fxstest.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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 (;;) { |