module ti.uia.sysbios.Adaptor

Single core IServiceMgrSupport implementation

This module implements the IServiceMgrSupport interface and is used by the ServiceMgr on single cores. This module routes UIA data between the instrumentation host and the services via the Transport implementations. It maintains lists of free events and contrl message buffers via BIOS Semaphores and Queues. [ more ... ]
C synopsis target-domain sourced in ti/uia/sysbios/Adaptor.xdc
DETAILS
This module implements the IServiceMgrSupport interface and is used by the ServiceMgr on single cores. This module routes UIA data between the instrumentation host and the services via the Transport implementations. It maintains lists of free events and contrl message buffers via BIOS Semaphores and Queues.
There is a Transfer Agent task (transferAgentTaskFxn). This task sends data to the instrumentation host. This task uses the ServiceMgr.transportFxns functions communicate to the host. These functions are setup by default based on the device.
If ti.uia.runtime.ServiceMgr.supportControl is true, this module also creates the Receive Task (rxTaskFxn). The Receive Task receives control messages from the instrumentation host via the ServiceMgr.transportFxns functions. This task is not needed if no control messages are coming from the host.
The majority of the configuration parameters are defined in the ServiceMgr. For example, the ti.uia.runtime.ServiceMgr.transferAgentPriority dictates priority of the Adaptor's Transfer Agent task. Here is the list of the ServiceMgr parameter used by the Adaptor module:
  • numEventPacketBufs
  • maxEventPacketSize
  • transferAgentStackSection
  • transferAgentStackSize
  • transferAgentPriority
  • supportControl
  • maxCtrlPacketSize
  • numIncomingCtrlPacketBufs
  • numOutgoingCtrlPacketBufs
  • rxTaskStackSize
  • rxTaskStackSection
  • rxTaskPriority
 
Adaptor_freePacket()  // module-wide

Function called within ServiceMgr_freePacket

C synopsis target-domain
Void Adaptor_freePacket(UIAPacket_Hdr *packet);
 
ARGUMENTS
packet — Pointer to a UIAPacket
DETAILS
This function can be used to return an unused packet back to the module. It must only return packets that were obtained via the getFreePacket function.
 
Adaptor_getFreePacket()  // module-wide

Function called within ServiceMgr_getFreePacket

C synopsis target-domain
UIAPacket_Hdr *Adaptor_getFreePacket(UIAPacket_HdrType type, UInt timeout);
 
ARGUMENTS
type — Requested type of packet
timeout — return after this many system time units
RETURNS
Point to the free UIA packet. NULL if not successful.
DETAILS
The service can specify what type of packet it wants with the first parameter.
The function fills in the HdrType field of the packet automatically for the service. All other fields are un-initialized.
 
Adaptor_requestEnergy()  // module-wide

Function called within ServiceMgr_requestEnergy

C synopsis target-domain
Void Adaptor_requestEnergy(Int id);
 
ARGUMENTS
id — Id of the service
DETAILS
Generally services do not maintain an active thread. Services may request the ServiceMgr module to call the ProcessCallback in the context of the transfer agent. This can be accomplished via this function.
 
Adaptor_sendPacket()  // module-wide

Function called within ServiceMgr_sendPacket

C synopsis target-domain
Bool Adaptor_sendPacket(UIAPacket_Hdr *packet);
 
ARGUMENTS
packet — UIAPacket to be sent
RETURNS
TRUE denotes success and the packet is no longer owned by the caller. FALSE denotes failure and the packet is still owned by the caller.
DETAILS
All UIAPacket fields except for SenderAdrs must be filled in.
The caller loses ownership of the packet once it is successfully sent. If this function fails, the caller still owns the packet.
 
Adaptor_setPeriod()  // module-wide

Function called within ServiceMgr_setPeriod

C synopsis target-domain
Void Adaptor_setPeriod(Int id, UInt32 periodInMs);
 
ARGUMENTS
id — Service id of the service
periodInMs — Requested period in milliseconds
DETAILS
Services period should be a multiple of the ServiceMgr's period (periodInMs). If it is not, they will called at the rounded up period. For example, if ServiceMgr.periodInMs = 100 and a service sets its period to 250. That service will be called every 300 milliseconds.
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId Adaptor_Module_id();
// Get this module's unique id
 
Bool Adaptor_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle Adaptor_Module_heap();
// The heap from which this module allocates memory
 
Bool Adaptor_Module_hasMask();
// Test whether this module has a diagnostics mask
 
Bits16 Adaptor_Module_getMask();
// Returns the diagnostics mask for this module
 
Void Adaptor_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
 
XDCscript usage meta-domain sourced in ti/uia/sysbios/Adaptor.xdc
var Adaptor = xdc.useModule('ti.uia.sysbios.Adaptor');
module-wide config parameters
module-wide functions
    Adaptor.newService// Function called within ServiceMgr_register(Int id, UInt32 periodInMs) returns Void
 
 
metaonly config Adaptor.common$  // module-wide

Common module configuration parameters

XDCscript usage meta-domain
Adaptor.common$ = Types.Common$ undefined;
 
DETAILS
All modules have this configuration parameter. Its name contains the '$' character to ensure it does not conflict with configuration parameters declared by the module. This allows new configuration parameters to be added in the future without any chance of breaking existing modules.
 
metaonly config Adaptor.packetSection  // module-wide

Memory section for UIA packets

XDCscript usage meta-domain
Adaptor.packetSection = String undefined;
 
DETAILS
If this parameter is not set then the ServiceMgr.transferAgentStackSection parameter is used for the events and the ServiceMgr.rxTaskStackSection parameter is used for the control messages.
 
metaonly Adaptor.newService()  // module-wide

Function called within ServiceMgr_register

XDCscript usage meta-domain
Adaptor.newService(Int id, UInt32 periodInMs) returns Void
 
ARGUMENTS
id — Id of the new service
periodInMs — Period requested by the service (in millisecond)
DETAILS
All services must call ServiceMgr.register. The ServiceMgr manages the processFxn callback. It then calls the proxy's newService function.
generated on Mon, 28 Jan 2013 17:45:49 GMT