fixed erros, does compile now

main
Jonas Arnold 4 years ago
parent 1ecec3620a
commit 967bcc481b
  1. 4
      ADIS_ESP32_Eclipse/main/challenge_com.c
  2. 16
      ADIS_ESP32_Eclipse/main/splitflap_wrapper.c
  3. 2
      ADIS_ESP32_Eclipse/main/splitflap_wrapper.h

@ -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){

@ -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;
}

@ -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 <hwId> of a splitflap with <id> in the combination
* returns true when successful, false when not (e.g. split flap with given id not available) */

Loading…
Cancel
Save