22 GroundInterfaceComponentImpl ::
23 GroundInterfaceComponentImpl(
24 const char *
const compName
25 ) : GroundInterfaceComponentBase(compName),
33 void GroundInterfaceComponentImpl ::
38 GroundInterfaceComponentBase::init(instance);
41 GroundInterfaceComponentImpl ::
42 ~GroundInterfaceComponentImpl()
51 void GroundInterfaceComponentImpl ::
62 void GroundInterfaceComponentImpl ::
63 fileDownlinkBufferSendIn_handler(
70 fileDownlinkBufferSendOut_out(0, fwBuffer);
73 void GroundInterfaceComponentImpl ::
79 processBuffer(buffer);
82 void GroundInterfaceComponentImpl ::
91 if (isConnected_readPoll_OutputPort(0)) {
92 readPoll_out(0, buffer);
93 processBuffer(buffer);
115 buffer_wrapper.
serialize(data, size,
true);
121 write_out(0, buffer);
124 void GroundInterfaceComponentImpl ::
139 for(
int i = 0; i < packet_descriptor_size; i++)
142 packet_type |= packet_type_bytes[i];
147 switch (packet_type) {
153 uplinkPort_out(0, com, 0);
158 if (isConnected_fileUplinkBufferGet_OutputPort(0) &&
159 isConnected_fileDownlinkBufferSendOut_OutputPort(0)) {
160 Fw::Buffer buffer = fileUplinkBufferGet_out(0, m_data_size);
161 m_in_ring.peek(buffer.
getData(), m_data_size -
sizeof(packet_type),
HEADER_SIZE +
sizeof(packet_type));
162 buffer.
setSize(m_data_size -
sizeof(packet_type));
163 fileUplinkBufferSendOut_out(0, buffer);
172 void GroundInterfaceComponentImpl ::
179 while (m_in_ring.get_allocated_size() >=
HEADER_SIZE) {
184 status = m_in_ring.peek(m_data_size,
sizeof(
TOKEN_TYPE));
187 if (start != START_WORD || m_data_size >= MAX_DATA_SIZE) {
192 else if (m_in_ring.get_allocated_size() < (
HEADER_SIZE + m_data_size +
sizeof(END_WORD))) {
196 m_in_ring.peek(checksum,
HEADER_SIZE + m_data_size);
198 if (checksum == END_WORD) {
200 m_in_ring.rotate(
HEADER_SIZE + m_data_size +
sizeof(U32));
209 void GroundInterfaceComponentImpl ::
213 while (buffer_offset < buffer.
getSize()) {
216 m_in_ring.serialize(buffer.
getData() + buffer_offset, ser_size);
217 buffer_offset = buffer_offset + ser_size;
PlatformIntType NATIVE_INT_TYPE
uint8_t U8
8-bit unsigned integer
PlatformUIntType NATIVE_UINT_TYPE
U32 FwPacketDescriptorType
C++-compatible configuration header for fprime configuration.
SerializeBufferBase & getSerializeRepr()
U8 * getBuffAddr()
gets buffer address for data filling
SerializeStatus setBuffLen(NATIVE_UINT_TYPE length)
sets buffer length manually after filling with data
void resetSer()
reset to beginning of buffer to reuse for serialization
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
NATIVE_UINT_TYPE getBuffLength() const
returns current buffer size
static const U32 END_WORD
static const U32 MAX_DATA_SIZE
static const TOKEN_TYPE START_WORD
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.