|
automotive-message-broker
0.14.803
|
CAN frames listener plug-in for the AMB CAN Simulator. More...
#include <cansimplugin.h>
Public Member Functions | |
| CANSimPlugin (AbstractRoutingEngine *re, const std::map< std::string, std::string > &config, AbstractSource &parent) | |
| const std::string | uuid () const |
| void | supportedChanged (const PropertyList &supportedProperties) |
| int | supportedOperations () const |
| supportedOperations | |
| virtual void | errorOccured (CANObserver::CANError error) |
| virtual void | standardFrameReceived (const can_frame &frame) |
| virtual void | extendedFrameReceived (const can_frame &frame) |
| virtual void | errorFrameReceived (const can_frame &frame) |
| virtual void | remoteTransmissionRequest (const can_frame &frame) |
| virtual void | timeoutDetected (const can_frame &frame) |
| virtual void | init () |
Public Member Functions inherited from AmbPluginImpl | |
| AmbPluginImpl (AbstractRoutingEngine *re, const map< string, string > &config, AbstractSource &parent) | |
| virtual void | getPropertyAsync (AsyncPropertyReply *reply) |
| getPropertyAsync is called when a sink requests the value for given property. This is only called if the source supports the Get operation. | |
| virtual void | getRangePropertyAsync (AsyncRangePropertyReply *reply) |
| getRangePropertyAsync is called when a sink requests a series of values for a given property within a specified time or sequencial range. This will only be called if the source support the Ranged Operation. | |
| virtual AsyncPropertyReply * | setProperty (const AsyncSetPropertyRequest &request) |
| setProperty is called when a sink requests to set a value for a given property. This is only called if the source supports the Set Operation. | |
| virtual void | subscribeToPropertyChanges (const VehicleProperty::Property &property) |
| subscribeToPropertyChanges is called when a sink requests a subscription. Source plugins can keep track of subscriptions and may wish to sleep if there are no subscriptions. | |
| virtual void | unsubscribeToPropertyChanges (const VehicleProperty::Property &property) |
| unsubscribeToPropertyChanges is called when a sink requests to unsubscribe from a given property's changes. | |
| virtual PropertyList | supported () const |
| supported is called by the routingEngine to understand what properties this source supports. | |
| virtual PropertyInfo | getPropertyInfo (const VehicleProperty::Property &property) |
| getPropertyInfo used to return specific information about a property. The source should override this otherwise a PropertyInfo::invalid() will be returned for the property | |
| virtual void | propertyChanged (AbstractPropertyType *value) |
| template<typename T > | |
| void | setValue (std::shared_ptr< AbstractPropertyType > property, T value) |
| setValue of a property | |
Additional Inherited Members | |
Public Types inherited from CANObserver | |
| enum | CANError { GENERAL_ERROR = 0 } |
Protected Types inherited from AmbPluginImpl | |
| typedef std::map< Zone::Type, std::shared_ptr < AbstractPropertyType > > | ZonePropertyType |
Protected Member Functions inherited from AmbPluginImpl | |
| virtual AbstractPropertyType * | findPropertyType (const VehicleProperty::Property &propertyName, const Zone::Type &zone=Zone::None) |
| std::shared_ptr < AbstractPropertyType > | addPropertySupport (Zone::Type zone, std::function< AbstractPropertyType *(void)> typeFactory, std::string sourceUuid="") |
| template<class T > | |
| std::shared_ptr < AbstractPropertyType > | addPropertySupport (Zone::Type zone) |
Protected Attributes inherited from AmbPluginImpl | |
| AbstractSource & | source |
| AbstractRoutingEngine * | routingEngine |
| std::map < VehicleProperty::Property, ZonePropertyType > | properties |
| std::map< std::string, std::string > | configuration |
CAN frames listener plug-in for the AMB CAN Simulator.
Listens on AMB notification for changes in supported properties using supportedChanged() callback.
On startup it registers property called 'MappingTable' and all properties needed for simulation in html5UI.Dashboard and html5UI.HVAC applications.
Immediately after it registers own properties it will get first notification supportedChanged().
On every notification from supportedChanged() CANSimPlugin goes through all supported properties in AMB, exclude those properties for which there are known sources in the AMB,
assigns to each single property and zone some unique CAN Id(builds 'mapping table') and this 'mapping table' stores as JSON string and updates it as a 'MappingTable' property in AMB.
When 'MappingTable' is built and ready it starts to listen on all required CAN interfaces in AMB configuration file.
On any received CAN frame it goes through the mappingTable, finds property name and zone based on received CAN Id, reads new value from CAN frame and updates it in the AMB.
| CANSimPlugin::CANSimPlugin | ( | AbstractRoutingEngine * | re, |
| const std::map< std::string, std::string > & | config, | ||
| AbstractSource & | parent | ||
| ) |
| re | AbstractRoutingEngine |
| config | Map of the configuration string values loaded on startup from AMB configuration file |
| parent | AmbPlugin instance |
|
virtual |
Called when error frame was received from the bus.
| frame | Error frame |
Implements CANObserver.
|
virtual |
|
virtual |
Called when extended frame was is received from the bus.
| frame | Received frame |
Implements CANObserver.
|
virtual |
Second phase of the plugin initialization.
Reimplemented from AmbPluginImpl.
|
virtual |
Called when remote transmission frame was received from the bus.
| frame | RTR frame |
Implements CANObserver.
|
virtual |
Called when standard frame was is received from the bus.
| frame | Received frame |
Implements CANObserver.
|
virtual |
Called when the supported properties changes
| supportedProperties | the new list of supported properties. |
Reimplemented from AmbPluginImpl.
|
virtual |
|
virtual |
|
inlinevirtual |
1.8.2