From b0f969293ff9a1391ebef68f243ee42cc776bea2 Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Mon, 24 Jun 2019 14:43:09 +0200 Subject: Remove global card number of hal As we are now using haldependencies to get hal card number(s), it does not make sense to store a global card number for a hal. BUG-AGL: SPEC-2329 Change-Id: If5beb84b71b5e5e67aeabd947b5c3edbf154fa3c Signed-off-by: Jonathan Aillet --- .../4a-internals-hal-alsacore-link.c | 51 ---------------------- 1 file changed, 51 deletions(-) (limited to 'src/4a-internals-hal/4a-internals-hal-alsacore-link.c') diff --git a/src/4a-internals-hal/4a-internals-hal-alsacore-link.c b/src/4a-internals-hal/4a-internals-hal-alsacore-link.c index 6a56e78..130cea5 100644 --- a/src/4a-internals-hal/4a-internals-hal-alsacore-link.c +++ b/src/4a-internals-hal/4a-internals-hal-alsacore-link.c @@ -102,57 +102,6 @@ int InternalHalGetCardInfo(afb_api_t apiHandle, json_object *requestJ, json_obje return errorToReturn; } -int InternalHalGetCardIdByCardPath(afb_api_t apiHandle, char *devPath) -{ - int errorToReturn, cardId, wrapRet; - - json_object *toSendJ, *responseJ = NULL; - - if(! apiHandle) { - AFB_API_ERROR(apiHandle, "Api handle not available"); - return -1; - } - - if(! devPath) { - AFB_API_ERROR(apiHandle, "Dev path is not available"); - return -2; - } - - wrapRet = wrap_json_pack(&toSendJ, "{s:s}", "cardPath", devPath); - if(wrapRet) { - AFB_API_ERROR(apiHandle, "Didn't succeed to allocate cardpath json object (needed to search for audio card using path)"); - return -3; - } - - if(InternalHalGetCardInfo(apiHandle, toSendJ, &responseJ)) { - AFB_API_ERROR(apiHandle, "Something went tried to get card information (using devpath : '%s')", devPath); - errorToReturn = -4; - } - else if(! responseJ) { - AFB_API_ERROR(apiHandle, "Seems that no response was returned when tried to get card info"); - errorToReturn = -5; - } - else if(! json_object_is_type(responseJ, json_type_object)) { - AFB_API_ERROR(apiHandle, - "Seems that %s call to api %s succeed but the returned response is invalid", - ALSACORE_GETINFO_VERB, - ALSACORE_API); - errorToReturn = -6; - } - else if(wrap_json_unpack(responseJ, "{s:i}", "cardNb", &cardId)) { - AFB_API_WARNING(apiHandle, "Response card id is not present/valid"); - errorToReturn = -7; - } - else { - return cardId; - } - - if(responseJ) - json_object_put(responseJ); - - return errorToReturn; -} - int InternalHalSubscribeToAlsaCardEvent(afb_api_t apiHandle, char *cardId) { int err = 0, wrapRet; -- cgit 1.2.3-korg