add function to get the current LOA
authorJosé Bollo <jose.bollo@iot.bzh>
Thu, 4 May 2017 15:04:39 +0000 (17:04 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Thu, 4 May 2017 15:04:39 +0000 (17:04 +0200)
Change-Id: I0f2a0eae8b4de982549fa4a87e2e0f8150c7d6cc
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/afb-context.c
src/afb-context.h

index 174ac16..87346b5 100644 (file)
@@ -177,4 +177,9 @@ int afb_context_change_loa(struct afb_context *context, unsigned loa)
        return 1;
 }
 
+unsigned afb_context_get_loa(struct afb_context *context)
+{
+       return context->loa_changing || context->loa_changed ? context->loa_out : context->loa_in;
+}
+
 
index 40adeb5..f140238 100644 (file)
@@ -57,4 +57,5 @@ extern void afb_context_refresh(struct afb_context *context);
 extern int afb_context_check(struct afb_context *context);
 extern int afb_context_check_loa(struct afb_context *context, unsigned loa);
 extern int afb_context_change_loa(struct afb_context *context, unsigned loa);
+extern unsigned afb_context_get_loa(struct afb_context *context);