![]() |
FOSSASAT-1B
|
This system is the main interface that is used to transmit message, configure the radio and process received transmissions. More...
#include "FossaSat1B.h"
Go to the source code of this file.
Functions | |
void | Communication_Receive_Interrupt () |
This function is called by the ISR when a transmission is received. More... | |
int16_t | Communication_Set_Modem (uint8_t modem) |
This function configures the radio to the given modem. More... | |
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(). More... | |
int16_t | Communication_Set_SpreadingFactor (uint8_t sfMode) |
This function sets the spreading factor of the radio. More... | |
void | Communication_Send_Morse_Beacon (float battVoltage) |
This function transmits a morse beacon message. More... | |
void | Communication_CW_Beep (uint32_t len) |
This function transmits a continous wave "BEEP"". More... | |
template<typename T > | |
void | Communication_Frame_Add (uint8_t **buffPtr, T val, const char *name) |
This function adds frame entry to a frame. More... | |
void | Communication_Send_System_Info () |
Send the satellite's information via the configured radio settings. More... | |
void | Communication_Acknowledge (uint8_t functionId, uint8_t result) |
This function sends acknowledge for a received frame. More... | |
void | Communication_Process_Packet () |
This function reads the contents of the radio when it receives a transmission. More... | |
void | Comunication_Parse_Frame (uint8_t *frame, size_t len) |
This function parses the internal contents of the message using the FOSSA COMMS Protocol. More... | |
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. More... | |
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). More... | |
int16_t | Communication_Transmit (uint8_t *data, uint8_t len, bool overrideModem=true) |
Transmits the given data. More... | |
bool | Communication_Check_OptDataLen (uint8_t expected, uint8_t actual) |
Helper functions to check two variables are equal, with debug prints. More... | |
This system is the main interface that is used to transmit message, configure the radio and process received transmissions.
Definition in file communication.h.
void Communication_Acknowledge | ( | uint8_t | functionId, |
uint8_t | result | ||
) |
This function sends acknowledge for a received frame.
functionId | Function ID to acknowledge. |
result | Result of frame processing. |
Definition at line 237 of file communication.cpp.
bool Communication_Check_OptDataLen | ( | uint8_t | expected, |
uint8_t | actual | ||
) |
Helper functions to check two variables are equal, with debug prints.
expected | The expected value |
actual | The given value. |
Definition at line 816 of file communication.cpp.
void Communication_CW_Beep | ( | uint32_t | len | ) |
This function transmits a continous wave "BEEP"".
len | Length of the beep in ms, with 500 ms resolution |
Definition at line 153 of file communication.cpp.
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.
functionId | The function to execute. |
optData | The data to give to the function. |
optDataLen | The length of the data that is given to the function. |
Definition at line 381 of file communication.cpp.
void Communication_Frame_Add | ( | uint8_t ** | buffPtr, |
T | val, | ||
const char * | name | ||
) |
This function adds frame entry to a frame.
buffPtr | Pointer to the frame buffer. |
val | Value to be added. |
name | Name of the parameter (debug only); |
Definition at line 81 of file communication.h.
void Communication_Process_Packet | ( | ) |
This function reads the contents of the radio when it receives a transmission.
Definition at line 242 of file communication.cpp.
void Communication_Receive_Interrupt | ( | ) |
This function is called by the ISR when a transmission is received.
Definition at line 3 of file communication.cpp.
void Communication_Send_Morse_Beacon | ( | float | battVoltage | ) |
This function transmits a morse beacon message.
(ID COMMS_H_T5) (SEV 1) Test that the beacon message can be received properly.
(ID COMMS_H_T6) (SEV 1) Test that the beacon messages battery voltage is received ok.
battVoltage | The battery voltage to send via morse code. |
Definition at line 122 of file communication.cpp.
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).
respId | Function ID to respond with. |
optData | The data to respond with. |
optDataLen | The length of the data to respond with. |
overrideModem | Override the modem to use default LoRa modem and settings. |
Definition at line 694 of file communication.cpp.
void Communication_Send_System_Info | ( | ) |
Send the satellite's information via the configured radio settings.
Definition at line 159 of file communication.cpp.
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().
optData | The data which is used to configure the radio. |
optDataLen | The length of the byte string given. |
Definition at line 90 of file communication.cpp.
int16_t Communication_Set_Modem | ( | uint8_t | modem | ) |
This function configures the radio to the given modem.
modem | see Modem Identifiers |
Definition at line 13 of file communication.cpp.
int16_t Communication_Set_SpreadingFactor | ( | uint8_t | sfMode | ) |
This function sets the spreading factor of the radio.
(ID COMMS_H_T3) (SEV 1) Make sure the radio's spreading factor can be changed with no errors.
(ID COMMS_H_T4) (SEV 1) Make sure the radio's spreading factors are compatable with generic radios.
sfMode | See defines_radio_lora_configuraiton |
Definition at line 71 of file communication.cpp.
int16_t Communication_Transmit | ( | uint8_t * | data, |
uint8_t | len, | ||
bool | overrideModem = true |
||
) |
Transmits the given data.
data | The byte array to transmit. |
len | The length of the byte array to transmit. |
overrideModem | Override the modem to use default LoRa modem and settings. |
Definition at line 719 of file communication.cpp.
void Comunication_Parse_Frame | ( | uint8_t * | frame, |
size_t | len | ||
) |
This function parses the internal contents of the message using the FOSSA COMMS Protocol.
frame | The raw data to process. |
len | The length of the raw data. |
Definition at line 293 of file communication.cpp.