ADTF_DEVICE_TOOLBOX
3.11.3 (ADTF 3.16.2)
|
With the new ADTF Device Toolbox 3 it is possible to implement and deploy custom database parser services for reading communication specifications. The parser service can therefore be used to support special file formats or handle deviations from standard file formats. Such a special parser service consists of two classes. A bus specific database implementation and a database loader that is capable of accepting and loading one or multiple communication specifications. The process of implementing a custom database parser hence involves at least three interfaces:
The database registry is the maintainer of the database loader instances that are registered to a specific bus support service. Upon loading a set of communication database files, the registry iterates through its list of registered databases and asks whether a database is capable of loading those files or not until one loader is found which is responsible. A database loader of course first has to be registered to the registry. So it is necessary to load an appropriate bus service as well, which takes care to register a database loader on startup and unregister it on shutdown.
For every bus type there is a separate registry, holding a list of parsers for that bus type, which can be requested by the Class ID CID_DEVTB_BUS_DB_REGISTRY.
A database implementation has to realize the interfaces specific to the underlying bus type. Currently the ADTF Device Toolbox provides the interfaces adtf::devicetb::sdk::can::ICANDatabase in conjunction with adtf::devicetb::sdk::can::ICANDatabaseList for CAN based busses and --> adtf::devicetb::sdk::canfd::ICANFDDatabase in conjunction with adtf::devicetb::sdk::canfd::ICANFDDatabaseList for CAN FD based busses.
The interface to implement a database loader is named adtf::devicetb::sdk::IBusDatabaseLoader. The database loader decides whether it is responsible for supporting bus communiation files or not (see adtf::devicetb::sdk::IBusDatabaseLoader::Accept()). If it is, a new database instance is created and passed back to the caller of adtf::devicetb::sdk::IBusDatabaseLoader::Load(). The methods in adtf::devicetb::sdk::IBusDatabaseLoader are not specific to a certain bus type.
The pure virtual methods that need to be implemented in your parser classes are only these three functions:
ucom::object_ptr
is used. This implies that each time a database is created from the loader, this instance is automatically Ref()'ed for the calling service! For details on reference counting or ucom::object_ptr
in ADTF have a look at ADTF's SDK documentation.There are two restrictions regarding signal access with those interfaces, that need to be taken into account in your implementation: