2 * Copyright (C) 2012, GENIVI Alliance, Inc.
\r
3 * Copyright (C) 2012, BMW AG
\r
5 * This file is part of GENIVI Project AudioManager.
\r
7 * Contributions are licensed to the GENIVI Alliance under one or more
\r
8 * Contribution License Agreements.
\r
11 * This Source Code Form is subject to the terms of the
\r
12 * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
\r
13 * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
\r
16 * \author Christian Mueller, christian.ei.mueller@bmw.de BMW 2011,2012
\r
18 * \file CAmCommandReceiver.h
\r
19 * For further information see http://www.genivi.org/.
\r
21 * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
\r
23 #if !defined(EA_F324BBAC_CA26_4b9b_8BE7_166AB6A61889__INCLUDED_)
\r
24 #define EA_F324BBAC_CA26_4b9b_8BE7_166AB6A61889__INCLUDED_
\r
27 #include "projecttypes.h"
\r
36 * @author Christian Mueller
37 * @created 06-Mar-2012 9:46:44 AM
39 typedef uint16_t am_domainID_t;
43 * @author Christian Mueller
44 * @created 06-Mar-2012 9:46:44 AM
46 typedef uint16_t am_sourceID_t;
50 * @author Christian Mueller
51 * @created 06-Mar-2012 9:46:44 AM
53 typedef uint16_t am_sinkID_t;
57 * @author Christian Mueller
58 * @created 06-Mar-2012 9:46:44 AM
60 typedef uint16_t am_gatewayID_t;
64 * @author Christian Mueller
65 * @created 06-Mar-2012 9:46:44 AM
67 typedef uint16_t am_crossfaderID_t;
71 * @author Christian Mueller
72 * @created 06-Mar-2012 9:46:44 AM
74 typedef uint16_t am_connectionID_t;
78 * @author Christian Mueller
79 * @created 06-Mar-2012 9:46:44 AM
81 typedef uint16_t am_mainConnectionID_t;
85 * @author Christian Mueller
86 * @created 06-Mar-2012 9:46:44 AM
88 typedef uint16_t am_speed_t;
91 * The unit is 0.1 db steps,The smallest value -3000 (=AM_MUTE). The minimum and maximum can be limited by actual project.
92 * @author Christian Mueller
93 * @created 06-Mar-2012 9:46:44 AM
95 typedef int16_t am_volume_t;
98 * This is the volume presented on the command interface. It is in the duty of the Controller to change the volumes given here into meaningful values on the routing interface.
\r
99 * The range of this type is customer specific.
100 * @author Christian Mueller
101 * @created 06-Mar-2012 9:46:44 AM
103 typedef int16_t am_mainVolume_t;
106 * @author Christian Mueller
107 * @created 06-Mar-2012 9:46:44 AM
109 typedef uint16_t am_sourceClass_t;
112 * @author Christian Mueller
113 * @created 06-Mar-2012 9:46:44 AM
115 typedef uint16_t am_sinkClass_t;
119 * @author Christian Mueller
120 * @created 06-Mar-2012 9:46:44 AM
122 typedef uint16_t am_time_t;
125 * offset time that is introduced in milli seconds.
126 * @author Christian Mueller
127 * @created 06-Mar-2012 9:46:44 AM
129 typedef int16_t am_timeSync_t;
132 * with the help of this enum, sinks and sources can report their availability state
133 * @author Christian Mueller
134 * @created 06-Mar-2012 9:46:44 AM
136 enum am_Availablility_e
143 * The source / sink is available
147 * the source / sink is not available
154 * represents the connection state
155 * @author Christian Mueller
156 * @created 06-Mar-2012 9:46:44 AM
158 enum am_ConnectionState_e
162 * This means the connection is just building up
166 * the connection is ready to be used
170 * the connection is in the course to be knocked down
172 CS_DISCONNECTING = 3,
174 * only relevant for connectionStatechanged. Is send after the connection was removed
178 * this means the connection is still build up but unused at the moment
185 * @author Christian Mueller
186 * @created 06-Mar-2012 9:46:44 AM
188 enum am_DomainState_e
195 * the domain is controlled by the daemon
199 * the domain is independent starting up
201 DS_INDEPENDENT_STARTUP = 1,
203 * the domain is independent running down
205 DS_INDEPENDENT_RUNDOWN = 2,
210 * This enum characterizes the data of the EarlyData_t
211 * @author Christian Mueller
212 * @created 06-Mar-2012 9:46:44 AM
214 enum am_EarlyDataType_e
223 ED_SOURCE_VOLUME = 1,
231 ED_SOURCE_PROPERTY = 3,
235 ED_SINK_PROPERTY = 4,
240 * the errors of the audiomanager. All possible errors are in here. This enum is used widely as return parameter.
241 * @author Christian Mueller
242 * @created 06-Mar-2012 9:46:44 AM
251 * no error - positive reply
263 * a database error occurred
265 E_DATABASE_ERROR = 4,
267 * the desired object already exists
269 E_ALREADY_EXISTS = 5,
275 * the desired action is not possible
279 * the desired object is non existent
283 * the asynchronous action was aborted
287 * This error is returned in case a connect is issued with a connectionFormat that cannot be selected for the connection. This could be either due to the capabilities of a source or a sink or gateway compatibilities for example
294 * @author Christian Mueller
295 * @created 06-Mar-2012 9:46:44 AM
304 * the source / sink is muted
308 * the source / sink is unmuted
315 * The source state reflects the state of the source
316 * @author Christian Mueller
317 * @created 06-Mar-2012 9:46:44 AM
319 enum am_SourceState_e
323 * The source can be activly heared
327 * The source cannot be heared
331 * The source is paused. Meaning it cannot be heared but should be prepared to play again soon.
338 * This enumeration is used to define the type of the action that is correlated to a handle.
339 * @author Christian Mueller
340 * @created 06-Mar-2012 9:46:44 AM
347 H_SETSOURCESTATE = 3,
349 H_SETSOURCEVOLUME = 5,
350 H_SETSINKSOUNDPROPERTY = 6,
351 H_SETSOURCESOUNDPROPERTY = 7,
352 H_SETSINKSOUNDPROPERTIES = 8,
353 H_SETSOURCESOUNDPROPERTIES = 9,
359 * @author Christian Mueller
360 * @created 06-Mar-2012 9:46:44 AM
362 enum am_InterruptState_e
369 * the interrupt state is off - no interrupt
373 * the interrupt state is interrupted - the interrupt is active
380 * describes the active sink of a crossfader.
381 * @author Christian Mueller
382 * @created 06-Mar-2012 9:46:44 AM
399 * the crossfader is in the transition state
406 * this describes the availability of a sink or a source together with the latest change
407 * @author Christian Mueller
408 * @created 06-Mar-2012 9:46:44 AM
410 struct am_Availability_s
415 * the current availability state
417 am_Availablility_e availability;
419 * the reason for the last change. This can be used to trigger events that deal with state changes.
421 am_AvailabilityReason_e availabilityReason;
426 * describes class properties
427 * @author Christian Mueller
428 * @created 06-Mar-2012 9:46:44 AM
430 struct am_ClassProperty_s
435 * the property as enum
437 am_ClassProperty_e classProperty;
439 * the value of the property
446 * This struct describes the attribiutes of a crossfader.
447 * @author Christian Mueller
448 * @created 06-Mar-2012 9:46:45 AM
450 struct am_Crossfader_s
455 * This is the ID of the crossfader, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManager daemon), or it is a fixed (the project has to ensure the uniqueness of the ID).
457 am_crossfaderID_t crossfaderID;
459 * The name of the crossfader. Must be unique in the whole system.
463 * The sinkID of the SinkA. Sinks shall be registered before registering the crossfader.
465 am_sinkID_t sinkID_A;
467 * The sinkID of the SinkB. Sinks shall be registered before registering the crossfader.
469 am_sinkID_t sinkID_B;
471 * The sourceID of the crossfader source. The source shall be registered before the crossfader.
473 am_sourceID_t sourceID;
475 * This enum can have 3 states:
\r
477 * HS_SINKA sinkA is the current hot one, sinkB is not audible
\r
478 * HS_SINKB sinkB is the current hot one, sinkB is not audible
\r
479 * HS_INTERMEDIATE the fader is stuck in between a cross-fading action. This could be due to an abort or an error. Before using the crossfader, it must be set to either HS_SINKA or HS_SINKB.
481 am_HotSink_e hotSink;
486 * This struct describes the attributes of a gateway.
487 * @author Christian Mueller
488 * @created 06-Mar-2012 9:46:45 AM
495 * This is the ID of the gateway, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it is a fixed (the project has to ensure the uniqueness of the ID).
497 am_gatewayID_t gatewayID;
499 * The name of the gateway. Must be unique in the whole system.
503 * The sinkID of the gateway sink-end. The sink is a full blown sink with connectionFormats, sinkClassIDs etc... It makes sense to register the sinks of a gateway as non-visible. Care needs to be taken that the connectionsFormats match with the ones in the conversionMatrix. If the sink is located in the controllingDomain, the ID needs to be retrieved by registering the sink before registering the gateway. In case the sink is in a different domain, the ID needs to be retrieved via peeking.
507 * The sourceID of the gateway sink-end. The sink is a full blown source with connectionFormats, sinkClassIDs etc... It makes sense to register the sources of a gateway as non-visible. Care needs to be taken that the connectionsFormats match with the ones in the conversionMatrix. If the source is located in the controllingDomain, the ID needs to be retrieved by registering the source before registering the gateway. In case the source is in a different domain, the ID needs to be retrieved via peeking.
509 am_sourceID_t sourceID;
511 * The ID of the sink. If the domain is the same like the controlling domain, the ID is known due to registration. If the domain is different, the ID needs to be retrieved via peeking.
513 am_domainID_t domainSinkID;
515 * The ID of the source. If the domain is the same like the controlling domain, the ID is known due to registration. If the domain is different, the ID needs to be retrieved via peeking.
517 am_domainID_t domainSourceID;
519 * This is the ID of the domain that registers the gateway.
521 am_domainID_t controlDomainID;
523 * This is the list of available formats on the source side of the gateway. It is not defined during the gateway registration but copied from the source registration.
525 std::vector<am_ConnectionFormat_e> listSourceFormats;
527 * This is the list of available formats on the sink side of the gateway. It is not defined during the gateway registration but copied from the sink registration.
529 std::vector<am_ConnectionFormat_e> listSinkFormats;
531 * This is matrix holding information about the conversion capability of the gateway, it's length is defined by the length(listSinkFormats) x length(listSourceFormats).
\r
532 * If a SinkFormat can be converted into a SourceFormat, the vector will hold a 1, if no conversion is possible, a 0.
\r
533 * The data is stored row orientated, where the rows are related to the sinksFormats and the columns to the sourceFormats. The first value will hold the conversion information from the first sourceFormat to the first sinkFormat for example and the seventh value the information about the 3rd sinkFormat to the 1st sourceFormat in case we would have 3 sourceFormats.
\r
536 * 110 011 000 111 001
\r
541 * *********************
\r
548 std::vector<bool> convertionMatrix;
553 * This represents one "hopp" in a route
554 * @author Christian Mueller
555 * @created 06-Mar-2012 9:46:45 AM
557 struct am_RoutingElement_s
564 am_sourceID_t sourceID;
570 * the domainID the routeElement is in
572 am_domainID_t domainID;
574 * the connectionformat that is used for the route
576 am_ConnectionFormat_e connectionFormat;
581 * a list of routing elements that lead from source to sink
582 * @author Christian Mueller
583 * @created 06-Mar-2012 9:46:45 AM
590 * the sourceID where the route starts
592 am_sourceID_t sourceID;
594 * the sinkID where the route ends
598 * the actual route as list of routing elements
600 std::vector<am_RoutingElement_s> route;
605 * struct describing the sound property
606 * @author Christian Mueller
607 * @created 06-Mar-2012 9:46:45 AM
609 struct am_SoundProperty_s
614 * the type of the property - a project specific enum
616 am_SoundPropertyType_e type;
618 * the actual value of the property
625 * struct describing system properties
626 * @author Christian Mueller
627 * @created 06-Mar-2012 9:46:45 AM
629 struct am_SystemProperty_s
634 * the type that is set
636 am_SystemPropertyType_e type;
645 * struct describing sinkclasses
646 * @author Christian Mueller
647 * @created 06-Mar-2012 9:46:45 AM
649 struct am_SinkClass_s
654 * the ID of the sinkClass
656 am_sinkClass_t sinkClassID;
658 * the name of the sinkClass - must be unique in the system
662 * the list of the class properties. These are pairs of a project specific enum describing the type of the value and an integer holding the real value.
664 std::vector<am_ClassProperty_s> listClassProperties;
669 * struct describing source classes
670 * @author Christian Mueller
671 * @created 06-Mar-2012 9:46:46 AM
673 struct am_SourceClass_s
680 am_sourceClass_t sourceClassID;
682 * the name of the sourceClass - must be unique in the system
686 * the list of the class properties. These are pairs of a project specific enum describing the type of the value and an integer holding the real value.
688 std::vector<am_ClassProperty_s> listClassProperties;
693 * this type holds all information of sources relevant to the HMI
694 * @author Christian Mueller
695 * @created 06-Mar-2012 9:46:46 AM
697 struct am_SourceType_s
702 * This is the ID of the source, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it is a fixed (the project has to ensure the uniqueness of the ID).
704 am_sourceID_t sourceID;
706 * The name of the source. Must be unique in the whole system.
710 * the availability of the source
712 am_Availability_s availability;
714 * the sourceClassID, indicates the class the source is in. This information can be used by the Controller to implement different behaviour for different classes.
716 am_sourceClass_t sourceClassID;
721 * this type holds all information of sinks relevant to the HMI
722 * @author Christian Mueller
723 * @created 06-Mar-2012 9:46:46 AM
730 * This is the ID of the sink, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it is a fixed (the project has to ensure the uniqueness of the ID).
734 * The name of the sink. Must be unique in the whole system.
738 * This attribute reflects the availability of the sink. There are several reasons why a sink could be not available for the moment: for example the shutdown of a sink because of overtemperature or over- & undervoltage. The availability consists of two pieces of information:
\r
740 * Availablility: the status itself, can be A_AVAILABLE, A_UNAVAILABLE or A_UNKNOWN
\r
741 * AvailabilityReason: this informs about the last reason for a change in availability. The reasons itself are product specific.
743 am_Availability_s availability;
745 * This is the representation of the Volume for the commandInterface. It is used by the HMI to set the volume of a sink, the AudioManagerController has to transform this into real source and sink volumes.
747 am_mainVolume_t volume;
748 am_MuteState_e muteState;
750 * The sinkClassID references to a sinkClass. With the help of classification, rules can be setup to define the system behaviour.
752 am_sinkClass_t sinkClassID;
757 * a handle is used for asynchronous operations and is uniquely assigned for each of this operations
758 * @author Christian Mueller
759 * @created 06-Mar-2012 9:46:46 AM
768 am_Handle_e handleType:4;
770 * the handle as value
777 * struct describung mainsound property
778 * @author Christian Mueller
779 * @created 06-Mar-2012 9:46:46 AM
781 struct am_MainSoundProperty_s
786 * the type of the property
788 am_MainSoundPropertyType_e type;
797 * this type holds all information of connections relevant to the HMI
798 * @author Christian Mueller
799 * @created 06-Mar-2012 9:46:46 AM
801 struct am_MainConnectionType_s
806 * the ID of the mainconnection
808 am_mainConnectionID_t mainConnectionID;
810 * the sourceID where the connection starts
812 am_sourceID_t sourceID;
814 * the sinkID where the connection ends
818 * the delay of the mainconnection
822 * the current connection state
824 am_ConnectionState_e connectionState;
829 * struct that holds attribiutes of a mainconnection
830 * @author Christian Mueller
831 * @created 06-Mar-2012 9:46:46 AM
833 struct am_MainConnection_s
840 am_mainConnectionID_t mainConnectionID;
842 * the current connection state
844 am_ConnectionState_e connectionState;
852 am_sourceID_t sourceID;
854 * the delay of the connection
858 * the list of sub connection IDs the mainconnection consists of
860 std::vector<am_connectionID_t> listConnectionID;
865 * This struct describes the attribiutes of a sink
866 * @author Christian Mueller
867 * @created 06-Mar-2012 9:46:46 AM
874 * This is the ID of the sink, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it is a fixed (the project has to ensure the uniqueness of the ID).
878 * The name of the sink. Must be unique in the whole system.
882 * The domainID is the domain the sink belongs to. A sink can only be in one domain.
884 am_domainID_t domainID;
886 * The sinkClassID references to a sinkClass. With the help of classification, rules can be setup to define the system behaviour.
888 am_sinkClass_t sinkClassID;
890 * This is the volume of the sink. It is set by the AudioManagerController.
894 * This Boolean flag indicates whether a sink is visible to the commandInterface or not. If the User must have the possibility to choose the source in the HMI, it must be visible. But there are also good reasons for invisible sinks, for example if the sink is part of a crossfader or gateway. HMI relevant changes in visible sinks will be automatically reported by the daemon to the commandInterface.
898 * This attribute reflects the availability of the sink. There are several reasons why a sink could be not available for the moment: for example the shutdown of a sink because of overtemperature or over- & undervoltage. The availability consists of two pieces of information:
\r
900 * Availablility: the status itself, can be A_AVAILABLE, A_UNAVAILABLE or A_UNKNOWN
\r
901 * AvailabilityReason: this informs about the last reason for a change in availability. The reasons itself are product specific.
903 am_Availability_s available;
905 * This attribute reflects the muteState of the sink. The information is not the "real" state of the sink, but the HMI representation for he commandInterface controlled by the AudioManagerController.
907 am_MuteState_e muteState;
909 * This is the representation of the Volume for the commandInterface. It is used by the HMI to set the volume of a sink, the AudioManagerController has to transform this into real source and sink volumes.
911 am_mainVolume_t mainVolume;
913 * This is the list of soundProperties, that the sink is capable of. The soundProperties itself are project specific. For sinks, a possible soundProperty could be for example settings.
915 std::vector<am_SoundProperty_s> listSoundProperties;
917 * This list holds information about the formats that the Source is capable of supporting when delivering audio.
919 std::vector<am_ConnectionFormat_e> listConnectionFormats;
921 * This is the list of the available mainSoundProperties. The principle is the same than with soundProperties, but they are only visible to the CommandInterface.
923 std::vector<am_MainSoundProperty_s> listMainSoundProperties;
928 * This struct describes the attribiutes of a source
929 * @author Christian Mueller
930 * @created 06-Mar-2012 9:46:47 AM
937 * This is the ID of the source, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it is a fixed (the project has to ensure the uniqueness of the ID).
939 am_sourceID_t sourceID;
941 * The domainID is the domain the source belongs to. A source can only be in one domain.
943 am_domainID_t domainID;
945 * The name of the source. Must be unique in the whole system.
949 * the sourceClassID, indicates the class the source is in. This information can be used by the Controller to implement different behaviour for different classes.
951 am_sourceClass_t sourceClassID;
953 * The source state is an indication towards the source if it is actively heard or not. The source can use this information to implement features like automatic spin down of CD's in case the CD is not the active source or AF following of a tuner that is not actively heard. The source state is set by the AudioManagerController.There are 3 possible states:
\r
955 * SS_ON: the source is active
\r
956 * SS_OFF: the source is off
\r
957 * SS_PAUSED: the source is paused and not active.
959 am_SourceState_e sourceState;
961 * This is the volume of the source. It is set by the AudioManagerController. It is used to adopt different audiolevels in a system and mixing of sources (e.g. navigation hints & music).
965 * This Boolean flag indicates whether a source is visible to the commandInterface or not. If the User must have the possibility to choose the source in the HMI, it must be visible. But there are also good reasons for invisible sources, for example if the source is part of a crossfader or gateway. HMI relevant changes in visible sources will be automatically reported by the daemon to the commandInterface.
969 * This attribute reflects the availability of the source. There are several reasons why a source could be not available for the moment. For example a CD player which has no CD entered in the slot can be unavailable, or a USB player with no or unreadable stick attached. Other scenarios involve the shutdown of a source because of overtemperature or over- & undervoltage. The availability consists of two informations:
\r
971 * Availablility: the status itself, can be A_AVAILABLE, A_UNAVAILABLE or A_UNKNOWN
\r
972 * AvailabilityReason: this informs about the last reason for a change in availability. The reasons itself are product specific.
974 am_Availability_s available;
976 * Some special sources can have special behaviors, the are so called "Low Level Interrupts". Here the current status is documented. The information can be used by the AudioManagerController to react to the changes by for example lowering the volume of the mainSources. The two states are
\r
978 * IS_OFF: the interrupt is not active at the moment
\r
979 * IS_INTERRUPTED: the interrupt is playing at the moment.
981 am_InterruptState_e interruptState;
983 * This is the list of soundProperties, that the source is capable of. The soundProperties itself are project specific. For sources, a possible soundProperty could be navigation volume offset, for example.
985 std::vector<am_SoundProperty_s> listSoundProperties;
987 * This list holds information about the formats that the Source is capable of supporting when delivering audio.
989 std::vector<am_ConnectionFormat_e> listConnectionFormats;
991 * This is the list of the available mainSoundProperties. The principle is the same than with soundProperties, but they are only visible to the CommandInterface.
993 std::vector<am_MainSoundProperty_s> listMainSoundProperties;
998 * This struct describes the attribiutes of a domain
999 * @author Christian Mueller
1000 * @created 06-Mar-2012 9:46:47 AM
1009 am_domainID_t domainID;
1011 * the name of the domain
1015 * the busname. This is equal to a plugin name and is used to dispatch messages to the elements of a plugin
1017 std::string busname;
1019 * the name of the node
1021 std::string nodename;
1023 * indicated if the domain is independent at startup or not
1027 * indicates if the domain registration is complete or not
1031 * the current domain state
1033 am_DomainState_e state;
1039 * @author Christian Mueller
1040 * @created 06-Mar-2012 9:46:47 AM
1042 struct am_Connection_s
1049 am_connectionID_t connectionID;
1051 * the source the audio flows from
1053 am_sourceID_t sourceID;
1055 * the sink the audio flows to
1059 * the delay of the conneciton
1061 am_timeSync_t delay;
1063 * the used connectionformat
1065 am_ConnectionFormat_e connectionFormat;
1070 * data type depends of am_EarlyDataType_e:
\r
1071 * volume_t in case of ED_SOURCE_VOLUME, ED_SINK_VOLUME
\r
1072 * soundProperty_t in case of ED_SOURCE_PROPERTY, ED_SINK_PROPERTY
1073 * @author Christian Mueller
1074 * @created 06-Mar-2012 9:46:47 AM
1076 union am_EarlyData_u
1081 am_SoundProperty_s soundProperty;
1086 * data type depends of am_EarlyDataType_e:
\r
1087 * sourceID in case of ED_SOURCE_VOLUME, ED_SOURCE_PROPERTY
\r
1088 * sinkID in case of ED_SINK_VOLUME, ED_SINK_PROPERTY
1089 * @author Christian Mueller
1090 * @created 06-Mar-2012 9:46:47 AM
1097 am_sourceID_t source;
1102 * @author Christian Mueller
1103 * @created 06-Mar-2012 9:46:47 AM
1105 struct am_EarlyData_s
1109 am_EarlyDataType_e type;
1110 am_DataType_u sinksource;
1111 am_EarlyData_u data;
1115 #endif // !defined(EA_F324BBAC_CA26_4b9b_8BE7_166AB6A61889__INCLUDED_)