Skip to content

Commit e6f9423

Browse files
authored
Code cleanup and refactoring (#9)
* code cleanup * updated unit tests to comply with PlatformIO core 6.0 * updated unity_config.h and transport to comply with PlatformIO core 6.0
1 parent ab71f6e commit e6f9423

38 files changed

+1305
-1045
lines changed

src/easycomm-parser-types-ctors.h

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,43 @@ extern "C"
1010
void easycommPayload(EasycommPayload *d);
1111
void easycommSingleLine(EasycommSingleLine *d);
1212
void easycommFrequency(EasycommFrequency *d);
13-
void easycommAzimuth(EasycommAzimuth *d);
13+
void easycommSetAzimuth(EasycommSetAzimuth *d);
1414
void easycommGetAzimuth(EasycommGetAzimuth *d);
15-
void easycommElevation(EasycommElevation *d);
15+
void easycommSetElevation(EasycommSetElevation *d);
1616
void easycommGetElevation(EasycommGetElevation *d);
17-
void easycommUplinkFrequency(EasycommUplinkFrequency *d);
18-
void easycommDownlinkFrequency(EasycommDownlinkFrequency *d);
19-
void easycommUplinkMode(EasycommUplinkMode *d);
20-
void easycommDownlinkMode(EasycommDownlinkMode *d);
21-
void easycommUplinkRadioNumber(EasycommUplinkRadioNumber *d);
22-
void easycommDownlinkRadioNumber(EasycommDownlinkRadioNumber *d);
23-
void easycommMoveLeft(EasycommMoveLeft *d);
24-
void easycommMoveRight(EasycommMoveRight *d);
25-
void easycommMoveUp(EasycommMoveUp *d);
26-
void easycommMoveDown(EasycommMoveDown *d);
27-
void easycommStopAzimuthMove(EasycommStopAzimuthMove *d);
28-
void easycommStopElevationMove(EasycommStopElevationMove *d);
17+
void easycommSetUplinkFrequency(EasycommSetUplinkFrequency *d);
18+
void easycommSetDownlinkFrequency(EasycommSetDownlinkFrequency *d);
19+
void easycommSetUplinkMode(EasycommSetUplinkMode *d);
20+
void easycommSetDownlinkMode(EasycommSetDownlinkMode *d);
21+
void easycommSetUplinkRadioNumber(EasycommSetUplinkRadioNumber *d);
22+
void easycommSetDownlinkRadioNumber(EasycommSetDownlinkRadioNumber *d);
23+
void easycommDoMoveLeft(EasycommDoMoveLeft *d);
24+
void easycommDoMoveRight(EasycommDoMoveRight *d);
25+
void easycommDoMoveUp(EasycommDoMoveUp *d);
26+
void easycommDoMoveDown(EasycommDoMoveDown *d);
27+
void easycommDoStopAzimuthMove(EasycommDoStopAzimuthMove *d);
28+
void easycommDoStopElevationMove(EasycommDoStopElevationMove *d);
2929
void easycommAcquisitionOfSignal(EasycommAcquisitionOfSignal *d);
3030
void easycommLossOfSignal(EasycommLossOfSignal *d);
31-
void easycommSetOutput(EasycommSetOutput *d);
32-
void easycommReadInput(EasycommReadInput *d);
33-
void easycommReadAnalogueInput(EasycommReadAnalogueInput *d);
31+
void easycommSetDigitalOutput(EasycommSetDigitalOutput *d);
32+
void easycommGetDigitalInput(EasycommGetDigitalInput *d);
33+
void easycommGetAnalogueInput(EasycommGetAnalogueInput *d);
3434
void easycommSetTime(EasycommSetTime *d);
35-
void easycommRequestVersion(EasycommRequestVersion *d);
36-
void easycommVelocityLeft(EasycommVelocityLeft *d);
35+
void easycommGetVersion(EasycommGetVersion *d);
36+
void easycommSetVelocityLeft(EasycommSetVelocityLeft *d);
3737
void easycommGetVelocityLeft(EasycommGetVelocityLeft *d);
38-
void easycommVelocityRight(EasycommVelocityRight *d);
38+
void easycommSetVelocityRight(EasycommSetVelocityRight *d);
3939
void easycommGetVelocityRight(EasycommGetVelocityRight *d);
40-
void easycommVelocityUp(EasycommVelocityUp *d);
40+
void easycommSetVelocityUp(EasycommSetVelocityUp *d);
4141
void easycommGetVelocityUp(EasycommGetVelocityUp *d);
42-
void easycommVelocityDown(EasycommVelocityDown *d);
42+
void easycommSetVelocityDown(EasycommSetVelocityDown *d);
4343
void easycommGetVelocityDown(EasycommGetVelocityDown *d);
44-
void easycommReadConfig(EasycommReadConfig *d);
45-
void easycommWriteConfig(EasycommWriteConfig *d);
44+
void easycommGetConfigRegister(EasycommGetConfigRegister *d);
45+
void easycommSetConfigRegister(EasycommSetConfigRegister *d);
4646
void easycommGetStatusRegister(EasycommGetStatusRegister *d);
4747
void easycommGetErrorRegister(EasycommGetErrorRegister *d);
48-
void easycommReset(EasycommReset *d);
49-
void easycommPark(EasycommPark *d);
48+
void easycommDoReset(EasycommDoReset *d);
49+
void easycommDoPark(EasycommDoPark *d);
5050

5151
#ifdef __cplusplus
5252
}

src/easycomm-parser-types-operators.h

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,54 +12,58 @@ extern "C"
1212
bool easycommPayloadEquals(const EasycommPayload *a, const EasycommPayload *b);
1313
bool easycommSingleLineEquals(const EasycommSingleLine *a, const EasycommSingleLine *b);
1414
bool easycommFrequencyEquals(const EasycommFrequency *a, const EasycommFrequency *b);
15-
bool easycommAzimuthEquals(const EasycommAzimuth *a, const EasycommAzimuth *b);
15+
bool easycommSetAzimuthEquals(const EasycommSetAzimuth *a, const EasycommSetAzimuth *b);
1616
bool easycommGetAzimuthEquals(const EasycommGetAzimuth *a, const EasycommGetAzimuth *b);
17-
bool easycommElevationEquals(const EasycommElevation *a, const EasycommElevation *b);
17+
bool easycommSetElevationEquals(const EasycommSetElevation *a, const EasycommSetElevation *b);
1818
bool easycommGetElevationEquals(const EasycommGetElevation *a, const EasycommGetElevation *b);
19-
bool easycommUplinkFrequencyEquals(const EasycommUplinkFrequency *a, const EasycommUplinkFrequency *b);
20-
bool easycommDownlinkFrequencyEquals(const EasycommDownlinkFrequency *a, const EasycommDownlinkFrequency *b);
21-
bool easycommUplinkModeEquals(const EasycommUplinkMode *a, const EasycommUplinkMode *b);
22-
bool easycommDownlinkModeEquals(const EasycommDownlinkMode *a, const EasycommDownlinkMode *b);
23-
bool easycommUplinkRadioNumberEquals(const EasycommUplinkRadioNumber *a, const EasycommUplinkRadioNumber *b);
24-
bool easycommDownlinkRadioNumberEquals(const EasycommDownlinkRadioNumber *a,
25-
const EasycommDownlinkRadioNumber *b);
26-
bool easycommMoveLeftEquals(const EasycommMoveLeft *a, const EasycommMoveLeft *b);
27-
bool easycommMoveRightEquals(const EasycommMoveRight *a, const EasycommMoveRight *b);
28-
bool easycommMoveUpEquals(const EasycommMoveUp *a, const EasycommMoveUp *b);
29-
bool easycommMoveDownEquals(const EasycommMoveDown *a, const EasycommMoveDown *b);
30-
bool easycommStopAzimuthMoveEquals(const EasycommStopAzimuthMove *a, const EasycommStopAzimuthMove *b);
31-
bool easycommStopElevationMoveEquals(const EasycommStopElevationMove *a, const EasycommStopElevationMove *b);
19+
bool easycommSetUplinkFrequencyEquals(const EasycommSetUplinkFrequency *a,
20+
const EasycommSetUplinkFrequency *b);
21+
bool easycommSetDownlinkFrequencyEquals(const EasycommSetDownlinkFrequency *a,
22+
const EasycommSetDownlinkFrequency *b);
23+
bool easycommSetUplinkModeEquals(const EasycommSetUplinkMode *a, const EasycommSetUplinkMode *b);
24+
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);
29+
bool easycommDoMoveLeftEquals(const EasycommDoMoveLeft *a, const EasycommDoMoveLeft *b);
30+
bool easycommDoMoveRightEquals(const EasycommDoMoveRight *a, const EasycommDoMoveRight *b);
31+
bool easycommDoMoveUpEquals(const EasycommDoMoveUp *a, const EasycommDoMoveUp *b);
32+
bool easycommDoMoveDownEquals(const EasycommDoMoveDown *a, const EasycommDoMoveDown *b);
33+
bool easycommDoStopAzimuthMoveEquals(const EasycommDoStopAzimuthMove *a, const EasycommDoStopAzimuthMove *b);
34+
bool easycommDoStopElevationMoveEquals(const EasycommDoStopElevationMove *a,
35+
const EasycommDoStopElevationMove *b);
3236
bool easycommAcquisitionOfSignalEquals(const EasycommAcquisitionOfSignal *a,
3337
const EasycommAcquisitionOfSignal *b);
3438
bool easycommLossOfSignalEquals(const EasycommLossOfSignal *a, const EasycommLossOfSignal *b);
35-
bool easycommSetOutputEquals(const EasycommSetOutput *a, const EasycommSetOutput *b);
36-
bool easycommReadInputEquals(const EasycommReadInput *a, const EasycommReadInput *b);
37-
bool easycommReadAnalogueInputEquals(const EasycommReadAnalogueInput *a, const EasycommReadAnalogueInput *b);
39+
bool easycommSetDigitalOutputEquals(const EasycommSetDigitalOutput *a, const EasycommSetDigitalOutput *b);
40+
bool easycommGetDigitalInputEquals(const EasycommGetDigitalInput *a, const EasycommGetDigitalInput *b);
41+
bool easycommGetAnalogueInputEquals(const EasycommGetAnalogueInput *a, const EasycommGetAnalogueInput *b);
3842
bool easycommSetTimeEquals(const EasycommSetTime *a, const EasycommSetTime *b);
39-
bool easycommRequestVersionEquals(const EasycommRequestVersion *a, const EasycommRequestVersion *b);
40-
bool easycommVelocityLeftEquals(const EasycommVelocityLeft *a, const EasycommVelocityLeft *b);
43+
bool easycommGetVersionEquals(const EasycommGetVersion *a, const EasycommGetVersion *b);
44+
bool easycommSetVelocityLeftEquals(const EasycommSetVelocityLeft *a, const EasycommSetVelocityLeft *b);
4145
bool easycommGetVelocityLeftEquals(const EasycommGetVelocityLeft *a, const EasycommGetVelocityLeft *b);
42-
bool easycommVelocityRightEquals(const EasycommVelocityRight *a, const EasycommVelocityRight *b);
46+
bool easycommSetVelocityRightEquals(const EasycommSetVelocityRight *a, const EasycommSetVelocityRight *b);
4347
bool easycommGetVelocityRightEquals(const EasycommGetVelocityRight *a, const EasycommGetVelocityRight *b);
44-
bool easycommVelocityUpEquals(const EasycommVelocityUp *a, const EasycommVelocityUp *b);
48+
bool easycommSetVelocityUpEquals(const EasycommSetVelocityUp *a, const EasycommSetVelocityUp *b);
4549
bool easycommGetVelocityUpEquals(const EasycommGetVelocityUp *a, const EasycommGetVelocityUp *b);
46-
bool easycommVelocityDownEquals(const EasycommVelocityDown *a, const EasycommVelocityDown *b);
50+
bool easycommSetVelocityDownEquals(const EasycommSetVelocityDown *a, const EasycommSetVelocityDown *b);
4751
bool easycommGetVelocityDownEquals(const EasycommGetVelocityDown *a, const EasycommGetVelocityDown *b);
48-
bool easycommReadConfigEquals(const EasycommReadConfig *a, const EasycommReadConfig *b);
49-
bool easycommWriteConfigEquals(const EasycommWriteConfig *a, const EasycommWriteConfig *b);
52+
bool easycommGetConfigRegisterEquals(const EasycommGetConfigRegister *a, const EasycommGetConfigRegister *b);
53+
bool easycommSetConfigRegisterEquals(const EasycommSetConfigRegister *a, const EasycommSetConfigRegister *b);
5054
bool easycommGetStatusRegisterEquals(const EasycommGetStatusRegister *a, const EasycommGetStatusRegister *b);
5155
bool easycommGetErrorRegisterEquals(const EasycommGetErrorRegister *a, const EasycommGetErrorRegister *b);
52-
bool easycommResetEquals(const EasycommReset *a, const EasycommReset *b);
53-
bool easycommParkEquals(const EasycommPark *a, const EasycommPark *b);
56+
bool easycommDoResetEquals(const EasycommDoReset *a, const EasycommDoReset *b);
57+
bool easycommDoParkEquals(const EasycommDoPark *a, const EasycommDoPark *b);
5458

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

5761
void easycommDataCopy(const EasycommData *from, EasycommData *to);
5862
void easycommPayloadCopy(const EasycommPayload *from, EasycommPayload *to);
5963
void easycommSingleLineCopy(const EasycommSingleLine *from, EasycommSingleLine *to);
6064
void easycommFrequencyCopy(const EasycommFrequency *from, EasycommFrequency *to);
61-
void easycommAzimuthCopy(const EasycommAzimuth *from, EasycommAzimuth *to);
62-
void easycommElevationCopy(const EasycommElevation *from, EasycommElevation *to);
65+
void easycommSetAzimuthCopy(const EasycommSetAzimuth *from, EasycommSetAzimuth *to);
66+
void easycommSetElevationCopy(const EasycommSetElevation *from, EasycommSetElevation *to);
6367

6468

6569
#ifdef __cplusplus

src/easycomm-parser-types-sprintf.h

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,44 @@ extern "C"
1010

1111
void easycommInvalidSprintf(const EasycommData *from, char *to);
1212
void easycommSingleLineSprintf(const EasycommSingleLine *from, char *to);
13-
void easycommAzimuthSprintf(const EasycommAzimuth *from, char *to);
13+
void easycommSetAzimuthSprintf(const EasycommSetAzimuth *from, char *to);
1414
void easycommGetAzimuthSprintf(const EasycommGetAzimuth *from, char *to);
15-
void easycommElevationSprintf(const EasycommElevation *from, char *to);
15+
void easycommSetElevationSprintf(const EasycommSetElevation *from, char *to);
1616
void easycommGetElevationSprintf(const EasycommGetElevation *from, char *to);
17-
void easycommUplinkFrequencySprintf(const EasycommUplinkFrequency *from, char *to);
18-
void easycommDownlinkFrequencySprintf(const EasycommDownlinkFrequency *from, char *to);
19-
void easycommUplinkModeSprintf(const EasycommUplinkMode *from, char *to);
20-
void easycommDownlinkModeSprintf(const EasycommDownlinkMode *from, char *to);
21-
void easycommUplinkRadioNumberSprintf(const EasycommUplinkRadioNumber *from, char *to);
22-
void easycommDownlinkRadioNumberSprintf(const EasycommDownlinkRadioNumber *from, char *to);
23-
void easycommMoveLeftSprintf(const EasycommMoveLeft *from, char *to);
24-
void easycommMoveRightSprintf(const EasycommMoveRight *from, char *to);
25-
void easycommMoveUpSprintf(const EasycommMoveUp *from, char *to);
26-
void easycommMoveDownSprintf(const EasycommMoveDown *from, char *to);
27-
void easycommStopAzimuthMoveSprintf(const EasycommStopAzimuthMove *from, char *to);
28-
void easycommStopElevationMoveSprintf(const EasycommStopElevationMove *from, char *to);
17+
void easycommSetUplinkFrequencySprintf(const EasycommSetUplinkFrequency *from, char *to);
18+
void easycommSetDownlinkFrequencySprintf(const EasycommSetDownlinkFrequency *from, char *to);
19+
void easycommSetUplinkModeSprintf(const EasycommSetUplinkMode *from, char *to);
20+
void easycommSetDownlinkModeSprintf(const EasycommSetDownlinkMode *from, char *to);
21+
void easycommSetUplinkRadioNumberSprintf(const EasycommSetUplinkRadioNumber *from, char *to);
22+
void easycommSetDownlinkRadioNumberSprintf(const EasycommSetDownlinkRadioNumber *from, char *to);
23+
void easycommDoMoveLeftSprintf(const EasycommDoMoveLeft *from, char *to);
24+
void easycommDoMoveRightSprintf(const EasycommDoMoveRight *from, char *to);
25+
void easycommDoMoveUpSprintf(const EasycommDoMoveUp *from, char *to);
26+
void easycommDoMoveDownSprintf(const EasycommDoMoveDown *from, char *to);
27+
void easycommDoStopAzimuthMoveSprintf(const EasycommDoStopAzimuthMove *from, char *to);
28+
void easycommDoStopElevationMoveSprintf(const EasycommDoStopElevationMove *from, char *to);
2929
void easycommAcquisitionOfSignalSprintf(const EasycommAcquisitionOfSignal *from, char *to);
3030
void easycommLossOfSignalSprintf(const EasycommLossOfSignal *from, char *to);
31-
void easycommSetOutputSprintf(const EasycommSetOutput *from, char *to);
32-
void easycommReadInputSprintf(const EasycommReadInput *from, char *to);
33-
void easycommReadAnalogueInputSprintf(const EasycommReadAnalogueInput *from, char *to);
31+
void easycommSetDigitalOutputSprintf(const EasycommSetDigitalOutput *from, char *to);
32+
void easycommGetDigitalInputSprintf(const EasycommGetDigitalInput *from, char *to);
33+
void easycommGetAnalogueInputSprintf(const EasycommGetAnalogueInput *from, char *to);
3434
void easycommSetTimeSprintf(const EasycommSetTime *from, char *to);
35-
void easycommRequestVersionSprintf(const EasycommRequestVersion *from, char *to);
36-
void easycommVelocityLeftSprintf(const EasycommVelocityLeft *from, char *to);
35+
void easycommGetVersionSprintf(const EasycommGetVersion *from, char *to);
36+
void easycommSetVelocityLeftSprintf(const EasycommSetVelocityLeft *from, char *to);
3737
void easycommGetVelocityLeftSprintf(const EasycommGetVelocityLeft *from, char *to);
38-
void easycommVelocityRightSprintf(const EasycommVelocityRight *from, char *to);
38+
void easycommSetVelocityRightSprintf(const EasycommSetVelocityRight *from, char *to);
3939
void easycommGetVelocityRightSprintf(const EasycommGetVelocityRight *from, char *to);
40-
void easycommVelocityUpSprintf(const EasycommVelocityUp *from, char *to);
40+
void easycommSetVelocityUpSprintf(const EasycommSetVelocityUp *from, char *to);
4141
void easycommGetVelocityUpSprintf(const EasycommGetVelocityUp *from, char *to);
42-
void easycommVelocityDownSprintf(const EasycommVelocityDown *from, char *to);
42+
void easycommSetVelocityDownSprintf(const EasycommSetVelocityDown *from, char *to);
4343
void easycommGetVelocityDownSprintf(const EasycommGetVelocityDown *from, char *to);
44-
void easycommReadConfigSprintf(const EasycommReadConfig *from, char *to);
45-
void easycommWriteConfigSprintf(const EasycommWriteConfig *from, char *to);
44+
void easycommGetConfigRegisterSprintf(const EasycommGetConfigRegister *from, char *to);
45+
void easycommSetConfigRegisterSprintf(const EasycommSetConfigRegister *from, char *to);
4646
void easycommGetStatusRegisterSprintf(const EasycommGetStatusRegister *from, char *to);
4747
void easycommGetErrorRegisterSprintf(const EasycommGetErrorRegister *from, char *to);
4848
void easycommDataSprintf(const EasycommData *from, char *to);
49-
void easycommResetSprintf(const EasycommReset *from, char *to);
50-
void easycommParkSprintf(const EasycommPark *from, char *to);
49+
void easycommDoResetSprintf(const EasycommDoReset *from, char *to);
50+
void easycommDoParkSprintf(const EasycommDoPark *from, char *to);
5151

5252
#ifdef __cplusplus
5353
}

0 commit comments

Comments
 (0)