Skip to content

Commit

Permalink
Syslink will now only enable send after a packet has been received.
Browse files Browse the repository at this point in the history
Some minor refactoring as well splitting the big mainLoop function into
sub-functions.

Fixes #1043
  • Loading branch information
tobbeanton committed May 10, 2022
1 parent 508bdc2 commit 3f4c186
Show file tree
Hide file tree
Showing 3 changed files with 269 additions and 217 deletions.
20 changes: 20 additions & 0 deletions interface/syslink.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,31 @@ struct syslinkPacket {
char data[SYSLINK_MTU];
};

/**
* Receive syslink packet.
*
* @param packet Syslink packet to receive data.
*/
bool syslinkReceive(struct syslinkPacket *packet);

/**
* Send syslink packet.
* Will only send if link is first activated by a packet beeing received.
*
* @param packet Syslink packet containing data to send.
*/
bool syslinkSend(struct syslinkPacket *packet);

/**
* Reset syslink state machine.
*/
void syslinkReset();

/**
* Deactivate syslink. Meaning no packets will be sent
* until a packet first has been received.
*/
void syslinkDeactivateUntilPacketReceived();

// Defined packet types
#define SYSLINK_RADIO_RAW 0x00
Expand Down
Loading

0 comments on commit 3f4c186

Please sign in to comment.