From 67fc2c25d727888cb45a847971771f34674b68ff Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Sun, 3 Jun 2018 19:16:32 +0200 Subject: Handle hal status using card presence and mixer init Test audio card presence at hal startup using alsacore call. Handling a new state of hal. Move alsacore link files into 4a-hal-controllers. Check state of hal before mixer initialization call. Actualize hal state if mixer initlialization ends well. Add a sndCardId filed to 'SpecificHalData' structure which will contain audio card if (from alsa). Change-Id: I2e82a14ee6ba6e63f06fe2b498587783941b7b98 Signed-off-by: Jonathan Aillet --- .../4a-hal-controllers-alsacore-link.h | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.h (limited to '4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.h') diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.h b/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.h new file mode 100644 index 0000000..19ff9e5 --- /dev/null +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-alsacore-link.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2018 "IoT.bzh" + * Author Jonathan Aillet + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef HAL_CTLS_ALSACORE_LINK_INCLUDE_ +#define HAL_CTLS_ALSACORE_LINK_INCLUDE_ + +#include +#include + +#define ALSACORE_API "alsacore" +#define ALSACORE_GETINFO_VERB "infoget" + +// HAL controllers alsacore calls funtions +bool HalCtlsGetCardIdByCardPath(afb_dynapi *apiHandle, struct SpecificHalData *currentCtlHalData); + +#endif /* HAL_CTLS_ALSACORE_LINK_INCLUDE_ */ \ No newline at end of file -- cgit 1.2.3-korg