aboutsummaryrefslogtreecommitdiffstats
path: root/binding/radio-binding.c
diff options
context:
space:
mode:
Diffstat (limited to 'binding/radio-binding.c')
-rw-r--r--binding/radio-binding.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/binding/radio-binding.c b/binding/radio-binding.c
index 0ab5565..34eb53e 100644
--- a/binding/radio-binding.c
+++ b/binding/radio-binding.c
@@ -27,6 +27,7 @@
#include <afb/afb-binding.h>
#include "radio_impl.h"
+#include "radio_impl_null.h"
#include "radio_impl_rtlsdr.h"
#include "radio_impl_kingfisher.h"
#include "radio_impl_tef665x.h"
@@ -581,6 +582,11 @@ static int init(afb_api_t api)
rc = radio_impl_ops->init();
}
if (rc != 0) {
+ radio_impl_ops = &null_impl_ops;
+ rc = radio_impl_ops->init();
+ }
+ if (rc != 0) {
+ // We don't expect the null implementation to fail init, but just in case...
AFB_API_ERROR(afbBindingV3root, "No radio device found, exiting");
}
if(rc == 0) {
@@ -590,8 +596,6 @@ static int init(afb_api_t api)
{
radio_impl_ops->set_rds_callback(rds_callback);
}
-
-
} else {
return rc;
}