FOSSASAT-1B
Loading...
Searching...
No Matches
communication.h
Go to the documentation of this file.
1#ifndef COMMUNICATION_H_INCLUDED
2#define COMMUNICATION_H_INCLUDED
3
4#include "FossaSat1B.h"
5
18
28
39
50
60
69
80 template <typename T>
81 void Communication_Frame_Add(uint8_t** buffPtr, T val, const char* name) {
82 memcpy(*buffPtr, &val, sizeof(val));
83 (*buffPtr) += sizeof(val);
84 FOSSASAT_DEBUG_PRINT(name);
85 FOSSASAT_DEBUG_PRINT('=');
86 FOSSASAT_DEBUG_PRINTLN(val);
87 }
95
105
113
123
135
149
161
173
174#endif
int16_t Communication_Set_Modem(uint8_t modem)
This function configures the radio to the given modem.
void Communication_Acknowledge(uint8_t functionId, uint8_t result)
This function sends acknowledge for a received frame.
void Communication_Frame_Add(uint8_t **buffPtr, T val, const char *name)
This function adds frame entry to a frame.
int16_t Communication_Transmit(uint8_t *data, uint8_t len, bool overrideModem=true)
Transmits the given data.
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().
void Communication_Send_Morse_Beacon(float battVoltage)
This function transmits a morse beacon message.
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_Receive_Interrupt()
This function is called by the ISR when a transmission is received.
void Comunication_Parse_Frame(uint8_t *frame, size_t len)
This function parses the internal contents of the message using the FOSSA COMMS Protocol.
bool Communication_Check_OptDataLen(uint8_t expected, uint8_t actual)
Helper functions to check two variables are equal, with debug prints.
int16_t Communication_Set_SpreadingFactor(uint8_t sfMode)
This function sets the spreading factor of the radio.
void Communication_Process_Packet()
This function reads the contents of the radio when it receives a transmission.
void Communication_Send_System_Info()
Send the satellite's information via the configured radio settings.
void Communication_CW_Beep(uint32_t len)
This function transmits a continous wave "BEEP"".
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).
T Persistent_Storage_Read(uint16_t addr)
This function reads a value of type T from EEPROM.