Bluetooth: Use the new l2cap socket address type

This commit is contained in:
Brennan Ashton 2020-08-29 10:44:24 -07:00 committed by patacongo
parent b989914b16
commit 14c6d976fc
2 changed files with 4 additions and 4 deletions

View File

@ -71,7 +71,7 @@ struct btsak_s
FAR char *ifname; /* Interface name */
bt_addr_t ep_btaddr; /* Blue tooth address */
#if defined(CONFIG_NET_BLUETOOTH)
struct sockaddr_bt_s ep_sockaddr; /* AF_BLUETOOTH endpoint address */
struct sockaddr_l2 ep_sockaddr; /* AF_BLUETOOTH endpoint address */
#elif defined(CONFIG_NET_6LOWPAN)
struct sockaddr_in6 ep_sockaddr; /* IPv6 endpoint address */
#endif

View File

@ -626,9 +626,9 @@ int btsak_socket(FAR struct btsak_s *btsak)
BLUETOOTH_ADDRCOPY(btsak->ep_btaddr.val, g_default_epaddr.val);
#if defined(CONFIG_NET_BLUETOOTH)
btsak->ep_sockaddr.bt_family = AF_BLUETOOTH;
btsak->ep_sockaddr.bt_channel = 0; /* REVISIT */
BLUETOOTH_ADDRCOPY(btsak->ep_sockaddr.bt_bdaddr.val, btsak->ep_btaddr.val);
btsak->ep_sockaddr.l2_family = AF_BLUETOOTH;
btsak->ep_sockaddr.l2_cid = 0; /* REVISIT */
BLUETOOTH_ADDRCOPY(btsak->ep_sockaddr.l2_bdaddr.val, btsak->ep_btaddr.val);
sockfd = socket(PF_BLUETOOTH, SOCK_RAW, BTPROTO_L2CAP);