#include "standard.h"#include "al.h"#include "al_sending.h"#include "al_receiving.h"#include "rcpc.h"#include "crc4.h"#include "arq.h"#include "uep_rcpcc.h"#include "LList.h"#include "between.h"Go to the source code of this file.
Defines | |
| #define | DEF_MAX_ARQ 3 |
Functions | |
| al_receiving_entity * | new_al_receiving_entity (channel_info *nfo) |
| void | send_to_al (al_receiving_entity *which, byte b) |
| void | send_closing_flag (al_receiving_entity *which) |
| int | al_indication (al_receiving_entity *which) |
| byte | al_receive (al_receiving_entity *which) |
Variables | |
| int | debug |
|
|
Definition at line 12 of file al_receiving.c. |
|
|
Definition at line 139 of file al_receiving.c. References blevel(), and al_receiving_entity::outgoing_data. Referenced by decode_audio(), and decode_video(). 00144 {
00145 if (blevel(which->outgoing_data))
00146 return 1;
00147 else
00148 return 0;
00149 }
|
|
|
Definition at line 152 of file al_receiving.c. References bread(), byte, and al_receiving_entity::outgoing_data. Referenced by decode_audio(), and decode_video(). 00156 {
00157 byte b;
00158
00159 bread(which->outgoing_data, &b);
00160
00161 return b;
00162 }
|
|
|
|
Definition at line 68 of file al_receiving.c. References blevel(), bread(), bwrite(), byte, crc16(), crc8(), al_receiving_entity::incoming_data, al_receiving_entity::outgoing_data, and al_receiving_entity::type. Referenced by demultiplex(). 00075 {
00076 byte inbuf[MAX_AL_BUFFER_SIZE];
00077 byte inbyte;
00078 byte computedCRC,receivedCRC;
00079 unsigned short computedCRC16,receivedCRC16;
00080 int i;
00081 int len=blevel(which->incoming_data);
00082
00083 if (len > 0) {
00084 if (which->type == AL1) {
00085 /* just transfer incoming buffer to outgoing buffer.. */
00086 for(i=0;i<len;i++) {
00087 bread(which->incoming_data,(void *) &inbyte);
00088 bwrite(which->outgoing_data,(void *) &inbyte);
00089 }
00090 }
00091 else if (which->type == AL2) {
00092 /* check one byte crc, if good transfer to outgoing. if not, put back
00093 into incoming */
00094 computedCRC = 0;
00095 for(i=0;i<len-1;i++) {
00096 bread(which->incoming_data,(void *) inbuf+i);
00097 crc8(&computedCRC,inbuf[i]);
00098 }
00099 bread(which->incoming_data,(void *) inbuf+(len-1));
00100 receivedCRC = inbuf[len-1];
00101 if (computedCRC == receivedCRC) { /* put data without crc into outgoing buf */
00102 if (debug) printf("AL receiving good CRC\n");
00103 for(i=0;i<len-1;i++)
00104 bwrite(which->outgoing_data,(void *) inbuf + i);
00105 }
00106 else { /* put all data back into incoming_data, bad crc */
00107 if (debug) printf("AL receiving bad CRC\n");
00108 for(i=0;i<len;i++)
00109 bwrite(which->incoming_data,(void *) inbuf + i);
00110 }
00111 }
00112 else if (which->type == AL3) {
00113 /* check two byte crc, if good transfer to outgoing. if not, put back into
00114 incoming */
00115 computedCRC16 = 0;
00116 for(i=0;i<len-2;i++) {
00117 bread(which->incoming_data,(void *) inbuf+i);
00118 crc16(&computedCRC16,inbuf[i]);
00119 }
00120 bread(which->incoming_data,(void *) inbuf+(len-2));
00121 bread(which->incoming_data,(void *) inbuf+(len-1));
00122 receivedCRC16 = inbuf[len-2];
00123 receivedCRC16 = (receivedCRC16 << 8) | (inbuf[len-1]);
00124 if (computedCRC16 == receivedCRC16) { /* put data without crc into outgoing buf */
00125 if (debug) printf("AL receiving good CRC\n");
00126 for(i=0;i<len-2;i++)
00127 bwrite(which->outgoing_data,(void *) inbuf + i);
00128 }
00129 else { /* bad crc, send it anyway. could modify to send with an error msg */
00130 if (debug) printf("AL receiving bad CRC\n");
00131 for(i=0;i<len-2;i++)
00132 bwrite(which->outgoing_data,(void *) inbuf + i);
00133 }
00134 }
00135 }
00136 }
|
|
||||||||||||
|
Definition at line 59 of file al_receiving.c. References bwrite(), and al_receiving_entity::incoming_data. Referenced by demultiplex(). 00063 {
00064 bwrite(which->incoming_data, &b);
00065 }
|
|
|
Definition at line 23 of file main.c. Referenced by apply_errors(), decode_bch(), do_cmd(), encode_bch(), gen_poly(), GetRcpcBits(), MakeNewVideoPacket(), Makeppx(), mdecode_bch(), multiplex(), rcpcc16_decode(), rcpcc16_encode(), set_config(), and show_vars(). |
1.3.9.1