Skip to contentSkip to conversation

mgmt-api.txt

DISCUSSION Randy Yates 2 participants 4 messages Feb 18, 2013 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Almost all text files in doc/ are consistently-documented dbus APIs, specifying service, interface, and object path.

However, doc/mgmt-api.txt is in a completely different format. It states something about "Packet Structures" but I have no idea which packets the document is referring to.

Can someone explain how to use this API? We have a requirement to set some of these properties, such as discoverability and link level security.

Signature · 3 lines
Randy Yates
Digital Signal Labs
http://www.digitalsignallabs.com
#1 lore raw

Hi Randy,

Quoted 10 lines · Randy Yates

Almost all text files in doc/ are consistently-documented dbus APIs, specifying service, interface, and object path.

However, doc/mgmt-api.txt is in a completely different format. It states something about "Packet Structures" but I have no idea which packets the document is referring to.

Can someone explain how to use this API? We have a requirement to set some of these properties, such as discoverability and link level security.

This is just a special socket type that kernel versions from 3.4 onwards provide. See e.g. the mgmt_new_default() function in src/shared/mgmt.c for an example of creating a mgmt socket that you can use to communicate using the protocol described in mgmt-api.txt. There are also several tools in the source tree that use mgmt sockets, e.g. tools/btmgmt client/bluetoothctl and monitor/btmon. Looking at the source code for those tools may also be helpful.

Johan

#2 lore raw

Hi,

Quoted 12 lines · Johan Hedberg
Quoted 10 lines · Randy Yates

Almost all text files in doc/ are consistently-documented dbus APIs, specifying service, interface, and object path.

However, doc/mgmt-api.txt is in a completely different format. It states something about "Packet Structures" but I have no idea which packets the document is referring to.

Can someone explain how to use this API? We have a requirement to set some of these properties, such as discoverability and link level security.

Quoted 7 lines

This is just a special socket type that kernel versions from 3.4 onwards provide. See e.g. the mgmt_new_default() function in src/shared/mgmt.c for an example of creating a mgmt socket that you can use to communicate using the protocol described in mgmt-api.txt. There are also several tools in the source tree that use mgmt sockets, e.g. tools/btmgmt client/bluetoothctl and monitor/btmon. Looking at the source code for those tools may also be helpful.

Minor mistake there: bluetoothctl doesn't use mgmt sockets (it uses just the D-Bus interface). I also went ahead and pushed a description of how to create mgmt sockets to mgmt-api.txt since this was a quite obvious omission in the file. Another file you'll probably find useful is lib/mgmt.h which has structs and numerical definitions for the mgmt protocol.

Johan

#3 lore raw

Thanks much, Johan. That clarifies things nicely.

--Randy

Quoted 35 lines · Johan Hedberg

Hi,

Quoted 12 lines · Johan Hedberg
Quoted 10 lines · Randy Yates

Almost all text files in doc/ are consistently-documented dbus APIs, specifying service, interface, and object path.

However, doc/mgmt-api.txt is in a completely different format. It states something about "Packet Structures" but I have no idea which packets the document is referring to.

Can someone explain how to use this API? We have a requirement to set some of these properties, such as discoverability and link level security.

Quoted 7 lines

This is just a special socket type that kernel versions from 3.4 onwards provide. See e.g. the mgmt_new_default() function in src/shared/mgmt.c for an example of creating a mgmt socket that you can use to communicate using the protocol described in mgmt-api.txt. There are also several tools in the source tree that use mgmt sockets, e.g. tools/btmgmt client/bluetoothctl and monitor/btmon. Looking at the source code for those tools may also be helpful.

Minor mistake there: bluetoothctl doesn't use mgmt sockets (it uses just the D-Bus interface). I also went ahead and pushed a description of how to create mgmt sockets to mgmt-api.txt since this was a quite obvious omission in the file. Another file you'll probably find useful is lib/mgmt.h which has structs and numerical definitions for the mgmt protocol.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Randy Yates
Digital Signal Labs
http://www.digitalsignallabs.com