dect
/
asterisk
Archived
13
0
Fork 0

Zap optimization

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@665 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
markster 2003-03-20 16:58:45 +00:00
parent b9d5cddecd
commit b8540d2418
1 changed files with 30 additions and 22 deletions

View File

@ -935,6 +935,7 @@ int set_actual_gain(int fd, int chan, float rxgain, float txgain, int law)
float lrxgain;
int j,k;
g.chan = chan;
if ((rxgain != 0.0) || (txgain != 0.0)) {
/* caluculate linear value of tx gain */
ltxgain = pow(10.0,txgain / 20.0);
/* caluculate linear value of rx gain */
@ -962,6 +963,13 @@ int set_actual_gain(int fd, int chan, float rxgain, float txgain, int law)
g.txgain[j] = AST_LIN2MU(k);
}
}
} else {
for (j=0;j<256;j++) {
g.rxgain[j] = j;
g.txgain[j] = j;
}
}
/* set 'em */
return(ioctl(fd,ZT_SETGAINS,&g));
}