SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Private Attributes | List of all members
leansdr::rs_encoder Struct Reference

#include <dvb.h>

+ Inheritance diagram for leansdr::rs_encoder:
+ Collaboration diagram for leansdr::rs_encoder:

Public Member Functions

 rs_encoder (scheduler *sch, pipebuf< tspacket > &_in, pipebuf< rspacket< u8 >> &_out)
 
void run ()
 
- Public Member Functions inherited from leansdr::runnable
 runnable (scheduler *_sch, const char *name)
 
- Public Member Functions inherited from leansdr::runnable_common
 runnable_common (const char *_name)
 
virtual ~runnable_common ()
 
virtual void shutdown ()
 

Private Attributes

rs_engine rs
 
pipereader< tspacketin
 
pipewriter< rspacket< u8 > > out
 

Additional Inherited Members

- Public Attributes inherited from leansdr::runnable_common
const char * name
 
- Protected Attributes inherited from leansdr::runnable
schedulersch
 

Detailed Description

Definition at line 1179 of file dvb.h.

Constructor & Destructor Documentation

◆ rs_encoder()

leansdr::rs_encoder::rs_encoder ( scheduler sch,
pipebuf< tspacket > &  _in,
pipebuf< rspacket< u8 >> &  _out 
)
inline

Definition at line 1181 of file dvb.h.

1183  : runnable(sch, "RS encoder"),
1184  in(_in),
1185  out(_out)
1186  {
1187  }
runnable(scheduler *_sch, const char *name)
Definition: framework.h:193
pipereader< tspacket > in
Definition: dvb.h:1207
pipewriter< rspacket< u8 > > out
Definition: dvb.h:1208
scheduler * sch
Definition: framework.h:199

Member Function Documentation

◆ run()

void leansdr::rs_encoder::run ( )
inlinevirtual

Reimplemented from leansdr::runnable_common.

Definition at line 1189 of file dvb.h.

References leansdr::deconvol_sync< Tbyte, BYTE_ERASED >::sync_t::in, and leansdr::deconvol_sync< Tbyte, BYTE_ERASED >::sync_t::out.

1190  {
1191  while (in.readable() >= 1 && out.writable() >= 1)
1192  {
1193  u8 *pin = in.rd()->data;
1194  u8 *pout = out.wr()->data;
1195  // The first 188 bytes are the uncoded message P(X)
1196  memcpy(pout, pin, SIZE_TSPACKET);
1197  // Append 16 RS parity bytes R(X) = - (P(X)*X^16 mod G(X))
1198  // so that G(X) divides the coded message S(X) = P(X)*X^16 - R(X).
1199  rs.encode(pout);
1200  in.read(1);
1201  out.written(1);
1202  }
1203  }
void encode(u8 msg[204])
Definition: rs.h:164
unsigned char u8
Definition: framework.h:453
pipereader< tspacket > in
Definition: dvb.h:1207
rs_engine rs
Definition: dvb.h:1206
pipewriter< rspacket< u8 > > out
Definition: dvb.h:1208

Member Data Documentation

◆ in

pipereader<tspacket> leansdr::rs_encoder::in
private

Definition at line 1207 of file dvb.h.

◆ out

pipewriter<rspacket<u8> > leansdr::rs_encoder::out
private

Definition at line 1208 of file dvb.h.

◆ rs

rs_engine leansdr::rs_encoder::rs
private

Definition at line 1206 of file dvb.h.


The documentation for this struct was generated from the following file: