agent-api.txt 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. BlueZ D-Bus Agent API description
  2. **********************************
  3. Agent Manager hierarchy
  4. =======================
  5. Service org.bluez
  6. Interface org.bluez.AgentManager1
  7. Object path /org/bluez
  8. void RegisterAgent(object agent, string capability)
  9. This registers an agent handler.
  10. The object path defines the path of the agent
  11. that will be called when user input is needed.
  12. Every application can register its own agent and
  13. for all actions triggered by that application its
  14. agent is used.
  15. It is not required by an application to register
  16. an agent. If an application does chooses to not
  17. register an agent, the default agent is used. This
  18. is on most cases a good idea. Only application
  19. like a pairing wizard should register their own
  20. agent.
  21. An application can only register one agent. Multiple
  22. agents per application is not supported.
  23. The capability parameter can have the values
  24. "DisplayOnly", "DisplayYesNo", "KeyboardOnly",
  25. "NoInputNoOutput" and "KeyboardDisplay" which
  26. reflects the input and output capabilities of the
  27. agent.
  28. If an empty string is used it will fallback to
  29. "KeyboardDisplay".
  30. Possible errors: org.bluez.Error.InvalidArguments
  31. org.bluez.Error.AlreadyExists
  32. void UnregisterAgent(object agent)
  33. This unregisters the agent that has been previously
  34. registered. The object path parameter must match the
  35. same value that has been used on registration.
  36. Possible errors: org.bluez.Error.DoesNotExist
  37. void RequestDefaultAgent(object agent)
  38. This requests is to make the application agent
  39. the default agent. The application is required
  40. to register an agent.
  41. Special permission might be required to become
  42. the default agent.
  43. Possible errors: org.bluez.Error.DoesNotExist
  44. Agent hierarchy
  45. ===============
  46. Service unique name
  47. Interface org.bluez.Agent1
  48. Object path freely definable
  49. Methods void Release()
  50. This method gets called when the service daemon
  51. unregisters the agent. An agent can use it to do
  52. cleanup tasks. There is no need to unregister the
  53. agent, because when this method gets called it has
  54. already been unregistered.
  55. string RequestPinCode(object device)
  56. This method gets called when the service daemon
  57. needs to get the passkey for an authentication.
  58. The return value should be a string of 1-16 characters
  59. length. The string can be alphanumeric.
  60. Possible errors: org.bluez.Error.Rejected
  61. org.bluez.Error.Canceled
  62. void DisplayPinCode(object device, string pincode)
  63. This method gets called when the service daemon
  64. needs to display a pincode for an authentication.
  65. An empty reply should be returned. When the pincode
  66. needs no longer to be displayed, the Cancel method
  67. of the agent will be called.
  68. This is used during the pairing process of keyboards
  69. that don't support Bluetooth 2.1 Secure Simple Pairing,
  70. in contrast to DisplayPasskey which is used for those
  71. that do.
  72. This method will only ever be called once since
  73. older keyboards do not support typing notification.
  74. Note that the PIN will always be a 6-digit number,
  75. zero-padded to 6 digits. This is for harmony with
  76. the later specification.
  77. Possible errors: org.bluez.Error.Rejected
  78. org.bluez.Error.Canceled
  79. uint32 RequestPasskey(object device)
  80. This method gets called when the service daemon
  81. needs to get the passkey for an authentication.
  82. The return value should be a numeric value
  83. between 0-999999.
  84. Possible errors: org.bluez.Error.Rejected
  85. org.bluez.Error.Canceled
  86. void DisplayPasskey(object device, uint32 passkey,
  87. uint16 entered)
  88. This method gets called when the service daemon
  89. needs to display a passkey for an authentication.
  90. The entered parameter indicates the number of already
  91. typed keys on the remote side.
  92. An empty reply should be returned. When the passkey
  93. needs no longer to be displayed, the Cancel method
  94. of the agent will be called.
  95. During the pairing process this method might be
  96. called multiple times to update the entered value.
  97. Note that the passkey will always be a 6-digit number,
  98. so the display should be zero-padded at the start if
  99. the value contains less than 6 digits.
  100. void RequestConfirmation(object device, uint32 passkey)
  101. This method gets called when the service daemon
  102. needs to confirm a passkey for an authentication.
  103. To confirm the value it should return an empty reply
  104. or an error in case the passkey is invalid.
  105. Note that the passkey will always be a 6-digit number,
  106. so the display should be zero-padded at the start if
  107. the value contains less than 6 digits.
  108. Possible errors: org.bluez.Error.Rejected
  109. org.bluez.Error.Canceled
  110. void RequestAuthorization(object device)
  111. This method gets called to request the user to
  112. authorize an incoming pairing attempt which
  113. would in other circumstances trigger the just-works
  114. model, or when the user plugged in a device that
  115. implements cable pairing. In the latter case, the
  116. device would not be connected to the adapter via
  117. Bluetooth yet.
  118. Possible errors: org.bluez.Error.Rejected
  119. org.bluez.Error.Canceled
  120. void AuthorizeService(object device, string uuid)
  121. This method gets called when the service daemon
  122. needs to authorize a connection/service request.
  123. Possible errors: org.bluez.Error.Rejected
  124. org.bluez.Error.Canceled
  125. void Cancel()
  126. This method gets called to indicate that the agent
  127. request failed before a reply was returned.