Skip to content

Commit

Permalink
code cleanup, fixes #5 #6 #7 (get: UR/DR/UM/DM/UP/DN), adds get time …
Browse files Browse the repository at this point in the history
…command (TS) (#10)
  • Loading branch information
rubienr authored Jun 3, 2022
1 parent e6f9423 commit 84e9678
Show file tree
Hide file tree
Showing 32 changed files with 1,389 additions and 741 deletions.
22 changes: 11 additions & 11 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ This table makes some assumptions in all conscience.
| | azimuth | response | same as AZ command | `AZ\d{1,3}\.\d` | `AZ123.1` | 2 | |
| EL | set/get elevation | command | ufloat, 1 decimal, [deg] | `EL(\d{1,3}\.\d)?` | set `EL123.1`, get `EL` | 2 | |
| | elevation | response | same as EL command | `EL(\d{1,3}\.\d)` | `EL123.1` | 2 | |
| UP | set~~/get~~ uplink freq | command | uint32, [Hz] | `UP(\d{1,10})?` | set `UP1231231231`, get `UR` | 2 | |
| | uplink freq | :exclamation:response | same as UP command | `UP(\d{1,10})` | `UP1231231231` | 2 | |
| DN | set~~/get~~downlink freq | command | uint32, [Hz] | `DN(\d{1,10})?` | set `DN1231231231`, get `DN` | 2 | |
| | downlink freq | :exclamation:response | same as DN command | `DN\d{1,10}` | `DN1231231231` | 2 | |
| DM | set/~~/get~~ downlink mode | command | word, 1 to 3 char | `DM(\S{1,3})?` | set `DMLSB`, `DMAM`, `DM-`; get `DM` | 2 | |
| | downlink mode | :exclamation:response | same as DM command | `DM\S{1,3}` | `DMLSB` | 2 | |
| UM | set/~~/get~~ uplink mode | command | word, 1 to 3 char | `UM(\S{1,3})?` | set `UMUSB`, `UMCW`, `UM-`; get `UM` | 2 | |
| | uplink mode | :exclamation:response | same as UM command | `UM\S{1,3}` | `UMUSB` | 2 | |
| DR | set/~~/get~~ downlink radio | command | uint8 | `DR(\d{1,3})?` | set `DR999`, get `DR` | 2 | |
| | downlink radio | :exclamation:response | same as DR command | `DR\d{1,3}` | `DR999` | 2 | |
| UR | set/~~/get~~:exclamation: uplink radio | command | uint8 | `UR(\d{1,3})?` | set `UR999`, get `UR` | 2 | |
| UP | set/get uplink freq | command | uint32, [Hz] | `UP(\d{1,10})?` | set `UP1231231231`, get `UR` | 2 | |
| | uplink freq | response | same as UP command | `UP(\d{1,10})` | `UP1231231231` | 2 | |
| DN | set/get downlink freq | command | uint32, [Hz] | `DN(\d{1,10})?` | set `DN1231231231`, get `DN` | 2 | |
| | downlink freq | response | same as DN command | `DN\d{1,10}` | `DN1231231231` | 2 | |
| DM | set/get downlink mode | command | word, 1 to 3 char | `DM(\S{1,3})?` | set `DMLSB`, `DMAM`, `DM-`; get `DM` | 2 | |
| | downlink mode | response | same as DM command | `DM\S{1,3}` | `DMLSB` | 2 | |
| UM | set/get uplink mode | command | word, 1 to 3 char | `UM(\S{1,3})?` | set `UMUSB`, `UMCW`, `UM-`; get `UM` | 2 | |
| | uplink mode | response | same as UM command | `UM\S{1,3}` | `UMUSB` | 2 | |
| DR | set/get downlink radio | command | uint8 | `DR(\d{1,3})?` | set `DR999`, get `DR` | 2 | |
| | downlink radio | response | same as DR command | `DR\d{1,3}` | `DR999` | 2 | |
| UR | set/get uplink radio | command | uint8 | `UR(\d{1,3})?` | set `UR999`, get `UR` | 2 | |
| | uplink radio | response | same as UR command | `UR\d{1,3}` | `UR999` | 2 | |
| ML | move left until max or SA | command | - | `ML` | `ML` | 2 | |
| MR | move right until max or SA | command | - | `MR` | `MR` | 2 | |
Expand Down
11 changes: 9 additions & 2 deletions src/easycomm-parser-types-ctors.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ extern "C"
void easycommSetElevation(EasycommSetElevation *d);
void easycommGetElevation(EasycommGetElevation *d);
void easycommSetUplinkFrequency(EasycommSetUplinkFrequency *d);
void easycommGetUplinkFrequency(EasycommGetUplinkFrequency *d);
void easycommSetDownlinkFrequency(EasycommSetDownlinkFrequency *d);
void easycommGetDownlinkFrequency(EasycommGetDownlinkFrequency *d);
void easycommSetUplinkMode(EasycommSetUplinkMode *d);
void easycommGetUplinkMode(EasycommGetUplinkMode *d);
void easycommSetDownlinkMode(EasycommSetDownlinkMode *d);
void easycommSetUplinkRadioNumber(EasycommSetUplinkRadioNumber *d);
void easycommSetDownlinkRadioNumber(EasycommSetDownlinkRadioNumber *d);
void easycommGetDownlinkMode(EasycommGetDownlinkMode *d);
void easycommSetUplinkRadio(EasycommSetUplinkRadio *d);
void easycommGetUplinkRadio(EasycommGetUplinkRadio *d);
void easycommSetDownlinkRadio(EasycommSetDownlinkRadio *d);
void easycommGetDownlinkRadio(EasycommGetDownlinkRadio *d);
void easycommDoMoveLeft(EasycommDoMoveLeft *d);
void easycommDoMoveRight(EasycommDoMoveRight *d);
void easycommDoMoveUp(EasycommDoMoveUp *d);
Expand All @@ -32,6 +38,7 @@ extern "C"
void easycommGetDigitalInput(EasycommGetDigitalInput *d);
void easycommGetAnalogueInput(EasycommGetAnalogueInput *d);
void easycommSetTime(EasycommSetTime *d);
void easycommGetTime(EasycommGetTime *d);
void easycommGetVersion(EasycommGetVersion *d);
void easycommSetVelocityLeft(EasycommSetVelocityLeft *d);
void easycommGetVelocityLeft(EasycommGetVelocityLeft *d);
Expand Down
27 changes: 12 additions & 15 deletions src/easycomm-parser-types-operators.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extern "C"

#include "easycomm-parser-types.h"

// ----- equals (equivalent to ==)
// ----- equals (equivalent to == operator)

bool easycommDataEquals(const EasycommData *a, const EasycommData *b);
bool easycommPayloadEquals(const EasycommPayload *a, const EasycommPayload *b);
Expand All @@ -18,14 +18,20 @@ extern "C"
bool easycommGetElevationEquals(const EasycommGetElevation *a, const EasycommGetElevation *b);
bool easycommSetUplinkFrequencyEquals(const EasycommSetUplinkFrequency *a,
const EasycommSetUplinkFrequency *b);
bool easycommGetUplinkFrequencyEquals(const EasycommGetUplinkFrequency *a,
const EasycommGetUplinkFrequency *b);
bool easycommSetDownlinkFrequencyEquals(const EasycommSetDownlinkFrequency *a,
const EasycommSetDownlinkFrequency *b);
bool easycommGetDownlinkFrequencyEquals(const EasycommGetDownlinkFrequency *a,
const EasycommGetDownlinkFrequency *b);
bool easycommSetUplinkModeEquals(const EasycommSetUplinkMode *a, const EasycommSetUplinkMode *b);
bool easycommGetUplinkModeEquals(const EasycommGetUplinkMode *a, const EasycommGetUplinkMode *b);
bool easycommSetDownlinkModeEquals(const EasycommSetDownlinkMode *a, const EasycommSetDownlinkMode *b);
bool easycommSetUplinkRadioNumberEquals(const EasycommSetUplinkRadioNumber *a,
const EasycommSetUplinkRadioNumber *b);
bool easycommSetDownlinkRadioNumberEquals(const EasycommSetDownlinkRadioNumber *a,
const EasycommSetDownlinkRadioNumber *b);
bool easycommGetDownlinkModeEquals(const EasycommGetDownlinkMode *a, const EasycommGetDownlinkMode *b);
bool easycommSetUplinkRadioEquals(const EasycommSetUplinkRadio *a, const EasycommSetUplinkRadio *b);
bool easycommGetUplinkRadioEquals(const EasycommGetUplinkRadio *a, const EasycommGetUplinkRadio *b);
bool easycommSetDownlinkRadioEquals(const EasycommSetDownlinkRadio *a, const EasycommSetDownlinkRadio *b);
bool easycommGetDownlinkRadioEquals(const EasycommGetDownlinkRadio *a, const EasycommGetDownlinkRadio *b);
bool easycommDoMoveLeftEquals(const EasycommDoMoveLeft *a, const EasycommDoMoveLeft *b);
bool easycommDoMoveRightEquals(const EasycommDoMoveRight *a, const EasycommDoMoveRight *b);
bool easycommDoMoveUpEquals(const EasycommDoMoveUp *a, const EasycommDoMoveUp *b);
Expand All @@ -40,6 +46,7 @@ extern "C"
bool easycommGetDigitalInputEquals(const EasycommGetDigitalInput *a, const EasycommGetDigitalInput *b);
bool easycommGetAnalogueInputEquals(const EasycommGetAnalogueInput *a, const EasycommGetAnalogueInput *b);
bool easycommSetTimeEquals(const EasycommSetTime *a, const EasycommSetTime *b);
bool easycommGetTimeEquals(const EasycommGetTime *a, const EasycommGetTime *b);
bool easycommGetVersionEquals(const EasycommGetVersion *a, const EasycommGetVersion *b);
bool easycommSetVelocityLeftEquals(const EasycommSetVelocityLeft *a, const EasycommSetVelocityLeft *b);
bool easycommGetVelocityLeftEquals(const EasycommGetVelocityLeft *a, const EasycommGetVelocityLeft *b);
Expand All @@ -56,16 +63,6 @@ extern "C"
bool easycommDoResetEquals(const EasycommDoReset *a, const EasycommDoReset *b);
bool easycommDoParkEquals(const EasycommDoPark *a, const EasycommDoPark *b);

// ----- copy (equivalent to =, shallow copy)

void easycommDataCopy(const EasycommData *from, EasycommData *to);
void easycommPayloadCopy(const EasycommPayload *from, EasycommPayload *to);
void easycommSingleLineCopy(const EasycommSingleLine *from, EasycommSingleLine *to);
void easycommFrequencyCopy(const EasycommFrequency *from, EasycommFrequency *to);
void easycommSetAzimuthCopy(const EasycommSetAzimuth *from, EasycommSetAzimuth *to);
void easycommSetElevationCopy(const EasycommSetElevation *from, EasycommSetElevation *to);


#ifdef __cplusplus
}
#endif
11 changes: 9 additions & 2 deletions src/easycomm-parser-types-sprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ extern "C"
void easycommSetElevationSprintf(const EasycommSetElevation *from, char *to);
void easycommGetElevationSprintf(const EasycommGetElevation *from, char *to);
void easycommSetUplinkFrequencySprintf(const EasycommSetUplinkFrequency *from, char *to);
void easycommGetUplinkFrequencySprintf(const EasycommGetUplinkFrequency *from, char *to);
void easycommSetDownlinkFrequencySprintf(const EasycommSetDownlinkFrequency *from, char *to);
void easycommGetDownlinkFrequencySprintf(const EasycommGetDownlinkFrequency *from, char *to);
void easycommSetUplinkModeSprintf(const EasycommSetUplinkMode *from, char *to);
void easycommGetUplinkModeSprintf(const EasycommGetUplinkMode *from, char *to);
void easycommSetDownlinkModeSprintf(const EasycommSetDownlinkMode *from, char *to);
void easycommSetUplinkRadioNumberSprintf(const EasycommSetUplinkRadioNumber *from, char *to);
void easycommSetDownlinkRadioNumberSprintf(const EasycommSetDownlinkRadioNumber *from, char *to);
void easycommGetDownlinkModeSprintf(const EasycommGetDownlinkMode *from, char *to);
void easycommSetUplinkRadioSprintf(const EasycommSetUplinkRadio *from, char *to);
void easycommGetUplinkRadioSprintf(const EasycommGetUplinkRadio *from, char *to);
void easycommSetDownlinkRadioSprintf(const EasycommSetDownlinkRadio *from, char *to);
void easycommGetDownlinkRadioSprintf(const EasycommGetDownlinkRadio *from, char *to);
void easycommDoMoveLeftSprintf(const EasycommDoMoveLeft *from, char *to);
void easycommDoMoveRightSprintf(const EasycommDoMoveRight *from, char *to);
void easycommDoMoveUpSprintf(const EasycommDoMoveUp *from, char *to);
Expand All @@ -32,6 +38,7 @@ extern "C"
void easycommGetDigitalInputSprintf(const EasycommGetDigitalInput *from, char *to);
void easycommGetAnalogueInputSprintf(const EasycommGetAnalogueInput *from, char *to);
void easycommSetTimeSprintf(const EasycommSetTime *from, char *to);
void easycommGetTimeSprintf(const EasycommGetTime *from, char *to);
void easycommGetVersionSprintf(const EasycommGetVersion *from, char *to);
void easycommSetVelocityLeftSprintf(const EasycommSetVelocityLeft *from, char *to);
void easycommGetVelocityLeftSprintf(const EasycommGetVelocityLeft *from, char *to);
Expand Down
Loading

0 comments on commit 84e9678

Please sign in to comment.