Skip to content

Commit 0fe6d34

Browse files
HaavardReifabiobaltieri
authored andcommitted
Bluetooth: Mesh: Remove duplicate brg declaration
Removes duplicate declaration of the bridging direction, keeping the one in the public header file. Signed-off-by: Håvard Reierstad <[email protected]>
1 parent 8049c24 commit 0fe6d34

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

include/zephyr/bluetooth/mesh/brg_cfg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ enum bt_mesh_brg_cfg_state {
2828
BT_MESH_BRG_CFG_ENABLED,
2929
};
3030

31-
/* Briding from Addr1 to Addr2. */
31+
/* Bridging from Addr1 to Addr2. */
3232
#define BT_MESH_BRG_CFG_DIR_ONEWAY 1
33-
/* Bidirectional briging between Addr1 and Addr2. */
33+
/* Bidirectional bridging between Addr1 and Addr2. */
3434
#define BT_MESH_BRG_CFG_DIR_TWOWAY 2
3535

3636
/** Bridging Table state entry corresponding to a entry in the Bridging Table. */

subsys/bluetooth/mesh/brg_cfg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ static bool netkey_check(uint16_t net_idx1, uint16_t net_idx2)
224224
return bt_mesh_subnet_get(net_idx1) && bt_mesh_subnet_get(net_idx2);
225225
}
226226

227-
int bt_mesh_brg_cfg_tbl_add(enum bt_mesh_brg_cfg_dir direction, uint16_t net_idx1,
228-
uint16_t net_idx2, uint16_t addr1, uint16_t addr2, uint8_t *status)
227+
int bt_mesh_brg_cfg_tbl_add(uint8_t direction, uint16_t net_idx1, uint16_t net_idx2, uint16_t addr1,
228+
uint16_t addr2, uint8_t *status)
229229
{
230230
/* Sanity checks */
231231
if (!BT_MESH_ADDR_IS_UNICAST(addr1) || net_idx1 == net_idx2 || addr1 == addr2 ||

subsys/bluetooth/mesh/brg_cfg.h

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,6 @@
1313

1414
#define BT_MESH_BRG_CFG_NKEY_PRHB_FLT_MASK 0x000C
1515

16-
enum bt_mesh_brg_cfg_dir {
17-
/* Value is prohibited. */
18-
BT_MESH_BRG_CFG_DIR_PROHIBITED = 0,
19-
/* Briging from Addr1 to Addr2. */
20-
BT_MESH_BRG_CFG_DIR_ONEWAY = 1,
21-
/* Briging to/from Addr1 from/to Addr2. */
22-
BT_MESH_BRG_CFG_DIR_TWOWAY = 2,
23-
/* Values above these are prohibited. */
24-
BT_MESH_BRG_CFG_DIR_MAX = 3,
25-
};
26-
2716
#define BT_MESH_BRG_CFG_NETIDX_NOMATCH 0xFFFF
2817

2918
/* One row of the bridging table */
@@ -50,8 +39,8 @@ int bt_mesh_brg_cfg_tbl_reset(void);
5039

5140
int bt_mesh_brg_cfg_tbl_get(const struct bt_mesh_brg_cfg_row **rows);
5241

53-
int bt_mesh_brg_cfg_tbl_add(enum bt_mesh_brg_cfg_dir direction, uint16_t net_idx1,
54-
uint16_t net_idx2, uint16_t addr1, uint16_t addr2, uint8_t *status);
42+
int bt_mesh_brg_cfg_tbl_add(uint8_t direction, uint16_t net_idx1, uint16_t net_idx2, uint16_t addr1,
43+
uint16_t addr2, uint8_t *status);
5544

5645
int bt_mesh_brg_cfg_tbl_remove(uint16_t net_idx1, uint16_t net_idx2, uint16_t addr1, uint16_t addr2,
5746
uint8_t *status);

tests/bluetooth/mesh/brg/src/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ ZTEST(bt_mesh_brg_cfg, test_brg_tbl_pending_store)
293293
bt_mesh_brg_cfg_pending_store();
294294
}
295295

296+
/* Value is prohibited. */
297+
#define BT_MESH_BRG_CFG_DIR_PROHIBITED 0
298+
/* Values above and including this is prohibited. */
299+
#define BT_MESH_BRG_CFG_DIR_MAX 3
300+
296301
/* Test if invalid entries are not added to the table. */
297302
ZTEST(bt_mesh_brg_cfg, test_tbl_add_invalid_ip)
298303
{

0 commit comments

Comments
 (0)