23 #ifndef INCLUDED_GR_FRAMER_SINK_1_H
24 #define INCLUDED_GR_FRAMER_SINK_1_H
60 enum state_t {STATE_SYNC_SEARCH, STATE_HAVE_SYNC, STATE_HAVE_HEADER};
62 static const int MAX_PKT_LEN = 4096;
63 static const int HEADERBITLEN = 32;
67 unsigned int d_header;
68 int d_headerbitlen_cnt;
70 unsigned char d_packet[MAX_PKT_LEN];
71 unsigned char d_packet_byte;
72 int d_packet_byte_index;
74 int d_packet_whitener_offset;
81 void enter_have_sync();
82 void enter_have_header(
int payload_len,
int whitener_offset);
87 return ((d_header >> 16) ^ (d_header & 0xffff)) == 0;
95 *len = (d_header >> 16) & 0x0fff;
96 *offset = (d_header >> 28) & 0x000f;
102 int work(
int noutput_items,
103 gr_vector_const_void_star &input_items,
104 gr_vector_void_star &output_items);
Definition: gr_sync_block.h:27
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
#define GR_CORE_API
Definition: gr_core_api.h:30
GR_CORE_API gr_framer_sink_1_sptr gr_make_framer_sink_1(gr_msg_queue_sptr target_queue)
Given a stream of bits and access_code flags, assemble packets.input: stream of bytes from gr_correla...
Definition: gr_framer_sink_1.h:54
virtual int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
just like gr_block::general_work, only this arranges to call consume_each for you ...
void header_payload(int *len, int *offset)
Definition: gr_framer_sink_1.h:90
bool header_ok()
Definition: gr_framer_sink_1.h:84