#include "eripcclient.h"
Go to the source code of this file.
Enumerations | |
enum | eCcBusy { ccBusySetBusy = 0, ccBusyUndefined } |
enum | eCcBusyState { ccBusyState_Off = 0, ccBusyState_Blink, ccBusyState_On, ccBusyState_Shutdown, ccBusyState_Undefined } |
Functions | |
int | busyParseCommand (char *szCommand, erIpcCmd_t *pCmd) |
int | busySetBusy (erClientChannel_t channel, eCcBusyState busy) |
<File description>="">
Definition in file eripcbusyd.h.
enum eCcBusy |
Definition at line 41 of file eripcbusyd.h.
00041 { 00042 ccBusySetBusy = 0, 00043 ccBusyUndefined 00044 } eCcBusy;
enum eCcBusyState |
ccBusyState_Off | |
ccBusyState_Blink | |
ccBusyState_On | |
ccBusyState_Shutdown | |
ccBusyState_Undefined |
Definition at line 46 of file eripcbusyd.h.
00046 { 00047 ccBusyState_Off = 0, 00048 ccBusyState_Blink, 00049 ccBusyState_On, 00050 ccBusyState_Shutdown, 00051 ccBusyState_Undefined 00052 } eCcBusyState;
int busyParseCommand | ( | char * | szCommand, | |
erIpcCmd_t * | pCmd | |||
) |
Definition at line 54 of file eripcbusyd.c.
00055 { 00056 int i; 00057 char *pChar; 00058 char szToken[TB_MAXCHARONLINE]; 00059 int nReqArgs = 0; 00060 00061 pCmd->cc = (int) ccBusyUndefined; 00062 for (i = 0; i < TB_N_ARG; i++) 00063 { 00064 strcpy(pCmd->arg[i], ""); 00065 } 00066 00067 // Parse Command 00068 pChar = szCommand; 00069 i = 0; 00070 while (*pChar != '\0') 00071 { 00072 szToken[i] = '\0'; 00073 if (*pChar == ',') 00074 { 00075 pChar++; 00076 break; 00077 } 00078 szToken[i] = *pChar++; 00079 i++; 00080 szToken[i] = '\0'; 00081 } 00082 00083 // We have found the command Token. Figure out what the command is. 00084 00085 // TODO: stop doing this hardcoded, rely on a smart datastructure instead. 00086 00087 if (!strcmp(szToken, "busySetBusy") || !strcmp(szToken, "0")) 00088 { 00089 strcpy(pCmd->name, szToken); 00090 pCmd->cc = (int) ccBusySetBusy; 00091 nReqArgs = 1; 00092 pCmd->nArg = 1; 00093 } 00094 else 00095 { 00096 strcpy(pCmd->name, "Undefined"); 00097 pCmd->cc = (int) ccBusyUndefined; 00098 fprintf(stderr, "%s: Command %s \n", __FUNCTION__, szToken); 00099 fprintf(stderr, "Error parsing (%s). Command undefined\n", szCommand); 00100 pCmd->nArg = -1; 00101 return -1; 00102 } 00103 00104 if (nReqArgs > 0) 00105 { 00106 erIpcGetArgs(pChar, pCmd, nReqArgs); 00107 } 00108 return 0; 00109 }
int busySetBusy | ( | erClientChannel_t | channel, | |
eCcBusyState | busy | |||
) |
Copyright (C) 2005-2008 iRex Technologies B.V. All rights reserved.
Definition at line 39 of file eripcbusyd.c.
00040 { 00041 erIpcCmd_t cmd; 00042 00043 strcpy(cmd.name, "busySetBusy"); 00044 cmd.cc = (int) ccBusySetBusy; 00045 cmd.nArg = 1; 00046 sprintf(cmd.arg[0], "%d", busy); 00047 00048 return erIpcSndCommand(channel, &cmd); 00049 }