diff options
author | Martin Koch <martin.koch@ese.de> | 2020-06-19 16:01:19 +0200 |
---|---|---|
committer | Martin Koch <martin.koch@ese.de> | 2020-07-01 14:37:32 +0200 |
commit | 066c3f7f16ef69e80376942e8d6b8c4944b8ed08 (patch) | |
tree | d7d6ee7e5591e6915865ff0b0fa67191091032ca /AudioManagerCore/src/CAmRoutingReceiver.cpp | |
parent | 4b34f9dc67e4ff1948d233346c2e5e3b14b8e78a (diff) | |
download | audiomanager-066c3f7f16ef69e80376942e8d6b8c4944b8ed08.tar.gz |
Add support for announcement and handling of pre-established audio connections through routing side
As the complete initialization of the cockpit system takes some time, a few use-cases exist
where information needs to be audible (or visible) right before the system is fully started.
Here we mainly have:
- system alerts
+ door open
+ seat belt missing
+ engine faults
- parking assistant warnings
+ rear view camera screen
+ beeps if distance goes below limit
Both routing- and control-side are extended to allow notifying about such connections
Signed-off-by: Martin Koch <martin.koch@ese.de>
Diffstat (limited to 'AudioManagerCore/src/CAmRoutingReceiver.cpp')
-rw-r--r-- | AudioManagerCore/src/CAmRoutingReceiver.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/AudioManagerCore/src/CAmRoutingReceiver.cpp b/AudioManagerCore/src/CAmRoutingReceiver.cpp index be13474..8f4d1ba 100644 --- a/AudioManagerCore/src/CAmRoutingReceiver.cpp +++ b/AudioManagerCore/src/CAmRoutingReceiver.cpp @@ -124,6 +124,19 @@ void CAmRoutingReceiver::ackDisconnect(const am_Handle_s handle, const am_connec mpControlSender->cbAckDisconnect(handle, error); } +/** + * Support hand-over acknowledgment of connections surviving shutdown of the AM + * + * @param handle: composite identifier used in the request + * @param errorID:success indicator (E_OK if application takes over, + * E_NOT_POSSIBLE if the routing adapter is not prepared to take over + * full responsibility for all involved sources and sinks) + */ +void CAmRoutingReceiver::ackTransferConnection(const am_Handle_s handle, const am_Error_e errorID) +{ + +} + void CAmRoutingReceiver::ackSetSinkVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) { logInfo(__METHOD_NAME__, "handle=", handle, "volume=", volume, "error=", error); @@ -233,6 +246,40 @@ am_Error_e CAmRoutingReceiver::deregisterDomain(const am_domainID_t domainID) return (mpControlSender->hookSystemDeregisterDomain(domainID)); } +am_Error_e CAmRoutingReceiver::registerEarlyConnection(am_domainID_t domainID + , const std::vector< am_Connection_s > &route, am_ConnectionState_e state) +{ + if (route.size() < 1) + { + logWarning(__METHOD_NAME__, "route empty"); + return E_NOT_POSSIBLE; + } + + am_MainConnection_s mainConnectionData; + mainConnectionData.sourceID = route.front().sourceID; + mainConnectionData.sinkID = route.back().sinkID; + mainConnectionData.connectionState = state; + mainConnectionData.listConnectionID.reserve(route.size()); + for (auto & conn : route) + { + am_connectionID_t connectionID; + am_Error_e success = mpDatabaseHandler->enterConnectionDB(conn, connectionID); + switch (success) + { + case E_OK: + case E_ALREADY_EXISTS: + case E_NO_CHANGE: + mainConnectionData.listConnectionID.push_back(connectionID); + break; + + default: + return success; + } + } + + return mpControlSender->hookSystemRegisterEarlyConnection(domainID, mainConnectionData); +} + am_Error_e CAmRoutingReceiver::registerGateway(const am_Gateway_s &gatewayData, am_gatewayID_t &gatewayID) { return (mpControlSender->hookSystemRegisterGateway(gatewayData, gatewayID)); |