Code Examples.
Code Examples.
The following structure describes about the function:
typedef struct ClDebugFuncEntry {
ClCharT funcName[CL_DEBUG_FUNC_NAME_LENGTH];
ClCharT funcHelp[CL_DEBUG_FUNC_HELP_LENGTH];
ClRcT(* ClDebugCallbackT)(ClUint32T argc, ClCharT **argv, ClCharT **ret)
This is the signature of the callback invoked by the debug CLI in response to a command entered.
Definition: clDebugApi.h:249
struct ClDebugFuncEntryT ClDebugFuncEntryT
The structure contains the entry for the debug CLI information that needs the component has to provid...
When the component registers with the debug gateway, the gateway becomes aware of the component. Thus when the user requests for a list of available components, all registered components are displayed. When the component comes up, it registers its debug APIs with the debug object. This API is as follows:
typedef struct ClDebugModEntry {
ClCharT modName[80];
ClCharT modPrompt[20];
ClCharT help[80];
struct clEoExecutionObj* pEoObj,
ClCharT* compName,
ClCharT* compPrompt,
ClUint32T funcArrayLen);
ClUint32T ClRcT
Clovis return code type.
Definition: clCommon.h:168
struct ClDebugModEntryT ClDebugModEntryT
This structure is used to register the module with the CLI library.
ClRcT clDebugRegister(CL_IN ClDebugFuncEntryT *funcArray, CL_IN ClUint32T funcArrayLen, CL_OUT ClHandleT *phDebugReg)
Registers the component name.
The structure contains the entry for the debug CLI information that needs the component has to provid...
Definition: clDebugApi.h:270
This is called on a per instance basis. This makes the debug object in the EO aware of the debug capabilities of the installed component. There are corresponding deregister functions provided for both the functions above.
Following are the example of how to register commands with the CLI framework:
clDbgCmd1Func(int argc, char **argv, ClCharT **ret)
{
{
clLogError("EXP","DBG", "Debug print init Failed.");
return rc;
}
if(2 != argc)
{
"\bUsage: clDbgCmd1 <Your Name>\n");
{
clLogError("EXP","DBG", "Debug print Failed.");
return rc;
}
}
{
clLogError("EXP","DBG", "Debug print Failed.");
return rc;
}
{
clLogError("EXP","DBG", "Debug print finalize Failed.");
return rc;
}
return rc;
}
clDbgCmd2Func(int argc, char **argv, ClCharT **ret)
{
ClUint32T id = 0;
{
clLogError("EXP","DBG", "Debug print init Failed.");
return rc;
}
if(3 != argc)
{
"\bUsage: clDbgCmd2 <Your Name> <Your ID>\n");
{
clLogError("EXP","DBG", "Debug print Failed.");
return rc;
}
}
id = atoi(argv[2]);
argv[1], id);
{
clLogError("EXP","DBG", "Debug print Failed.");
return rc;
}
{
clLogError("EXP","DBG", "Debug print finalize Failed.");
return rc;
}
return rc;
}
{
"clDbgCmd1",
"DebugCommand : One"
},
{
"clDbgCmd2",
"DebugCommand : Two"
}
};
sizeof(clRegisterCmdFuncs) /
sizeof(clRegisterCmdFuncs[0]),
{
clLogError("EXP","DBG", "Command registration Failed.");
return rc;
}
#define CL_OK
Every thing is OK.
Definition: clCommonErrors.h:68
ClRcT clDebugPrint(CL_INOUT ClDebugPrintHandleT msg, CL_IN const char *fmtStr,...) CL_PRINTF_FORMAT(2
Prints a string into the handle.
ClRcT clDebugPrintInitialize(CL_OUT ClDebugPrintHandleT *msg)
Retrieve a handle for printing.
ClRcT ClRcT clDebugPrintFinalize(CL_IN ClDebugPrintHandleT *msg, CL_OUT char **buf)
Cleans up the print handle.
ClPtrT ClDebugPrintHandleT
The type of the handle clDebugPrint APIs.
Definition: clDebugApi.h:312
#define CL_HANDLE_INVALID_VALUE
Defines.
Definition: clHandleApi.h:95