651 char endMarker =
'\n';
652 boolean newRxMsg =
false;
666 if (Serial.available() > 0 &&
false == newRxMsg ){
668 bufferChr = Serial.read();
675 Serial.clearReadError();
679 if (bufferChr == endMarker){
684 }
while (Serial.available() > 0 &&
false == newRxMsg);
690 char cmd[128], param[128],param2[128];
694 if (strncmp(cmd,
"LS",
sizeof(cmd)) == 0){
696 }
else if (strncmp(cmd,
"GET",
sizeof(cmd)) == 0){
698 }
else if (strncmp(cmd,
"ACON",
sizeof(cmd)) == 0){
702 Serial.println(F(
"M ACON START"));
707 Serial.println(csBuffer);
709 Serial.println(F(
"M ACON END"));
711 }
else if (strncmp(cmd,
"CONNECT",
sizeof(cmd)) == 0){
715 total_read = sscanf(
p_received_chars,
"%127s %127s %d %127s %d" , cmd, param,&source_port,param2,&dest_port);
717 Serial.print(F(
"M CONNECT WRONG PARAM COUNT "));
720 ad->
connect(param,source_port,param2,dest_port);
722 }
else if (strncmp(cmd,
"DISCONNECT",
sizeof(cmd)) == 0){
724 total_read = sscanf(
p_received_chars,
"%127s %127s %d" , cmd, param,&dest_port);
726 Serial.print(F(
"M DISCONNECT WRONG PARAM COUNT "));
730 Serial.printf(F(
"M DISCONNECTED %s %d\n"),param,dest_port);
732 Serial.printf(F(
"M FAILED DISCONNECT OF %s %d\n"),param,dest_port);
735 }
else if (strncmp(cmd,
"AA",
sizeof(cmd)) == 0){
737 }
else if (strncmp(cmd,
"APC",
sizeof(cmd)) == 0){
740 }
else if (strncmp(cmd,
"STATS",
sizeof(cmd)) == 0){
744 }
else if (strncmp(cmd,
"CQT_CFG",
sizeof(cmd)) == 0){
746 }
else if (strncmp(cmd,
"GET_DD",
sizeof(cmd)) == 0){
748 }
else if (strncmp(cmd,
"GET_WREN_SCRIPT",
sizeof(cmd)) == 0){
751 println(
"#WREN_START!");
752 println(g_wrenScript);
753 println(
"#WREN_EOF!");
756 }
else if (strncmp(cmd,
"WREN_SCRIPT_START",
sizeof(cmd)) == 0){
758 }
else if (strncmp(cmd,
"WREN_SCRIPT_COMPILE",
sizeof(cmd)) == 0){
760 }
else if (strncmp(cmd,
"WREN_SCRIPT_EXECUTE",
sizeof(cmd)) == 0){
762 }
else if (strncmp(cmd,
"WREN_SCRIPT_SAVE",
sizeof(cmd)) == 0){
764 }
else if (strncmp(cmd,
"UPDATE_DD",
sizeof(cmd)) == 0){
766 }
else if (strncmp(cmd,
"HELO",
sizeof(cmd)) == 0){
771 }
else if (strncmp(cmd,
"GET_RAM",
sizeof(cmd)) == 0){
774 num = strtol(param,NULL,10);
776 Serial.printf(
"M GET_RAM {\"addr\":\"%08X\",\"data\":\"%02X\"}\n",num,(uint8_t)*mp);
777 }
else if (strncmp(cmd,
"GET_RAM2",
sizeof(cmd)) == 0){
779 }
else if (strncmp(cmd,
"GET_RAM1",
sizeof(cmd)) == 0){
781 }
else if (strncmp(cmd,
"AUDIO_NO_INTERRUPTS",
sizeof(cmd)) == 0){
783 }
else if (strncmp(cmd,
"AUDIO_INTERRUPTS",
sizeof(cmd)) == 0){
789 #ifdef SERIAL_AUTO_TRANSMIT_DATA_PERIODICALLY
virtual void messageHandler(AppBaseClass *sender, const char *message)
receiver method for inter-app string based communication
AppBaseClass * getAppByName(const char *appName)
Get the App pointer By Name. Returns NULL if not found.
bool sendMessage(AppBaseClass *sender, const char *to_app, const char *message)
provides an interface for apps to send messages to other apps
static AppManager * getInstance()
void printStats()
prints out some stats in JSON format to the serial port
AppBaseClass * getActiveApp()
provides an interface for apps to request the active app object
bool getConnectionString(uint16_t connectionIndex, char *connectionStringBuffer)
bool disconnect(AudioStream *destination, int destinationInput)
bool connect(AudioStream *source, int sourceOutput, AudioStream *destination, int destinationInput)
void printDictionary(SvcSerialCommandInterface *sci)
prints the dictionary to the SvcSerialCommandInterface
bool requestStartLZ4Message()
request to start a lz4 compressed message starts the message and returns true if available returns f...
bool throttle()
returns true if the available serial buffer falls below SERIAL_THROTTLE_BUFFER_REMAINING_THRESHOLD if...
void messageHandler_WREN_SCRIPT_START()
bool is_periodic_messages_enabled
void messageHandler_WREN_SCRIPT_SAVE()
void messageHandler_GET_RAM2()
void streamTransmitHandler()
void messageHandler_WREN_SCRIPT_EXECUTE()
void messageHandler_UPDATE_DD()
void streamReceiveHandler()
void messageHandler_WREN_SCRIPT_COMPILE()
bool is_capturing_bulk_data
elapsedMillis et_since_periodic_stats_tx
elapsedMillis et_since_periodic_data_dict_tx
void messageHandler_GET_RAM1()
void sendLZ4Message()
Calling this function signals the end of a compressed message. The txBuffer contents are lz4 compres...
void messageHandler_GET()
const char * gWelcomeMessage