示例#1
0
// ----------------------------------------------------------------------------
// Main function
// ----------------------------------------------------------------------------
static void loop(os_event_t *events)
{
    char cmd;
    if(kbhit())  {
       os_printf("\n>");
       cmd = getch();
       stdoutPutchar(cmd);  // echo back
       stdoutPutchar('\n');  // CR
       command(cmd);
    }
    system_os_post(user_procTaskPrio, 0, 0 );
}
void onWsMessage(WSConnection *connection, const WSFrame *message) {
    for (int i = 0; i < message->payloadLength; i++) {
        stdoutPutchar(message->payloadData[i]);
    }
    stdoutPutchar('\n');
}