(Page 1 of 1 in this chapter) Version
svcargs.args element of the CTA_SERVICE_DESC structure, as explained in the following table:
[ctasys] Service = adi, adimgr Service = hmi, hmimgr # trace the HM API TraceMask = 0 StartWebServer = 1 # Change to 0 to disable ctdaemon web server. StartTraceServer = 1 # Change to 0 to disable ctdaemon trace server. HttpPort = 1100 # TCP/IP port for web server. TracePort = 1101 # TCP/IP port for trace server. TraceMaxControllers = 1 # Num. clients allowed to set tracemask. TraceMaxMonitors = 10 # Num. clients allowed to monitor trace msgs. [ctapar] [eof]
event and value fields of the CT Access CTA_EVENT structure. Here is a complete table of the possible events:
Ret = ctaCreateQueue( NULL, 0, &FstQueue );
Ret = ctaCreateContext( FstQueue, 0, NULL, &CtaHd[0] );
Ret = ctaCreateContext( FstQueue, 0, NULL, &CtaHd[1] );
Ret = ctaCreateContext( FstQueue, 0, NULL, &CtaHd[2] );
hmiOpenSvcLst[0].svcargs.args[0] = (DWORD)(1);
hmiOpenSvcLst[0].svcargs.args[1] = 1; /* board */
hmiOpenSvcLst[0].svcargs.args[2] = HMI_DO_COMMANDS; /* synchronous */
Ret = ctaOpenServices( CtaHd[0], &hmiOpenSvcLst[0], 1 );
/* Wait for service open to complete. */
hmiTstWaitForEventWithReason( FstQueue, CTAEVN_OPEN_SERVICES_DONE, CTA_REASON_FINISHED );
hmiOpenSvcLst[0].svcargs.args[0] = (DWORD)(2);
hmiOpenSvcLst[0].svcargs.args[1] = 2; /* board */
hmiOpenSvcLst[0].svcargs.args[2] = HMI_DO_COMMANDS; /* synchronous */
Ret = ctaOpenServices( CtaHd[1], &hmiOpenSvcLst[0], 1 );
/* Wait for service open to complete. */
hmiTstWaitForEventWithReason( FstQueue, CTAEVN_OPEN_SERVICES_DONE, CTA_REASON_FINISHED );
hmiOpenSvcLst[0].svcargs.args[0] = (DWORD)(3);
hmiOpenSvcLst[0].svcargs.args[1] = HMI_EVENTS_ALL_BOARDS; /* board */
hmiOpenSvcLst[0].svcargs.args[2] = HMI_RCV_EVENTS; /* asynchronous */Ret = ctaOpenServices( CtaHd[2], &hmiOpenSvcLst[0], 1 );
/* Wait for service open to complete. */
hmiTstWaitForEventWithReason( FstQueue, CTAEVN_OPEN_SERVICES_DONE, CTA_REASON_FINISHED );
/*
* Wait for events until the ticker on all context is done.
*/
stop = 0;
while ( !stop )
{
hmiTstWaitForEvent( FstQueue, &Event, CTA_WAIT_FOREVER );
printf("Received event %x from board %d\n", Event.id, Event.value );
if (Event.id == HMI_EVN_SERVICE_DOWN)
stop = TRUE;
}
Figure 4. Relationship Between CT Access Queues/Contexts and HMI Service
(Page 1 of 1 in this chapter) Version