Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
teoterm.c

Teonet terminal custom command

This examples shows how to add custom command to the Teonet terminal

Created on July 27, 2015, 3:56 PM

#include <stdio.h>
#include <stdlib.h>
#include "ev_mgr.h"
#define TTERM_VERSION VERSION
int cmd_user(struct cli_def *cli, const char *command, char *argv[], int argc) {
cli_print(cli, "User command executed\r\n");
return CLI_OK;
}
size_t data_len, void *user_data) {
switch(event) {
// Calls immediately after event manager starts
{
// Tunnel parameters message
printf("The terminal server command 'user' was added\n");
cli_register_command(ke->cli, NULL, "user", cmd_user,
"Show list of teonet peers");
}
break;
default:
break;
}
}
int main(int argc, char** argv) {
printf("Teoterm example ver " TTERM_VERSION "\n");
// Initialize teonet event manager and Read configuration
// Start teonet
return 0;
}