1 #ifndef COMMUNICATION_H_INCLUDED 2 #define COMMUNICATION_H_INCLUDED 4 #include "FossaSat1B.h" 82 memcpy(*buffPtr, &val,
sizeof(val));
83 (*buffPtr) +=
sizeof(val);
84 FOSSASAT_DEBUG_PRINT(name);
85 FOSSASAT_DEBUG_PRINT(
'=');
86 FOSSASAT_DEBUG_PRINTLN(val);
148 int16_t
Communication_Send_Response(uint8_t respId, uint8_t* optData =
nullptr,
size_t optDataLen = 0,
bool overrideModem =
false);
bool Communication_Check_OptDataLen(uint8_t expected, uint8_t actual)
Helper functions to check two variables are equal, with debug prints.
void Communication_Send_System_Info()
Send the satellite's information via the configured radio settings.
void Communication_Acknowledge(uint8_t functionId, uint8_t result)
This function sends acknowledge for a received frame.
int16_t Communication_Set_Modem(uint8_t modem)
This function configures the radio to the given modem.
int16_t Communication_Set_Configuration(uint8_t *optData, uint8_t optDataLen)
This function sets the configuration of the radio, which is used to Radio.Begin().
int16_t Communication_Transmit(uint8_t *data, uint8_t len, bool overrideModem=true)
Transmits the given data.
void Communication_Receive_Interrupt()
This function is called by the ISR when a transmission is received.
void Communication_Execute_Function(uint8_t functionId, uint8_t *optData=NULL, size_t optDataLen=0)
This function executes the given function id provided with the given data.
void Communication_CW_Beep(uint32_t len)
This function transmits a continous wave "BEEP"".
void Comunication_Parse_Frame(uint8_t *frame, size_t len)
This function parses the internal contents of the message using the FOSSA COMMS Protocol.
int16_t Communication_Send_Response(uint8_t respId, uint8_t *optData=nullptr, size_t optDataLen=0, bool overrideModem=false)
Responds to a given function id execution (internally used).
void Communication_Send_Morse_Beacon(float battVoltage)
This function transmits a morse beacon message.
void Communication_Process_Packet()
This function reads the contents of the radio when it receives a transmission.
void Communication_Frame_Add(uint8_t **buffPtr, T val, const char *name)
This function adds frame entry to a frame.
int16_t Communication_Set_SpreadingFactor(uint8_t sfMode)
This function sets the spreading factor of the radio.