aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2019-08-05 16:55:13 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2019-08-12 12:23:11 +0200
commit59da9b4952b9c8852658aa27eb23992769d6b05c (patch)
tree6b2de6c401f59ede9c7c8bd212e83595b4443919 /lib
parent8c08ae193531b6f9c86f58764af598016b696260 (diff)
Create 'all_streams' verb at binding startup
Create 'all_streams' verb at binding startup, that way, it will always be created. Generate a request fail when a call is done when no streams are created. BUG-AGL: SPEC-2733 Change-Id: I1b7ec3b8ed0fcd617e4a016e455beb447d233c82 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'lib')
-rw-r--r--lib/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c b/lib/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c
index 7b5707c..ee1432f 100644
--- a/lib/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c
+++ b/lib/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c
@@ -131,7 +131,7 @@ void HalUtlActionOnMixer(afb_req_t request, enum ActionOnMixerType actionType)
{
char *apiToCall;
- struct cds_list_head *streamsDataListHead = NULL;
+ struct cds_list_head *streamsDataListHead;
afb_api_t apiHandle;
CtlConfigT *ctrlConfig;
@@ -193,7 +193,7 @@ void HalUtlActionOnMixer(afb_req_t request, enum ActionOnMixerType actionType)
case ACTION_ON_MIXER_STREAM:
currentMixerData = (struct InternalHalMixerData *) afb_req_get_vcbdata(request);
if(! currentMixerData) {
- afb_req_fail(request, "hal_call_data", "Can't get stream to call data");
+ afb_req_fail(request, "stream_call_data", "Can't get stream to call data");
return;
}
@@ -222,9 +222,9 @@ void HalUtlActionOnMixer(afb_req_t request, enum ActionOnMixerType actionType)
break;
case ACTION_ON_MIXER_ALL_STREAM:
- streamsDataListHead = (struct cds_list_head *) afb_req_get_vcbdata(request);
- if(! streamsDataListHead) {
- afb_req_fail(request, "hal_call_data", "Can't get stream list data");
+ streamsDataListHead = &currentHalData->internalHalData->streamsDataListHead;
+ if(cds_list_empty(streamsDataListHead)) {
+ afb_req_fail(request, "streams_call_data", "Stream list is empty");
return;
}