#include "dev/serial-line.h"
PROCESS(gas_client, "GAS Client Process");
AUTOSTART_PROCESSES(&gas_client);
/*----------------------------------------------------------------------------*/
PROCESS_THREAD(gas_client, ev, data)
{
PROCESS_BEGIN();
// bootup();
// printf("Welcome to GAS Client process!\n");
uint8_t command_str[10] = {'\0'};
// uint8_t contents[10] = {'\0'};
while(1) {
PROCESS_WAIT_EVENT_UNTIL(ev == serial_line_event_message && data != NULL);
strcpy( command_str, (uint8_t *) data);
printf( "\nReceived command %s", command_str);
// if (strncmp(command_str, ADDR_C, 2) == 0) {
// }
// strcpy(command_str, "");
}
PROCESS_END();
}
Terminal1:
echo "hello" > /dev/ttyUSB4
Terminal2:
make login
Received command hello
No comments:
Post a Comment