Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

BSA asyn driver (bsaAsynDriver.cpp/h)

BSA asyn driver also contains a global static pointer that points to a linkedList of all drivers instantiated, and contains the same set of linkedList functions that were described above. The node structure is as follows

Code Block
languagecpp
themeRDark
titleBSA ELLList node structure
typedef struct {
    ELLNODE       node;
    char          *named_root;
    char          *port;
    bsaAsynDriver *pBsaDrv;
    ELLLIST       *pBsaEllList;
    void          *_pBsaBridge;
} pDrvList_t;


The functions operating on the linked list are as follows:

  • init_drvList
    • Returns an allocated global linked list pointer. This does not necessarily mean that the linked l has elements.
    • Flow: If the global pointer is not NULL, a new linked list (type ELLLIST) is allocated, otherwise do nothing. 
  • prep_drvAnonimous:
    • Returns an allocated but empty driver pointer that needs to be initialized
    • Calls init_drvList, then allocates memory for a new item in the linked list, initializes it, then adds it to the end of the linked list and returns linked list count.
  • prep_drvByPort
    • Same as prep_drvAnonimous; create new driver item of linked list but with a specific port name string
  • prep_drvByNamedRoot: 
    • Same as prep_drvAnonimous; create new driver item of linked list but with a specific named root string
  • find_drvLast:
    • Returns the last driver found. If not driver is found in the linked list, NULL is returned
    • Calls init_drvList, then counts the number of elements in the linked list. If they are not 0, it returns the last element, otherwise returns NULL
  • find_drvByPort:
    • Returns a driver that matches the same port name. If not found, returns NULL
    • Calls init_drvList, then iterates on the linked list one element at a time starting from the first element. Once an element with a portName that is not NULL, and a string length of not zero, and a string identical to the argument port_name is found, it is returned, otherwise the next item is examined. If none is found, NULL is returned
  • find_drvByNamedRoot