Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 808a6a9

Browse files
committed
Merge pull request RFduino#11 from jetty840/master
Adding host/device addressing to GZLL
2 parents 6a97b09 + a0071df commit 808a6a9

File tree

6 files changed

+28
-1
lines changed

6 files changed

+28
-1
lines changed

libraries/RFduinoGZLL/RFduinoGZLL.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,15 @@ RFduinoGZLLClass::RFduinoGZLLClass()
5656
::RFduinoGZLL_used = 1;
5757

5858
txPowerLevel = +4;
59+
hostBaseAddress = 0U;
60+
deviceBaseAddress = 0U;
5961
}
6062

6163
int RFduinoGZLLClass::begin(device_t device)
6264
{
6365
RFduinoGZLL_tx_power_level = txPowerLevel;
66+
RFduinoGZLL_host_base_address = hostBaseAddress;
67+
RFduinoGZLL_device_base_address = deviceBaseAddress;
6468

6569
return RFduinoGZLL_begin(device);
6670
}

libraries/RFduinoGZLL/RFduinoGZLL.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ class RFduinoGZLLClass
7272
public:
7373
// -20 dBm to +4 dBm - default +4 dBm
7474
int txPowerLevel;
75+
uint32_t hostBaseAddress;
76+
uint32_t deviceBaseAddress;
7577

7678
public:
7779
RFduinoGZLLClass();

source/libRFduinoGZLL/libRFduinoGZLL.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ extern int RFduinoGZLL_enabled;
4343

4444
// -20 dBm to +4 dBm = default +4 dBm
4545
int RFduinoGZLL_tx_power_level = 4;
46+
uint32_t RFduinoGZLL_host_base_address = 0U;
47+
uint32_t RFduinoGZLL_device_base_address = 0U;
4648

4749
static device_t _device;
4850

51+
4952
// 0 = success
5053
// 1 = init failed
5154
// 2 = set tx_power failed
@@ -81,7 +84,17 @@ int RFduinoGZLL_begin(device_t device)
8184

8285
if (! nrf_gzll_set_device_channel_selection_policy(NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_CURRENT))
8386
return 4;
84-
87+
88+
if (RFduinoGZLL_host_base_address ) {
89+
if ( !nrf_gzll_set_base_address_0(RFduinoGZLL_host_base_address) )
90+
return 5;
91+
}
92+
93+
if (RFduinoGZLL_device_base_address) {
94+
if ( !nrf_gzll_set_base_address_1(RFduinoGZLL_device_base_address) )
95+
return 6;
96+
}
97+
8598
if (! nrf_gzll_enable())
8699
return 3;
87100

source/libRFduinoGZLL/libRFduinoGZLL.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ typedef enum
5555

5656
// -20 dBm to +4 dBm - default +4 dBm
5757
extern int RFduinoGZLL_tx_power_level;
58+
extern uint32_t RFduinoGZLL_host_base_address;
59+
extern uint32_t RFduinoGZLL_device_base_address;
5860

5961
extern void RFduinoGZLL_onReceive(device_t device, int rssi, char *data, int len) __attribute__((weak));
6062

@@ -63,6 +65,8 @@ extern void RFduinoGZLL_onReceive(device_t device, int rssi, char *data, int len
6365
// 2 = set tx_power failed
6466
// 3 = enabled failed
6567
// 4 = set channel selection policy failed
68+
// 5 = failed to set host base address
69+
// 6 = failed to set devive base address
6670
int RFduinoGZLL_begin(device_t device);
6771

6872
void RFduinoGZLL_end(void);

variants/RFduino/libRFduinoGZLL.a

-4.15 KB
Binary file not shown.

variants/RFduino/libRFduinoGZLL.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ typedef enum
5555

5656
// -20 dBm to +4 dBm - default +4 dBm
5757
extern int RFduinoGZLL_tx_power_level;
58+
extern uint32_t RFduinoGZLL_host_base_address;
59+
extern uint32_t RFduinoGZLL_device_base_address;
5860

5961
extern void RFduinoGZLL_onReceive(device_t device, int rssi, char *data, int len) __attribute__((weak));
6062

@@ -63,6 +65,8 @@ extern void RFduinoGZLL_onReceive(device_t device, int rssi, char *data, int len
6365
// 2 = set tx_power failed
6466
// 3 = enabled failed
6567
// 4 = set channel selection policy failed
68+
// 5 = failed to set host base address
69+
// 6 = failed to set devive base address
6670
int RFduinoGZLL_begin(device_t device);
6771

6872
void RFduinoGZLL_end(void);

0 commit comments

Comments
 (0)