Problem with sending more than one character

I am a beginner doing projects with TTN Currently I am working with Microchip SAMR34.I was trying to do a project where it reads the entered number and dsiplays it, The enetred number can be seen using an Emulator. I have used TeraTerm for this purpose.

The serial Data handler given in the example Project reads only one character, I have modified the code in such a way it reads more than one character at a time. The value received is stored int to a buffer SerialBuffer, But once number is entered for join request, its stops the application process and doesnot moves further.

The code given below is from the example project:

static char SerialBuffer;

void serial_data_handler(void)
{
  int rxChar;
  char serialData;
  /* verify if there was any character received*/
  if (startReceiving == true) {
    if((-1) != (rxChar = sio2host_getchar_nowait())) {
      serialData = (char)rxChar;
      if((serialData != ‘\r’) && (serialData != ‘\n’) && (serialData != ‘\b’)) {
        startReceiving = false;
        serialBuffer = rxChar;
        appPostTask(PROCESS_TASK_HANDLER);
        printf("\r\n");
      }
    }
  }
}

what i have tried: But it is not working !

void serial_data_handler(void)
{
  // uint8_t rxChar;
  char serialData;
  char arr[10];
  char recv;
  int i = 0;
  int value;

  recv = 0x00;

  /* verify if there was any character received*/
  if (startReceiving == true) {
    while(('\n' != recv)&&('\r' != recv) && ('\b' != recv)) {
      recv = sio2host_getchar();
      arr[i] = recv;
      i++;      
    }
    //startReceiving = false;
    value =(int)atoi(arr);
    serialBuffer = value;
    appPostTask(PROCESS_TASK_HANDLER);
  }
}

if anyone has any idea, please share . It would be a great help!

maybe place a link to the original source ?

ATSAMR34_APPS_ENDDEVICE_P2P_DEMO

[666]

APPS_ENDDEVICE_DEMO1
ATSAMR34 Mote Application
I have added twoextra task handlers within the projects to display and process the transmoit data.
static SYSTEM_TaskStatus_t displayTask(void)
{
switch(appTaskState)
{
case RESTORE_BAND_STATE:
displayRunRestoreBand();
break;
case DEMO_CERT_APP_STATE:
displayRunDemoCertApp();
break;
case DEMO_APP_STATE:
displayRunDemoApp();
break;
case JOIN_SEND_STATE:
displayJoinAndSend();
break;
case TRANSMIT_DATA_STATE:
displaytransmitData();
break;
default:
printf(“Error STATE Entered\r\n”);
break;
}

return SYSTEM_TASK_SUCCESS;

}
static SYSTEM_TaskStatus_t processTask(void)
{
switch(appTaskState)
{
case RESTORE_BAND_STATE:
processRunRestoreBand();
break;
case DEMO_CERT_APP_STATE:
processRunDemoCertApp();
break;
case DEMO_APP_STATE:
processRunDemoApp();
break;
case JOIN_SEND_STATE:
processJoinAndSend();
break;
case TRANSMIT_DATA_STATE:
processtransmitData();
break;
default:
printf(“Error STATE Entered\r\n”);
break;
}

return SYSTEM_TASK_SUCCESS;

}

static void displaytransmitData(void)
{
printf("\r\nEnter the number to be transmitted: ");
set_LED_data(LED_AMBER, &off);
set_LED_data(LED_GREEN, &off);
startReceiving = true;
//appTaskState = TRANSMIT_DATA_STATE;
//appPostTask(PROCESS_TASK_HANDLER);

}
static void processtransmitData(void)
{

TransmitData();

}
static void TransmitData(void)
{
printf(" \r\nThe entered number is: %c", serialBuffer);
appTaskState = JOIN_SEND_STATE;
appPostTask(DISPLAY_TASK_HANDLER);
}

yes I found the github in the google cache :sunglasses:, but what is the relation with TTN ?

Kind of similar data need to be transferred via Lora

Which LoRa device, most TTN compatible LoRa devices don’t transfer data via Serial ?

@Lora Tracker : ATSAMR4 with Multitech

Hallo, I found the solution for the problem. The similar example code is provided by Atmel SAMR34 serial provisioning with Lora