From 066c3f7f16ef69e80376942e8d6b8c4944b8ed08 Mon Sep 17 00:00:00 2001 From: Martin Koch Date: Fri, 19 Jun 2020 16:01:19 +0200 Subject: 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 --- AudioManagerCore/src/CAmRoutingSender.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'AudioManagerCore/src/CAmRoutingSender.cpp') diff --git a/AudioManagerCore/src/CAmRoutingSender.cpp b/AudioManagerCore/src/CAmRoutingSender.cpp index 36f5c1a..399de9a 100644 --- a/AudioManagerCore/src/CAmRoutingSender.cpp +++ b/AudioManagerCore/src/CAmRoutingSender.cpp @@ -921,6 +921,19 @@ void CAmRoutingSender::setRoutingRundown() } } +am_Error_e CAmRoutingSender::asyncTransferConnection(const am_Handle_s handle, am_domainID_t domainID + , const std::vector> &route, am_ConnectionState_e state) +{ + auto iter = mMapDomainInterface.find(domainID); + if (iter != mMapDomainInterface.end() && iter->second) + { + return iter->second->asyncTransferConnection(handle, route, state); + } + + // given domain not found in map + return E_NON_EXISTENT; +} + am_Error_e CAmRoutingSender::asyncSetVolumes(am_Handle_s &handle, const std::vector &listVolumes) { IAmRoutingSend *pRoutingInterface(NULL); -- cgit v1.2.1 From 3270ab2427164fa41c3bcb4e2662ea625f926d84 Mon Sep 17 00:00:00 2001 From: Martin Koch Date: Thu, 25 Jun 2020 11:01:53 +0200 Subject: AM: add parameter domainID to asyncTransferConnection() Signed-off-by: Martin Koch --- AudioManagerCore/src/CAmRoutingSender.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'AudioManagerCore/src/CAmRoutingSender.cpp') diff --git a/AudioManagerCore/src/CAmRoutingSender.cpp b/AudioManagerCore/src/CAmRoutingSender.cpp index 399de9a..b7da1c4 100644 --- a/AudioManagerCore/src/CAmRoutingSender.cpp +++ b/AudioManagerCore/src/CAmRoutingSender.cpp @@ -927,7 +927,7 @@ am_Error_e CAmRoutingSender::asyncTransferConnection(const am_Handle_s handle, a auto iter = mMapDomainInterface.find(domainID); if (iter != mMapDomainInterface.end() && iter->second) { - return iter->second->asyncTransferConnection(handle, route, state); + return iter->second->asyncTransferConnection(handle, domainID, route, state); } // given domain not found in map -- cgit v1.2.1 From d4cae89a7aaf275110dddb205a1be7c3cac531c9 Mon Sep 17 00:00:00 2001 From: Martin Koch Date: Mon, 29 Jun 2020 14:53:21 +0200 Subject: AM: fix const handle in transferConnection family of functions Signed-off-by: Martin Koch --- AudioManagerCore/src/CAmRoutingSender.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'AudioManagerCore/src/CAmRoutingSender.cpp') diff --git a/AudioManagerCore/src/CAmRoutingSender.cpp b/AudioManagerCore/src/CAmRoutingSender.cpp index b7da1c4..78d0bba 100644 --- a/AudioManagerCore/src/CAmRoutingSender.cpp +++ b/AudioManagerCore/src/CAmRoutingSender.cpp @@ -921,12 +921,17 @@ void CAmRoutingSender::setRoutingRundown() } } -am_Error_e CAmRoutingSender::asyncTransferConnection(const am_Handle_s handle, am_domainID_t domainID +am_Error_e CAmRoutingSender::asyncTransferConnection(am_Handle_s &handle, am_domainID_t domainID , const std::vector> &route, am_ConnectionState_e state) { auto iter = mMapDomainInterface.find(domainID); if (iter != mMapDomainInterface.end() && iter->second) { + auto handleData = std::make_shared(iter->second, route, state, mpDatabaseHandler); + handle = createHandle(handleData, H_TRANSFERCONNECTION); + + logInfo(__METHOD_NAME__, "handle=", handle); + return iter->second->asyncTransferConnection(handle, domainID, route, state); } -- cgit v1.2.1 From 4712a61710ae5fbadcde3d6901ad2e0acdf2b73c Mon Sep 17 00:00:00 2001 From: Martin Koch Date: Tue, 30 Jun 2020 15:58:15 +0200 Subject: AMCore: remove handle after unsuccessful asyncTransferConnection() Signed-off-by: Martin Koch --- AudioManagerCore/src/CAmRoutingSender.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'AudioManagerCore/src/CAmRoutingSender.cpp') diff --git a/AudioManagerCore/src/CAmRoutingSender.cpp b/AudioManagerCore/src/CAmRoutingSender.cpp index 78d0bba..64acd20 100644 --- a/AudioManagerCore/src/CAmRoutingSender.cpp +++ b/AudioManagerCore/src/CAmRoutingSender.cpp @@ -932,7 +932,12 @@ am_Error_e CAmRoutingSender::asyncTransferConnection(am_Handle_s &handle, am_dom logInfo(__METHOD_NAME__, "handle=", handle); - return iter->second->asyncTransferConnection(handle, domainID, route, state); + am_Error_e success = iter->second->asyncTransferConnection(handle, domainID, route, state); + if (success != E_OK) + { + removeHandle(handle); + } + return success; } // given domain not found in map -- cgit v1.2.1 From efe087370361f5600e82243edfe4dcc64e0144b6 Mon Sep 17 00:00:00 2001 From: Martin Koch Date: Wed, 1 Jul 2020 14:46:52 +0200 Subject: AMCore: correct behavior regarding registration of early connections - modify enterConnectionDB() and enterMainConnectionDB() to accept also connections using reserved (peeked-only) sources and/or sinks Signed-off-by: Martin Koch --- AudioManagerCore/src/CAmRoutingSender.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'AudioManagerCore/src/CAmRoutingSender.cpp') diff --git a/AudioManagerCore/src/CAmRoutingSender.cpp b/AudioManagerCore/src/CAmRoutingSender.cpp index 64acd20..fc9f879 100644 --- a/AudioManagerCore/src/CAmRoutingSender.cpp +++ b/AudioManagerCore/src/CAmRoutingSender.cpp @@ -285,7 +285,7 @@ am_Error_e CAmRoutingSender::asyncConnect(am_Handle_s &handle, am_connectionID_t tempConnection.connectionID = 0; tempConnection.delay = -1; - am_Error_e connError(mpDatabaseHandler->enterConnectionDB(tempConnection, connectionID)); + am_Error_e connError(mpDatabaseHandler->enterConnectionDB(tempConnection, connectionID, false)); if (connError) { return(connError); -- cgit v1.2.1