bluez/doc/hfp-api.txt
Frédéric Danis 3163523575 audio: add profile version to HandsfreeAgent
Some phones with HFP Audio Gateway version previous to 1.5 (e.g.
Samsung SGH-D600 returning 0x0101 as profile version) do not accept an
AT+BRSF with latest features. The Handsfree agent should adapt its
AT+BRSF command depending on the remote version, so add version
information as parameter of NewConnection method.

Here is traces of buggy exchange:

< ACL data: handle 12 flags 0x02 dlen 20
    L2CAP(d): cid 0x0046 len 16 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 10 pf 0 ilen 12 fcs 0xb0
      0000: 41 54 2b 42 52 53 46 3d  31 31 38 0d              AT+BRSF=118.
> ACL data: handle 12 flags 0x02 dlen 18
    L2CAP(d): cid 0x0041 len 14 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 10 pf 1 ilen 9 fcs 0x76 credits 1
      0000: 0d 0a 45 52 52 4f 52 0d  0a                       ..ERROR..
< ACL data: handle 12 flags 0x02 dlen 8
    L2CAP(d): cid 0x0046 len 4 [psm 3]
      RFCOMM(s): DISC: cr 1 dlci 10 pf 1 ilen 0 fcs 0x6d

and after the fix (and corresponding fix in oFono):

< ACL data: handle 12 flags 0x02 dlen 19
    L2CAP(d): cid 0x0048 len 15 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 10 pf 0 ilen 11 fcs 0xb0
      0000: 41 54 2b 42 52 53 46 3d  32 32 0d                 AT+BRSF=22.
> ACL data: handle 12 flags 0x02 dlen 28
    L2CAP(d): cid 0x0041 len 24 [psm 3]
      RFCOMM(d): UIH: cr 0 dlci 10 pf 1 ilen 19 fcs 0x76 credits 1
      0000: 0d 0a 2b 42 52 53 46 3a  20 33 33 0d 0a 0d 0a 4f  ..+BRSF: 33....O
      0010: 4b 0d 0a                                          K..
< ACL data: handle 12 flags 0x02 dlen 18
    L2CAP(d): cid 0x0048 len 14 [psm 3]
      RFCOMM(d): UIH: cr 1 dlci 10 pf 0 ilen 10 fcs 0xb0
      0000: 41 54 2b 43 49 4e 44 3d  3f 0d                    AT+CIND=?.
2011-08-04 14:02:39 +03:00

87 lines
2.4 KiB
Plaintext

Gateway hierarchy
========================
Service org.bluez
Interface org.bluez.HandsfreeGateway
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
This interface is available for remote devices which can function in the Audio
Gateway role of the HFP profiles. It is intended to be used with external
telephony stacks / handlers of the HFP protocol.
Methods void Connect()
Connect to the AG service on the remote device.
void Disconnect()
Disconnect from the AG service on the remote device
dict GetProperties()
Returns all properties for the interface. See the
properties section for available properties.
void RegisterAgent(object path)
The object path defines the path the of the agent
that will be called when a new Handsfree connection
is established.
If an application disconnects from the bus all of its
registered agents will be removed.
void UnregisterAgent(object path)
This unregisters the agent that has been previously
registered. The object path parameter must match the
same value that has been used on registration.
Possible Errors: org.bluez.Error.Failed
org.bluez.Error.InvalidArguments
Signals PropertyChanged(string name, variant value)
This signal indicates a changed value of the given
property.
Properties string State [readonly]
Indicates the state of the connection. Possible
values are:
"disconnected"
"connecting"
"connected"
"playing"
HandsfreeAgent hierarchy
===============
Service unique name
Interface org.bluez.HandsfreeAgent
Object path freely definable
Methods void NewConnection(filedescriptor fd, uint16 version)
This method gets called whenever a new handsfree
connection has been established. The objectpath
contains the object path of the remote device. This
method assumes that DBus daemon with file descriptor
passing capability is being used.
The agent should only return successfully once the
establishment of the service level connection (SLC)
has been completed. In the case of Handsfree this
means that BRSF exchange has been performed and
necessary initialization has been done.
Possible Errors: org.bluez.Error.InvalidArguments
org.bluez.Error.Failed
void Release()
This method gets called whenever the service daemon
unregisters the agent or whenever the Adapter where
the HandsfreeAgent registers itself is removed.