summaryrefslogtreecommitdiff
path: root/fxstest.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-02-25 15:35:13 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-02-25 15:35:13 +0000
commit13b50215f07edae9c475a5db4c0e4263d2a38ca9 (patch)
tree2d0af57d9f6d7ea0164f31d65d571640653c65b4 /fxstest.c
parent01dc55fe58b624307911563577d0ad4e3732bf04 (diff)
Add support for FXO module
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@319 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'fxstest.c')
-rwxr-xr-xfxstest.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/fxstest.c b/fxstest.c
index df7a80c..a99943c 100755
--- a/fxstest.c
+++ b/fxstest.c
@@ -66,21 +66,31 @@ int main(int argc, char *argv[])
}
} else if (!strcasecmp(argv[2], "regdump")) {
struct wcfxs_regs regs;
+ int numregs = NUM_REGS;
+ memset(&regs, 0, sizeof(regs));
res = ioctl(fd, WCFXS_GET_REGS, &regs);
if (res) {
fprintf(stderr, "Unable to get registers on channel %s\n", argv[1]);
} else {
+ for (x=60;x<NUM_REGS;x++) {
+ if (regs.direct[x])
+ break;
+ }
+ if (x == NUM_REGS)
+ numregs = 60;
printf("Direct registers: \n");
- for (x=0;x<NUM_REGS;x++) {
+ for (x=0;x<numregs;x++) {
printf("%3d. %02x ", x, regs.direct[x]);
if ((x % 8) == 7)
printf("\n");
}
- printf("\n\nIndirect registers: \n");
- for (x=0;x<NUM_INDIRECT_REGS;x++) {
- printf("%3d. %04x ", x, regs.indirect[x]);
- if ((x % 6) == 5)
- printf("\n");
+ if (numregs == NUM_REGS) {
+ printf("\n\nIndirect registers: \n");
+ for (x=0;x<NUM_INDIRECT_REGS;x++) {
+ printf("%3d. %04x ", x, regs.indirect[x]);
+ if ((x % 6) == 5)
+ printf("\n");
+ }
}
printf("\n\n");
}