Skip to content

Commit 84e9678

Browse files
authored
code cleanup, fixes #5 #6 #7 (get: UR/DR/UM/DM/UP/DN), adds get time command (TS) (#10)
1 parent e6f9423 commit 84e9678

32 files changed

+1389
-741
lines changed

src/README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ This table makes some assumptions in all conscience.
1414
| | azimuth | response | same as AZ command | `AZ\d{1,3}\.\d` | `AZ123.1` | 2 | |
1515
| EL | set/get elevation | command | ufloat, 1 decimal, [deg] | `EL(\d{1,3}\.\d)?` | set `EL123.1`, get `EL` | 2 | |
1616
| | elevation | response | same as EL command | `EL(\d{1,3}\.\d)` | `EL123.1` | 2 | |
17-
| UP | set~~/get~~ uplink freq | command | uint32, [Hz] | `UP(\d{1,10})?` | set `UP1231231231`, get `UR` | 2 | |
18-
| | uplink freq | :exclamation:response | same as UP command | `UP(\d{1,10})` | `UP1231231231` | 2 | |
19-
| DN | set~~/get~~downlink freq | command | uint32, [Hz] | `DN(\d{1,10})?` | set `DN1231231231`, get `DN` | 2 | |
20-
| | downlink freq | :exclamation:response | same as DN command | `DN\d{1,10}` | `DN1231231231` | 2 | |
21-
| DM | set/~~/get~~ downlink mode | command | word, 1 to 3 char | `DM(\S{1,3})?` | set `DMLSB`, `DMAM`, `DM-`; get `DM` | 2 | |
22-
| | downlink mode | :exclamation:response | same as DM command | `DM\S{1,3}` | `DMLSB` | 2 | |
23-
| UM | set/~~/get~~ uplink mode | command | word, 1 to 3 char | `UM(\S{1,3})?` | set `UMUSB`, `UMCW`, `UM-`; get `UM` | 2 | |
24-
| | uplink mode | :exclamation:response | same as UM command | `UM\S{1,3}` | `UMUSB` | 2 | |
25-
| DR | set/~~/get~~ downlink radio | command | uint8 | `DR(\d{1,3})?` | set `DR999`, get `DR` | 2 | |
26-
| | downlink radio | :exclamation:response | same as DR command | `DR\d{1,3}` | `DR999` | 2 | |
27-
| UR | set/~~/get~~:exclamation: uplink radio | command | uint8 | `UR(\d{1,3})?` | set `UR999`, get `UR` | 2 | |
17+
| UP | set/get uplink freq | command | uint32, [Hz] | `UP(\d{1,10})?` | set `UP1231231231`, get `UR` | 2 | |
18+
| | uplink freq | response | same as UP command | `UP(\d{1,10})` | `UP1231231231` | 2 | |
19+
| DN | set/get downlink freq | command | uint32, [Hz] | `DN(\d{1,10})?` | set `DN1231231231`, get `DN` | 2 | |
20+
| | downlink freq | response | same as DN command | `DN\d{1,10}` | `DN1231231231` | 2 | |
21+
| DM | set/get downlink mode | command | word, 1 to 3 char | `DM(\S{1,3})?` | set `DMLSB`, `DMAM`, `DM-`; get `DM` | 2 | |
22+
| | downlink mode | response | same as DM command | `DM\S{1,3}` | `DMLSB` | 2 | |
23+
| UM | set/get uplink mode | command | word, 1 to 3 char | `UM(\S{1,3})?` | set `UMUSB`, `UMCW`, `UM-`; get `UM` | 2 | |
24+
| | uplink mode | response | same as UM command | `UM\S{1,3}` | `UMUSB` | 2 | |
25+
| DR | set/get downlink radio | command | uint8 | `DR(\d{1,3})?` | set `DR999`, get `DR` | 2 | |
26+
| | downlink radio | response | same as DR command | `DR\d{1,3}` | `DR999` | 2 | |
27+
| UR | set/get uplink radio | command | uint8 | `UR(\d{1,3})?` | set `UR999`, get `UR` | 2 | |
2828
| | uplink radio | response | same as UR command | `UR\d{1,3}` | `UR999` | 2 | |
2929
| ML | move left until max or SA | command | - | `ML` | `ML` | 2 | |
3030
| MR | move right until max or SA | command | - | `MR` | `MR` | 2 | |

src/easycomm-parser-types-ctors.h

+9-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ extern "C"
1515
void easycommSetElevation(EasycommSetElevation *d);
1616
void easycommGetElevation(EasycommGetElevation *d);
1717
void easycommSetUplinkFrequency(EasycommSetUplinkFrequency *d);
18+
void easycommGetUplinkFrequency(EasycommGetUplinkFrequency *d);
1819
void easycommSetDownlinkFrequency(EasycommSetDownlinkFrequency *d);
20+
void easycommGetDownlinkFrequency(EasycommGetDownlinkFrequency *d);
1921
void easycommSetUplinkMode(EasycommSetUplinkMode *d);
22+
void easycommGetUplinkMode(EasycommGetUplinkMode *d);
2023
void easycommSetDownlinkMode(EasycommSetDownlinkMode *d);
21-
void easycommSetUplinkRadioNumber(EasycommSetUplinkRadioNumber *d);
22-
void easycommSetDownlinkRadioNumber(EasycommSetDownlinkRadioNumber *d);
24+
void easycommGetDownlinkMode(EasycommGetDownlinkMode *d);
25+
void easycommSetUplinkRadio(EasycommSetUplinkRadio *d);
26+
void easycommGetUplinkRadio(EasycommGetUplinkRadio *d);
27+
void easycommSetDownlinkRadio(EasycommSetDownlinkRadio *d);
28+
void easycommGetDownlinkRadio(EasycommGetDownlinkRadio *d);
2329
void easycommDoMoveLeft(EasycommDoMoveLeft *d);
2430
void easycommDoMoveRight(EasycommDoMoveRight *d);
2531
void easycommDoMoveUp(EasycommDoMoveUp *d);
@@ -32,6 +38,7 @@ extern "C"
3238
void easycommGetDigitalInput(EasycommGetDigitalInput *d);
3339
void easycommGetAnalogueInput(EasycommGetAnalogueInput *d);
3440
void easycommSetTime(EasycommSetTime *d);
41+
void easycommGetTime(EasycommGetTime *d);
3542
void easycommGetVersion(EasycommGetVersion *d);
3643
void easycommSetVelocityLeft(EasycommSetVelocityLeft *d);
3744
void easycommGetVelocityLeft(EasycommGetVelocityLeft *d);

src/easycomm-parser-types-operators.h

+12-15
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extern "C"
66

77
#include "easycomm-parser-types.h"
88

9-
// ----- equals (equivalent to ==)
9+
// ----- equals (equivalent to == operator)
1010

1111
bool easycommDataEquals(const EasycommData *a, const EasycommData *b);
1212
bool easycommPayloadEquals(const EasycommPayload *a, const EasycommPayload *b);
@@ -18,14 +18,20 @@ extern "C"
1818
bool easycommGetElevationEquals(const EasycommGetElevation *a, const EasycommGetElevation *b);
1919
bool easycommSetUplinkFrequencyEquals(const EasycommSetUplinkFrequency *a,
2020
const EasycommSetUplinkFrequency *b);
21+
bool easycommGetUplinkFrequencyEquals(const EasycommGetUplinkFrequency *a,
22+
const EasycommGetUplinkFrequency *b);
2123
bool easycommSetDownlinkFrequencyEquals(const EasycommSetDownlinkFrequency *a,
2224
const EasycommSetDownlinkFrequency *b);
25+
bool easycommGetDownlinkFrequencyEquals(const EasycommGetDownlinkFrequency *a,
26+
const EasycommGetDownlinkFrequency *b);
2327
bool easycommSetUplinkModeEquals(const EasycommSetUplinkMode *a, const EasycommSetUplinkMode *b);
28+
bool easycommGetUplinkModeEquals(const EasycommGetUplinkMode *a, const EasycommGetUplinkMode *b);
2429
bool easycommSetDownlinkModeEquals(const EasycommSetDownlinkMode *a, const EasycommSetDownlinkMode *b);
25-
bool easycommSetUplinkRadioNumberEquals(const EasycommSetUplinkRadioNumber *a,
26-
const EasycommSetUplinkRadioNumber *b);
27-
bool easycommSetDownlinkRadioNumberEquals(const EasycommSetDownlinkRadioNumber *a,
28-
const EasycommSetDownlinkRadioNumber *b);
30+
bool easycommGetDownlinkModeEquals(const EasycommGetDownlinkMode *a, const EasycommGetDownlinkMode *b);
31+
bool easycommSetUplinkRadioEquals(const EasycommSetUplinkRadio *a, const EasycommSetUplinkRadio *b);
32+
bool easycommGetUplinkRadioEquals(const EasycommGetUplinkRadio *a, const EasycommGetUplinkRadio *b);
33+
bool easycommSetDownlinkRadioEquals(const EasycommSetDownlinkRadio *a, const EasycommSetDownlinkRadio *b);
34+
bool easycommGetDownlinkRadioEquals(const EasycommGetDownlinkRadio *a, const EasycommGetDownlinkRadio *b);
2935
bool easycommDoMoveLeftEquals(const EasycommDoMoveLeft *a, const EasycommDoMoveLeft *b);
3036
bool easycommDoMoveRightEquals(const EasycommDoMoveRight *a, const EasycommDoMoveRight *b);
3137
bool easycommDoMoveUpEquals(const EasycommDoMoveUp *a, const EasycommDoMoveUp *b);
@@ -40,6 +46,7 @@ extern "C"
4046
bool easycommGetDigitalInputEquals(const EasycommGetDigitalInput *a, const EasycommGetDigitalInput *b);
4147
bool easycommGetAnalogueInputEquals(const EasycommGetAnalogueInput *a, const EasycommGetAnalogueInput *b);
4248
bool easycommSetTimeEquals(const EasycommSetTime *a, const EasycommSetTime *b);
49+
bool easycommGetTimeEquals(const EasycommGetTime *a, const EasycommGetTime *b);
4350
bool easycommGetVersionEquals(const EasycommGetVersion *a, const EasycommGetVersion *b);
4451
bool easycommSetVelocityLeftEquals(const EasycommSetVelocityLeft *a, const EasycommSetVelocityLeft *b);
4552
bool easycommGetVelocityLeftEquals(const EasycommGetVelocityLeft *a, const EasycommGetVelocityLeft *b);
@@ -56,16 +63,6 @@ extern "C"
5663
bool easycommDoResetEquals(const EasycommDoReset *a, const EasycommDoReset *b);
5764
bool easycommDoParkEquals(const EasycommDoPark *a, const EasycommDoPark *b);
5865

59-
// ----- copy (equivalent to =, shallow copy)
60-
61-
void easycommDataCopy(const EasycommData *from, EasycommData *to);
62-
void easycommPayloadCopy(const EasycommPayload *from, EasycommPayload *to);
63-
void easycommSingleLineCopy(const EasycommSingleLine *from, EasycommSingleLine *to);
64-
void easycommFrequencyCopy(const EasycommFrequency *from, EasycommFrequency *to);
65-
void easycommSetAzimuthCopy(const EasycommSetAzimuth *from, EasycommSetAzimuth *to);
66-
void easycommSetElevationCopy(const EasycommSetElevation *from, EasycommSetElevation *to);
67-
68-
6966
#ifdef __cplusplus
7067
}
7168
#endif

src/easycomm-parser-types-sprintf.h

+9-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ extern "C"
1515
void easycommSetElevationSprintf(const EasycommSetElevation *from, char *to);
1616
void easycommGetElevationSprintf(const EasycommGetElevation *from, char *to);
1717
void easycommSetUplinkFrequencySprintf(const EasycommSetUplinkFrequency *from, char *to);
18+
void easycommGetUplinkFrequencySprintf(const EasycommGetUplinkFrequency *from, char *to);
1819
void easycommSetDownlinkFrequencySprintf(const EasycommSetDownlinkFrequency *from, char *to);
20+
void easycommGetDownlinkFrequencySprintf(const EasycommGetDownlinkFrequency *from, char *to);
1921
void easycommSetUplinkModeSprintf(const EasycommSetUplinkMode *from, char *to);
22+
void easycommGetUplinkModeSprintf(const EasycommGetUplinkMode *from, char *to);
2023
void easycommSetDownlinkModeSprintf(const EasycommSetDownlinkMode *from, char *to);
21-
void easycommSetUplinkRadioNumberSprintf(const EasycommSetUplinkRadioNumber *from, char *to);
22-
void easycommSetDownlinkRadioNumberSprintf(const EasycommSetDownlinkRadioNumber *from, char *to);
24+
void easycommGetDownlinkModeSprintf(const EasycommGetDownlinkMode *from, char *to);
25+
void easycommSetUplinkRadioSprintf(const EasycommSetUplinkRadio *from, char *to);
26+
void easycommGetUplinkRadioSprintf(const EasycommGetUplinkRadio *from, char *to);
27+
void easycommSetDownlinkRadioSprintf(const EasycommSetDownlinkRadio *from, char *to);
28+
void easycommGetDownlinkRadioSprintf(const EasycommGetDownlinkRadio *from, char *to);
2329
void easycommDoMoveLeftSprintf(const EasycommDoMoveLeft *from, char *to);
2430
void easycommDoMoveRightSprintf(const EasycommDoMoveRight *from, char *to);
2531
void easycommDoMoveUpSprintf(const EasycommDoMoveUp *from, char *to);
@@ -32,6 +38,7 @@ extern "C"
3238
void easycommGetDigitalInputSprintf(const EasycommGetDigitalInput *from, char *to);
3339
void easycommGetAnalogueInputSprintf(const EasycommGetAnalogueInput *from, char *to);
3440
void easycommSetTimeSprintf(const EasycommSetTime *from, char *to);
41+
void easycommGetTimeSprintf(const EasycommGetTime *from, char *to);
3542
void easycommGetVersionSprintf(const EasycommGetVersion *from, char *to);
3643
void easycommSetVelocityLeftSprintf(const EasycommSetVelocityLeft *from, char *to);
3744
void easycommGetVelocityLeftSprintf(const EasycommGetVelocityLeft *from, char *to);

0 commit comments

Comments
 (0)