Package: bladerf / 0.2017.12~rc1-2

0010-host-libbladeRF-config.c-fix-type-error-544-545.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 60109ef1d1543a1fbde7d7e2df571d69e750278a Mon Sep 17 00:00:00 2001
From: Rey Tucker <git@reytucker.us>
Date: Wed, 7 Feb 2018 18:04:07 -0500
Subject: [PATCH 10/15] host: libbladeRF/config.c: fix type error (#544) (#545)

---
 host/libraries/libbladeRF/src/config.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/host/libraries/libbladeRF/src/config.c b/host/libraries/libbladeRF/src/config.c
index 6d55c15d..4d25ad9e 100644
--- a/host/libraries/libbladeRF/src/config.c
+++ b/host/libraries/libbladeRF/src/config.c
@@ -194,11 +194,14 @@ static int apply_config_options(struct bladerf *dev, struct config_options opt)
 
         status = bladerf_set_bandwidth(dev, BLADERF_MODULE_TX, bw, NULL);
     } else if (!strcasecmp(opt.key, "agc")) {
-        ok = str2bool(opt.value, &val);
-        if (ok != 0)
+        bool agcval = false;
+
+        status = str2bool(opt.value, &agcval);
+        if (status != 0) {
             return BLADERF_ERR_INVAL;
+        }
 
-        gain_mode = (val & 1) ? BLADERF_GAIN_AUTOMATIC : BLADERF_GAIN_MANUAL;
+        gain_mode = agcval ? BLADERF_GAIN_AUTOMATIC : BLADERF_GAIN_MANUAL;
         status = bladerf_set_gain_mode(dev, BLADERF_MODULE_RX, gain_mode);
     } else if (!strcasecmp(opt.key, "gpio")) {
         val = str2uint(opt.key, 0, -1, &ok);
-- 
2.11.0