25 m_protocol(
NULL), m_in_ring(m_ring_buffer, sizeof(m_ring_buffer))
29 DeframerComponentBase::init(instance);
36 m_protocol = &protocol;
37 protocol.
setup(*
this);
45 void DeframerComponentImpl ::framedIn_handler(
const NATIVE_INT_TYPE portNum,
47 Drv::RecvStatus recvStatus) {
48 if (Drv::RECV_OK == recvStatus) {
49 processBuffer(recvBuffer);
51 framedDeallocate_out(0, recvBuffer);
55 Fw::Buffer buffer(m_poll_buffer,
sizeof(m_poll_buffer));
57 if (isConnected_framedPoll_OutputPort(0)) {
58 Drv::PollStatus status = framedPoll_out(0, buffer);
59 if (status == Drv::POLL_OK) {
60 processBuffer(buffer);
65 Fw::Buffer DeframerComponentImpl ::allocate(
const U32 size) {
66 return bufferAllocate_out(0, size);
69 void DeframerComponentImpl ::route(
Fw::Buffer& data) {
78 bufferDeallocate_out(0, data);
83 switch (packet_type) {
87 comOut_out(0, com, 0);
89 bufferDeallocate_out(0, data);
94 if (isConnected_bufferOut_OutputPort(0)) {
98 bufferOut_out(0, data);
104 bufferDeallocate_out(0, data);
110 void DeframerComponentImpl ::processRing() {
136 void DeframerComponentImpl ::processBuffer(
Fw::Buffer& buffer) {
138 U32 buffer_offset = 0;
140 for (i = 0; (i < (buffer.
getSize() + 1)) and (buffer_offset < buffer.
getSize()); i++) {
141 U32 remaining = buffer.
getSize() - buffer_offset;
146 buffer_offset = buffer_offset + ser_size;