aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-05 20:15:37 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-05 20:15:37 +0000
commit4bbefa5c47eab04b79e3a52623ac76134f7c0fca (patch)
treeddee686c81ed490fcfdf3e78bd03050e650d2528
parent0fca2eac77c4043e6fd7abf1fa6358fbfdc988ef (diff)
Expand on r48273 (from issue 8506), to translate more of the fskmodem stuff to English.
r48273 dealt with the comments and such, this deals with the code itself. (This couldn't have been easily done if it weren't for 48273 - thanks again for that merbanan) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48276 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--include/asterisk/fskmodem.h6
-rw-r--r--main/callerid.c12
-rw-r--r--main/fskmodem.c34
-rw-r--r--main/tdd.c8
4 files changed, 30 insertions, 30 deletions
diff --git a/include/asterisk/fskmodem.h b/include/asterisk/fskmodem.h
index 76211e507..3b350fb55 100644
--- a/include/asterisk/fskmodem.h
+++ b/include/asterisk/fskmodem.h
@@ -35,7 +35,7 @@ typedef struct {
float spb; /*!< Samples / Bit */
int nbit; /*!< Number of Data Bits (5,7,8) */
float nstop; /*!< Number of Stop Bits 1,1.5,2 */
- int paridad; /*!< Parity 0=none 1=even 2=odd */
+ int parity; /*!< Parity 0=none 1=even 2=odd */
int hdlc; /*!< Modo Packet */
float x0;
float x1;
@@ -53,7 +53,7 @@ typedef struct {
int state;
int pcola; /*!< Pointer to data queues */
float cola_in[NCOLA]; /*!< Queue of input samples */
- float cola_filtro[NCOLA]; /*!< Queue of samples after filters */
+ float cola_filter[NCOLA]; /*!< Queue of samples after filters */
float cola_demod[NCOLA]; /*!< Queue of demodulated samples */
} fsk_data;
@@ -66,6 +66,6 @@ typedef struct {
\arg 1: An output byte was received and stored in outbyte
\arg -1: An error occured in the transmission
He must be called with at least 80 bytes of buffer. */
-int fsk_serie(fsk_data *fskd, short *buffer, int *len, int *outbyte);
+int fsk_serial(fsk_data *fskd, short *buffer, int *len, int *outbyte);
#endif /* _ASTERISK_FSKMODEM_H */
diff --git a/main/callerid.c b/main/callerid.c
index 6ade69411..3a8a60273 100644
--- a/main/callerid.c
+++ b/main/callerid.c
@@ -298,17 +298,17 @@ int callerid_feed_jp(struct callerid_state *cid, unsigned char *ubuf, int len, i
while (mylen >= 160) {
b = b2 = 0;
olen = mylen;
- res = fsk_serie(&cid->fskd, buf, &mylen, &b);
+ res = fsk_serial(&cid->fskd, buf, &mylen, &b);
if (mylen < 0) {
- ast_log(LOG_ERROR, "fsk_serie made mylen < 0 (%d)\n", mylen);
+ ast_log(LOG_ERROR, "fsk_serial made mylen < 0 (%d)\n", mylen);
return -1;
}
buf += (olen - mylen);
if (res < 0) {
- ast_log(LOG_NOTICE, "fsk_serie failed\n");
+ ast_log(LOG_NOTICE, "fsk_serial failed\n");
return -1;
}
@@ -538,14 +538,14 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int
buf[x+cid->oldlen/2] = AST_XLAW(ubuf[x]);
while (mylen >= 160) {
olen = mylen;
- res = fsk_serie(&cid->fskd, buf, &mylen, &b);
+ res = fsk_serial(&cid->fskd, buf, &mylen, &b);
if (mylen < 0) {
- ast_log(LOG_ERROR, "fsk_serie made mylen < 0 (%d)\n", mylen);
+ ast_log(LOG_ERROR, "fsk_serial made mylen < 0 (%d)\n", mylen);
return -1;
}
buf += (olen - mylen);
if (res < 0) {
- ast_log(LOG_NOTICE, "fsk_serie failed\n");
+ ast_log(LOG_NOTICE, "fsk_serial failed\n");
return -1;
}
if (res == 1) {
diff --git a/main/fskmodem.c b/main/fskmodem.c
index aca562807..97a98801d 100644
--- a/main/fskmodem.c
+++ b/main/fskmodem.c
@@ -104,7 +104,7 @@ static double coef_out[NBW][8] = {
/*! Band-pass filter for MARK frequency */
-static inline float filtroM(fsk_data *fskd,float in)
+static inline float filterM(fsk_data *fskd,float in)
{
int i, j;
double s;
@@ -123,7 +123,7 @@ static inline float filtroM(fsk_data *fskd,float in)
}
/*! Band-pass filter for SPACE frequency */
-static inline float filtroS(fsk_data *fskd,float in)
+static inline float filterS(fsk_data *fskd,float in)
{
int i, j;
double s;
@@ -142,7 +142,7 @@ static inline float filtroS(fsk_data *fskd,float in)
}
/*! Low-pass filter for demodulated data */
-static inline float filtroL(fsk_data *fskd,float in)
+static inline float filterL(fsk_data *fskd,float in)
{
int i, j;
double s;
@@ -164,18 +164,18 @@ static inline float filtroL(fsk_data *fskd,float in)
return s;
}
-static inline int demodulador(fsk_data *fskd, float *retval, float x)
+static inline int demodulator(fsk_data *fskd, float *retval, float x)
{
float xS,xM;
fskd->cola_in[fskd->pcola] = x;
- xS = filtroS(fskd,x);
- xM = filtroM(fskd,x);
+ xS = filterS(fskd,x);
+ xM = filterM(fskd,x);
- fskd->cola_filtro[fskd->pcola] = xM-xS;
+ fskd->cola_filter[fskd->pcola] = xM-xS;
- x = filtroL(fskd,xM*xM - xS*xS);
+ x = filterL(fskd,xM*xM - xS*xS);
fskd->cola_demod[fskd->pcola++] = x;
fskd->pcola &= (NCOLA-1);
@@ -197,7 +197,7 @@ static int get_bit_raw(fsk_data *fskd, short *buffer, int *len)
spb2 = spb/2.;
for (f = 0;;) {
- if (demodulador(fskd, &x, GET_SAMPLE))
+ if (demodulator(fskd, &x, GET_SAMPLE))
return -1;
if ((x * fskd->x0) < 0) { /* Transition */
if (!f) {
@@ -219,7 +219,7 @@ static int get_bit_raw(fsk_data *fskd, short *buffer, int *len)
return f;
}
-int fsk_serie(fsk_data *fskd, short *buffer, int *len, int *outbyte)
+int fsk_serial(fsk_data *fskd, short *buffer, int *len, int *outbyte)
{
int a;
int i,j,n1,r;
@@ -242,9 +242,9 @@ int fsk_serie(fsk_data *fskd, short *buffer, int *len, int *outbyte)
just start sending a start bit with nothing preceding it at the beginning
of a transmission (what a LOSING design), we cant do it this elegantly */
/*
- if (demodulador(zap,&x1)) return(-1);
+ if (demodulator(zap,&x1)) return(-1);
for(;;) {
- if (demodulador(zap,&x2)) return(-1);
+ if (demodulator(zap,&x2)) return(-1);
if (x1>0 && x2<0) break;
x1 = x2;
}
@@ -253,7 +253,7 @@ int fsk_serie(fsk_data *fskd, short *buffer, int *len, int *outbyte)
beginning of a start bit in the TDD sceanario. It just looks for sufficient
level to maybe, perhaps, guess, maybe that its maybe the beginning of
a start bit, perhaps. This whole thing stinks! */
- if (demodulador(fskd, &fskd->x1, GET_SAMPLE))
+ if (demodulator(fskd, &fskd->x1, GET_SAMPLE))
return -1;
samples++;
for(;;) {
@@ -263,7 +263,7 @@ search_startbit2:
return 0;
}
samples++;
- if (demodulador(fskd, &fskd->x2, GET_SAMPLE))
+ if (demodulator(fskd, &fskd->x2, GET_SAMPLE))
return(-1);
#if 0
printf("x2 = %5.5f ", fskd->x2);
@@ -279,7 +279,7 @@ search_startbit3:
return 0;
}
for(;i;i--) {
- if (demodulador(fskd, &fskd->x1, GET_SAMPLE))
+ if (demodulator(fskd, &fskd->x1, GET_SAMPLE))
return(-1);
#if 0
printf("x1 = %5.5f ", fskd->x1);
@@ -320,7 +320,7 @@ getbyte:
a >>= j;
/* We read parity bit (if exists) and check parity */
- if (fskd->paridad) {
+ if (fskd->parity) {
olen = *len;
i = get_bit_raw(fskd, buffer, len);
buffer += (olen - *len);
@@ -328,7 +328,7 @@ getbyte:
return(-1);
if (i)
n1++;
- if (fskd->paridad == 1) { /* parity=1 (even) */
+ if (fskd->parity == 1) { /* parity=1 (even) */
if (n1&1)
a |= 0x100; /* error */
} else { /* parity=2 (odd) */
diff --git a/main/tdd.c b/main/tdd.c
index bb7a5746e..7ac9153b3 100644
--- a/main/tdd.c
+++ b/main/tdd.c
@@ -108,7 +108,7 @@ struct tdd_state *tdd_new(void)
tdd->fskd.hdlc = 0; /* Async */
tdd->fskd.nbit = 5; /* 5 bits */
tdd->fskd.nstop = 1.5; /* 1.5 stop bits */
- tdd->fskd.paridad = 0; /* No parity */
+ tdd->fskd.parity = 0; /* No parity */
tdd->fskd.bw=0; /* Filter 75 Hz */
tdd->fskd.f_mark_idx = 0; /* 1400 Hz */
tdd->fskd.f_space_idx = 1; /* 1800 Hz */
@@ -157,15 +157,15 @@ int tdd_feed(struct tdd_state *tdd, unsigned char *ubuf, int len)
c = res = 0;
while (mylen >= 1320) { /* has to have enough to work on */
olen = mylen;
- res = fsk_serie(&tdd->fskd, buf, &mylen, &b);
+ res = fsk_serial(&tdd->fskd, buf, &mylen, &b);
if (mylen < 0) {
- ast_log(LOG_ERROR, "fsk_serie made mylen < 0 (%d) (olen was %d)\n", mylen, olen);
+ ast_log(LOG_ERROR, "fsk_serial made mylen < 0 (%d) (olen was %d)\n", mylen, olen);
free(obuf);
return -1;
}
buf += (olen - mylen);
if (res < 0) {
- ast_log(LOG_NOTICE, "fsk_serie failed\n");
+ ast_log(LOG_NOTICE, "fsk_serial failed\n");
free(obuf);
return -1;
}