sbsGet() for AVR

sbsGet provides a uniform interface to access the local data structure and other variables inside an instance of a port-based object. sbsGet can only be called after a module has been spawned, using sbsSpawn(). Once spawned, the sbsGet routine can be used at anytime until the module is killed.

sbsGet provides a method to get certain parameters of the scheduler as well as user-defined parameters. The PBO/RT parameters that are accessible by default include the module frequency (SBS_FREQ), the module period as a function of the number of heartbeats (SBS_NTICKS), and the number of missed deadlines the module has experienced since it was spawned (SBS_MISSED).

The calling convention of sbsGet is:


int sbsGet(char procID, int16_t type, int16_t arg, void *vptr);

where procID is an index to a module returned by sbsSpawn(), type is a constant indicating the intent of the sbsGet operation, arg is an index or value of relevance to the specified type, and vptr is a pointer to the values of relevance to the specified type. The return value is one of the pre-defined values I_OK or I_ERROR.

If only the pre-defined types -- SBS_FREQ, SBS_NTICKS, and SBS_MISSED -- are used, no further action by the module programmer is needed. If user-defined types are needed, the module programmer must create an xxx_get() routine, as indicated in the module example. The calling convention for xxx_get() is the same as sbsGet():


char xxx_get(uint8_t index, int16_t type, int16_t arg, void *vptr)

but the xxx_get() function is never called by the programmer directly. It is only called indirectly through sbsGet().
Prof. Voyles' Home Page

Copyright: © 2010 by Richard Voyles. All rights reserved.
Department of Electrical and Computer Engineering, University of Denver.

Maintained by Richard Voyles
Last modified: Apr. 24, 2010