AudioManager  7.6.6
Native Application Runtime Environment
CAmCommandSender.h
Go to the documentation of this file.
1 
24 #ifndef COMMANDSENDER_H_
25 #define COMMANDSENDER_H_
26 
27 #ifdef UNIT_TEST
28 #include "../test/IAmCommandBackdoor.h" //we need this for the unit test
29 #endif
30 
31 #include "IAmCommand.h"
32 #include "CAmDatabaseHandlerMap.h"
33 #include "CAmSerializer.h"
34 
35 namespace am
36 {
37 
38 class CAmCommandReceiver;
39 class CAmCommandSender;
40 
41 
47 {
48 public:
49  CAmCommandSender(const std::vector<std::string>& listOfPluginDirectories, CAmSocketHandler *iSocketHandler);
52  void setCommandReady();
53  void setCommandRundown();
54  void cbNewMainConnection(const am_MainConnectionType_s mainConnection);
55  void cbRemovedMainConnection(const am_mainConnectionID_t mainConnection);
56  void cbNewSink(am_SinkType_s sink);
57  void cbRemovedSink(const am_sinkID_t sink);
58  void cbNewSource(const am_SourceType_s source);
59  void cbRemovedSource(const am_sourceID_t source);
62  void cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState);
63  void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty);
64  void cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty);
65  void cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s& availability);
66  void cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s& availability);
67  void cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume);
68  void cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState);
69  void cbSystemPropertyChanged(const am_SystemProperty_s& systemProperty);
70  void cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time);
71  void getInterfaceVersion(std::string& version) const;
72  am_Error_e getListPlugins(std::vector<std::string>& interfaces) const;
73  void cbSinkUpdated(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties);
74  void cbSourceUpdated(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties);
75  void cbSinkNotification(const am_sinkID_t sinkID, const am_NotificationPayload_s& notification);
76  void cbSourceNotification(const am_sourceID_t sourceID, const am_NotificationPayload_s& notification);
77  void cbSinkMainNotificationConfigurationChanged(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration);
78  void cbSourceMainNotificationConfigurationChanged(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration);
79 
80 #ifdef UNIT_TEST
81  friend class IAmCommandBackdoor; //this is to get access to the loaded plugins and be able to exchange the interfaces
82 #endif
83 private:
84  void loadPlugins(const std::vector<std::string>& listOfPluginDirectories);
85  void unloadLibraries(void);
86  std::vector<IAmCommandSend*> mListInterfaces;
87  std::vector<void*> mListLibraryHandles;
88  std::vector<std::string> mListLibraryNames;
89 
90  CAmCommandReceiver *mCommandReceiver;
91  V2::CAmSerializer mSerializer;
92 };
93 
94 
95 
96 }
97 
98 #endif /* COMMANDSENDER_H_ */
am_Error_e getListPlugins(std::vector< std::string > &interfaces) const
void cbNewSink(am_SinkType_s sink)
This class realizes the command Interface.
A Common-API wrapper class, which loads the common-api runtime and instantiates all necessary objects...
am_Error_e startupInterfaces(CAmCommandReceiver *iCommandReceiver)
uint16_t am_sinkClass_t
am_Error_e
the errors of the audiomanager.
This struct holds information about the configuration for notifications.
void cbSystemPropertyChanged(const am_SystemProperty_s &systemProperty)
void cbSinkUpdated(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector< am_MainSoundProperty_s > &listMainSoundProperties)
void cbNewMainConnection(const am_MainConnectionType_s mainConnection)
This struct holds the payload of a notification.
void cbSourceNotification(const am_sourceID_t sourceID, const am_NotificationPayload_s &notification)
The am::CAmSocketHandler implements a mainloop for the AudioManager.
this type holds all information of sinks relevant to the HMI
int16_t am_timeSync_t
offset time that is introduced in milli seconds.
void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s &soundProperty)
void cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s &soundProperty)
void cbRemovedSource(const am_sourceID_t source)
void cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time)
void cbNewSource(const am_SourceType_s source)
CAmCommandSender(const std::vector< std::string > &listOfPluginDirectories, CAmSocketHandler *iSocketHandler)
struct describing system properties
struct describung mainsound property
SPDX license identifier: MPL-2.0.
void getInterfaceVersion(std::string &version) const
uint16_t am_sourceID_t
a source ID
void cbSinkNotification(const am_sinkID_t sinkID, const am_NotificationPayload_s &notification)
am_ConnectionState_e
represents the connection state
void cbSourceMainNotificationConfigurationChanged(const am_sourceID_t sourceID, const am_NotificationConfiguration_s &mainNotificationConfiguration)
this type holds all information of connections relevant to the HMI
void cbSourceUpdated(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector< am_MainSoundProperty_s > &listMainSoundProperties)
void cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState)
uint16_t am_sourceClass_t
void cbRemovedMainConnection(const am_mainConnectionID_t mainConnection)
this describes the availability of a sink or a source together with the latest change ...
SPDX license identifier: MPL-2.0.
void cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s &availability)
void cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume)
void cbSinkMainNotificationConfigurationChanged(const am_sinkID_t sinkID, const am_NotificationConfiguration_s &mainNotificationConfiguration)
void cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState)
int16_t am_mainVolume_t
This is the volume presented on the command interface.
void cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s &availability)
this type holds all information of sources relevant to the HMI
Copyright (C) 2012 - 2014, BMW AG.
This class is used to send data to the CommandInterface.
uint16_t am_sinkID_t
a sink ID
uint16_t am_mainConnectionID_t
a mainConnection ID
void cbRemovedSink(const am_sinkID_t sink)