From: Archie Pusaka <apusaka@xxxxxxxxxxxx> "central" is preferred, as reflected on the BT core spec 5.3. --- btio/btio.c | 10 +++++----- lib/l2cap.h | 2 +- profiles/health/mcap.c | 2 +- src/sdpd-server.c | 2 +- tools/l2test.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/btio/btio.c b/btio/btio.c index 1f1c374bca..9c4601e6f8 100644 --- a/btio/btio.c +++ b/btio/btio.c @@ -369,13 +369,13 @@ static int l2cap_set_master(int sock, int master) return -errno; if (master) { - if (flags & L2CAP_LM_MASTER) + if (flags & L2CAP_LM_CENTRAL) return 0; - flags |= L2CAP_LM_MASTER; + flags |= L2CAP_LM_CENTRAL; } else { - if (!(flags & L2CAP_LM_MASTER)) + if (!(flags & L2CAP_LM_CENTRAL)) return 0; - flags &= ~L2CAP_LM_MASTER; + flags &= ~L2CAP_LM_CENTRAL; } if (setsockopt(sock, SOL_L2CAP, L2CAP_LM, &flags, sizeof(flags)) < 0) @@ -1180,7 +1180,7 @@ parse_opts: return FALSE; } *(va_arg(args, gboolean *)) = - (flags & L2CAP_LM_MASTER) ? TRUE : FALSE; + (flags & L2CAP_LM_CENTRAL) ? TRUE : FALSE; break; case BT_IO_OPT_HANDLE: if (l2cap_get_info(sock, &handle, dev_class) < 0) { diff --git a/lib/l2cap.h b/lib/l2cap.h index 9197800df4..a0ea111839 100644 --- a/lib/l2cap.h +++ b/lib/l2cap.h @@ -52,7 +52,7 @@ struct l2cap_conninfo { }; #define L2CAP_LM 0x03 -#define L2CAP_LM_MASTER 0x0001 +#define L2CAP_LM_CENTRAL 0x0001 #define L2CAP_LM_AUTH 0x0002 #define L2CAP_LM_ENCRYPT 0x0004 #define L2CAP_LM_TRUSTED 0x0008 diff --git a/profiles/health/mcap.c b/profiles/health/mcap.c index be13af37a0..ab05a2bc24 100644 --- a/profiles/health/mcap.c +++ b/profiles/health/mcap.c @@ -2426,7 +2426,7 @@ static gboolean get_btrole(struct mcap_mcl *mcl) if (getsockopt(sock, SOL_L2CAP, L2CAP_LM, &flags, &len)) DBG("CSP: could not read role"); - return flags & L2CAP_LM_MASTER; + return flags & L2CAP_LM_CENTRAL; } uint64_t mcap_get_timestamp(struct mcap_mcl *mcl, diff --git a/src/sdpd-server.c b/src/sdpd-server.c index 306b92a44c..c71e2c22da 100644 --- a/src/sdpd-server.c +++ b/src/sdpd-server.c @@ -72,7 +72,7 @@ static int init_server(uint16_t mtu, int master, int compat) } if (master) { - int opt = L2CAP_LM_MASTER; + int opt = L2CAP_LM_CENTRAL; if (setsockopt(l2cap_sock, SOL_L2CAP, L2CAP_LM, &opt, sizeof(opt)) < 0) { error("setsockopt: %s", strerror(errno)); return -1; diff --git a/tools/l2test.c b/tools/l2test.c index 6e07f7b842..822cdc8cc9 100644 --- a/tools/l2test.c +++ b/tools/l2test.c @@ -484,7 +484,7 @@ static int do_connect(char *svr) if (reliable) opt |= L2CAP_LM_RELIABLE; if (master) - opt |= L2CAP_LM_MASTER; + opt |= L2CAP_LM_CENTRAL; if (auth) opt |= L2CAP_LM_AUTH; if (encr) @@ -587,7 +587,7 @@ static void do_listen(void (*handler)(int sk)) if (reliable) opt |= L2CAP_LM_RELIABLE; if (master) - opt |= L2CAP_LM_MASTER; + opt |= L2CAP_LM_CENTRAL; if (auth) opt |= L2CAP_LM_AUTH; if (encr) -- 2.33.0.rc1.237.g0d66db33f3-goog