added buzzer sound when parsed @esp message on udp server

main
Jonas Arnold 4 years ago
parent 09c197e5e9
commit 65f0029ac7
  1. 2
      ADIS_ESP32_Eclipse/main/udp_server.c

@ -42,6 +42,7 @@ static int SendToSocket(int sock, const char *msg, const struct sockaddr *to, so
void HandleIncomingUdpMessage(const char *rxMsg, int sock, struct sockaddr *source_addr_p, socklen_t source_addr_len) {
unsigned char response[128];
unsigned char responseRobot[128];
int err;
unsigned char espMsg[McuShell_DEFAULT_SHELL_BUFFER_SIZE] = "";
const char espMsgPrefix[] = "@esp:";
@ -57,6 +58,7 @@ void HandleIncomingUdpMessage(const char *rxMsg, int sock, struct sockaddr *sour
for(int i = 0; i < strLen-McuUtility_strlen(espMsgPrefix)-McuUtility_strlen(espMsgPostfix); i++){
espMsg[i] = rxMsg[i + McuUtility_strlen(espMsgPrefix)];
}
SHELL_SendToRobotAndGetResponse((const unsigned char*)"buzzer buz 100 200", responseRobot, sizeof(responseRobot)); // accoustic feedback to acknowledge the command
SHELL_SendToESPAndGetResponse(espMsg, response, sizeof(response));
} else {
McuUtility_strcpy(response, sizeof(response), (unsigned char*)"!missing!");

Loading…
Cancel
Save