Skip to content

Commit f764a6c

Browse files
committed
Bluetooth: ISO: Add broadcast support
This adds broadcast support for BTPROTO_ISO by extending the sockaddr_iso with a new struct sockaddr_iso_bc where the socket user can set the broadcast address when receiving, the SID and the BIS indexes it wants to synchronize. When using BTPROTO_ISO for broadcast the roles are: Broadcaster -> uses connect with address set to BDADDR_ANY: > tools/isotest -s 00:00:00:00:00:00 Broadcast Receiver -> uses listen with address set to broadcaster: > tools/isotest -d 00:AA:01:00:00:00 Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent eca0ae4 commit f764a6c

File tree

3 files changed

+370
-34
lines changed

3 files changed

+370
-34
lines changed

include/net/bluetooth/bluetooth.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ struct bt_codecs {
220220
#define BT_CODEC_TRANSPARENT 0x03
221221
#define BT_CODEC_MSBC 0x05
222222

223+
#define BT_ISO_BASE 20
224+
223225
__printf(1, 2)
224226
void bt_info(const char *fmt, ...);
225227
__printf(1, 2)

include/net/bluetooth/iso.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,23 @@
1010

1111
/* ISO defaults */
1212
#define ISO_DEFAULT_MTU 251
13+
#define ISO_MAX_NUM_BIS 0x1f
14+
15+
/* ISO socket broadcast address */
16+
struct sockaddr_iso_bc {
17+
bdaddr_t bc_bdaddr;
18+
__u8 bc_bdaddr_type;
19+
__u8 bc_sid;
20+
__u8 bc_num_bis;
21+
__u8 bc_bis[ISO_MAX_NUM_BIS];
22+
};
1323

1424
/* ISO socket address */
1525
struct sockaddr_iso {
1626
sa_family_t iso_family;
1727
bdaddr_t iso_bdaddr;
1828
__u8 iso_bdaddr_type;
29+
struct sockaddr_iso_bc iso_bc[];
1930
};
2031

2132
#endif /* __ISO_H */

0 commit comments

Comments
 (0)