Code Examples.
More...
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];
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);
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;
}