Main Page | Data Structures | File List | Data Fields | Globals

commands.h

Go to the documentation of this file.
00001 #ifndef COMMANDS_H 00002 #define COMMANDS_H 00003 00017 // 00018 // Command action function prototypes, see commands.c for the implementation 00019 // 00020 00021 // Common interactive client commands 00022 00023 int cmd_quit (char *, MsgType, char *); // quit the application 00024 int cmd_ping (char *, MsgType, char *); // ping (comm handshake request) 00025 int cmd_pong (char *, MsgType, char *); // pong (comm handshake acknowledge) 00026 int cmd_info (char *, MsgType, char *); // return client application info 00027 int cmd_version(char *, MsgType, char *); // return version info 00028 int cmd_verbose(char *, MsgType, char *); // toggle verbose mode 00029 int cmd_debug (char *, MsgType, char *); // toggle debug (superverbose) mode 00030 int cmd_help (char *, MsgType, char *); // show command help 00031 int cmd_history(char *, MsgType, char *); // cli history utility 00032 int cmd_status (char *, MsgType, char *); // client STATUS command 00033 00034 // Barcode reader commands 00035 00036 int cmd_read (char *, MsgType, char *); // read a barcode 00037 int cmd_send (char *, MsgType, char *); // send a raw barcode reader command 00038 int cmd_query (char *, MsgType, char *); // send a raw barcode reader query 00039 int cmd_ports (char *, MsgType, char *); // show current reader comm ports 00040 int cmd_setto (char *, MsgType, char *); // set/query reader comm timeout 00041 int cmd_reset (char *, MsgType, char *); // reset runtime params 00042 00043 // Application command/action structure 00044 00050 struct Commands { 00051 char *cmd; 00052 00079 int(* action)(char *args, MsgType msgtype, char *reply); 00080 } 00081 cmdtab[] = { 00082 {"read" ,cmd_read }, 00083 {"send" ,cmd_send }, 00084 {"query" ,cmd_query }, 00085 {"ports" ,cmd_ports }, 00086 {"status" ,cmd_status }, 00087 {"timeout" ,cmd_setto }, 00088 {"reset" ,cmd_reset }, 00089 {"quit" ,cmd_quit }, 00090 {"info" ,cmd_info }, 00091 {"verbose" ,cmd_verbose }, 00092 {"version" ,cmd_version }, 00093 {"debug" ,cmd_debug }, 00094 {"help" ,cmd_help }, 00095 {"?" ,cmd_help }, // ? is an alias for help 00096 {"history" ,cmd_history }, 00097 {"ping" ,cmd_ping }, 00098 {"pong" ,cmd_pong } 00099 }; 00100 00101 // Number of commands defined (so we don't have to count correctly) 00102 00103 int NumCommands = sizeof(cmdtab)/sizeof(struct Commands); 00104 00105 // command function return codes 00106 00107 #define CMD_OK 0 00108 #define CMD_ERR -1 00109 #define CMD_NOOP 1 00110 00111 #endif // COMMANDS_H

Generated on Thu Jul 22 20:10:48 2004 for Barcode Reader Agent by doxygen 1.3.7