From 967bcc481b02f51c52bfcd18e50d937f0ca29992 Mon Sep 17 00:00:00 2001 From: Jonas Arnold Date: Tue, 6 Dec 2022 18:27:05 +0100 Subject: [PATCH] fixed erros, does compile now --- ADIS_ESP32_Eclipse/main/challenge_com.c | 4 ++-- ADIS_ESP32_Eclipse/main/splitflap_wrapper.c | 16 ++++++++-------- ADIS_ESP32_Eclipse/main/splitflap_wrapper.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ADIS_ESP32_Eclipse/main/challenge_com.c b/ADIS_ESP32_Eclipse/main/challenge_com.c index 381d257..6a30fd4 100644 --- a/ADIS_ESP32_Eclipse/main/challenge_com.c +++ b/ADIS_ESP32_Eclipse/main/challenge_com.c @@ -76,9 +76,9 @@ void Challenge_Com_ParseMqtt(void *handler_args, esp_event_base_t base, int32_t else if(McuUtility_strcmp((char*)event->topic, MQTT_TOPIC_SF_DISPLAY)==0){ handled = true; // parse json - char message[] = "TST"; + unsigned char message[] = "TST"; struct json_attr_t json_attrs[] = { - {"message", t_string, .addr.string = message}, + {"message", t_string, .addr.string = (char*)message}, {NULL}, }; if(json_read_object(event->data, json_attrs, NULL) != 0){ diff --git a/ADIS_ESP32_Eclipse/main/splitflap_wrapper.c b/ADIS_ESP32_Eclipse/main/splitflap_wrapper.c index 7a5587b..d9bd838 100644 --- a/ADIS_ESP32_Eclipse/main/splitflap_wrapper.c +++ b/ADIS_ESP32_Eclipse/main/splitflap_wrapper.c @@ -20,19 +20,19 @@ * If all splitflaps report to be initialized before the timeout, the return value is true */ bool SplitFlap_Wrapper_MoveAllToZeroPosition(void){ unsigned char cmd[BUF_SIZE] = RS_CMD_PREFIX; - McuUtility_strcat(cmd, sizeof(cmd), "initAll"); - McuShell_SendStr(buf, McuShell_GetStdio()->stdOut); + McuUtility_strcat(cmd, sizeof(cmd), (unsigned char*)"initAll"); + McuShell_SendStr(cmd, McuShell_GetStdio()->stdOut); return true; } /* display a sentence on the splitflap combination * splitflaps must be initialized to be able to display something! * returns true when all movements finished */ -bool SplitFlap_Wrapper_Display(char *sentence){ +bool SplitFlap_Wrapper_Display(unsigned char *sentence){ unsigned char cmd[BUF_SIZE] = RS_CMD_PREFIX; - McuUtility_strcat(cmd, sizeof(cmd), "Display "); + McuUtility_strcat(cmd, sizeof(cmd), (unsigned char*)"Display "); McuUtility_strcat(cmd, sizeof(cmd), sentence); - McuShell_SendStr(buf, McuShell_GetStdio()->stdOut); + McuShell_SendStr(cmd, McuShell_GetStdio()->stdOut); return true; } @@ -43,10 +43,10 @@ bool SplitFlap_Wrapper_SetHardwareIdentifier(uint8_t id, uint8_t hwId){ unsigned char setupId_str[4] = {0}; unsigned char hardwareId_str[4] = {0}; McuUtility_Num8uToStr(setupId_str, sizeof(setupId_str), id); McuUtility_Num8uToStr(hardwareId_str, sizeof(hardwareId_str), hwId); - McuUtility_strcat(cmd, sizeof(cmd), "setId "); + McuUtility_strcat(cmd, sizeof(cmd), (unsigned char*)"setId "); McuUtility_strcat(cmd, sizeof(cmd), setupId_str); - McuUtility_strcat(cmd, sizeof(cmd), " "); + McuUtility_strcat(cmd, sizeof(cmd), (unsigned char*)" "); McuUtility_strcat(cmd, sizeof(cmd), hardwareId_str); - McuShell_SendStr(buf, McuShell_GetStdio()->stdOut); + McuShell_SendStr(cmd, McuShell_GetStdio()->stdOut); return true; } diff --git a/ADIS_ESP32_Eclipse/main/splitflap_wrapper.h b/ADIS_ESP32_Eclipse/main/splitflap_wrapper.h index 83a9cdf..42b38e6 100644 --- a/ADIS_ESP32_Eclipse/main/splitflap_wrapper.h +++ b/ADIS_ESP32_Eclipse/main/splitflap_wrapper.h @@ -19,7 +19,7 @@ bool SplitFlap_Wrapper_MoveAllToZeroPosition(void); /* display a sentence on the splitflap combination * splitflaps must be initialized to be able to display something! * returns true when all movements finished */ -bool SplitFlap_Wrapper_Display(char sentence[]); +bool SplitFlap_Wrapper_Display(unsigned char sentence[]); /* sets the hardware identifier of a splitflap with in the combination * returns true when successful, false when not (e.g. split flap with given id not available) */