📄 dbus-api.txt
字号:
Possible error: org.bluez.Error.InvalidArguments array{uint32} GetRemoteServiceHandles(string address, string match) This method will request the SDP database of a remote device and retrieve the service record handles. To request service browse send an empty match string. Possible errors: org.bluez.Error.InvalidArguments org.bluez.Error.InProgress org.bluez.Error.ConnectionAttemptFailed org.bluez.Error.Failed array{byte} GetRemoteServiceRecord(string address, uint32 handle) This method will request the SDP database of a remote device for a service record and return the binary stream of it. Possible errors: org.bluez.Error.InvalidArguments org.bluez.Error.InProgress org.bluez.Error.Failed string GetRemoteServiceRecordAsXML(string address, uint32 handle) This method will request the SDP database of a remote device for a service record and return its data in XML format. Possible errors: org.bluez.Error.InvalidArguments org.bluez.Error.InProgress org.bluez.Error.Failed array{string} GetRemoteServiceIdentifiers(string address) This method will request the SDP database of a remote device for all supported services. The identifiers are returned in UUID 128 string format. Possible errors: org.bluez.Error.InProgress org.bluez.Error.Failed void FinishRemoteServiceTransaction(string address) This method will finish all SDP transaction for that given address. In general this call is not needed, but in cases of resources restricted devices it is useful to call this to finish the SDP transaction before proceeded with profile specific connections. array{string} ListRemoteDevices() List addresses of all known remote devices (bonded, trusted and used). Possible errors: none array{string} ListRecentRemoteDevices(string date) List addresses of all bonded, trusted, seen or used remote devices since date. Bonded and trusted devices are always included(the date informed is not applied). date format is "YYYY-MM-DD HH:MM:SS GMT" Possible errors: noneSignals void ModeChanged(string mode) If the current mode is changed with SetMode this signal will inform about the new mode. This signal can also be triggered by low-level HCI commands. void DiscoverableTimeoutChanged(uint32 timeout) After changing the discoverable timeout this signal provide the new timeout value. void MinorClassChanged(string minor) After changing the minor class with SetMinorClass this signal will provide the new class value. void NameChanged(string name) After changing the local adapter name with SetName this signal will provide the new name. This signal can also be triggered by low-level HCI commands. void DiscoveryStarted() This signal indicates that a device discovery procedure has been started. void DiscoveryCompleted() This signal indicates that a device discovery procedure has been completed. void PeriodicDiscoveryStarted() This signal indicates that a periodic discovery procedure has been started. void PeriodicDiscoveryStopped() This signal indicates that a periodic discovery procedure has been completed. void RemoteDeviceFound(string address, uint32 class, int16 rssi) This signal will be send every time an inquiry result has been found by the service daemon. In general they only appear during a device discovery. void RemoteDeviceDisappeared(string address) This signal will be send when an inquiry session for a periodic discovery finishes and previously found devices are no longer in range or visible. void RemoteClassUpdated(string address, uint32 class) This signal will be send every time the remote class of device has been changed. This happens for example after a remote connection attempt. This signal will not be send if the class of device hasn't changed compared to cached one. void RemoteNameUpdated(string address, string name) This signal will be send every time the service daemon detect a new name for a remote device. void RemoteIdentifiersUpdated(string address, array{string identifiers}) This signal is sent to indicate the provided services of a given remote device. It will be sent after GetRemoteServiceIdentifiers calls. This signal has at least one identifier and it does not contain repeated entries. void RemoteNameFailed(string address) This signal will be sent every time the service daemon tries to resolve a remote and this fails. void RemoteNameRequested(string address) This signal will be sent every time the service daemon tries to resolve a remote name during discovery. void RemoteAliasChanged(string address, string alias) After changing an alias with SetRemoteAlias this signal will indicate the new alias. void RemoteAliasCleared(string address) After removing an alias with ClearRemoteAlias this signal will indicate that the alias is no longer valid. void RemoteDeviceConnected(string address) This signal will be send if a low level connection between two devices has been created. void RemoteDeviceDisconnectRequested(string address) This signal will be sent when a low level disconnection to a remote device has been requested. The actual disconnection will happen 2 seconds later. void RemoteDeviceDisconnected(string address) This signal will be send if a low level connection between two devices has been terminated. void BondingCreated(string address) Signals that a successful bonding has been created. void BondingRemoved(string address) Signals that a bonding was removed. void TrustAdded(string address) Sent when SetTrusted() is called. void TrustRemoved(string address) Sent when RemoveTrust() is called.Service hierarchy=================Service org.bluezInterface org.bluez.ServiceObject path path from org.bluez.Manager.ListServices()Methods dict GetInfo() Returns the service properties. string GetIdentifier() This method returns the service identifier. string GetName() This method returns the service name. string GetDescription() This method returns the service description. string GetBusName() [experimental] Returns the unique bus name of the service if it has been started. Possible errors: org.bluez.Error.NotAvailable void Start() This method tells the system to start the service. void Stop() This method tells the system to stop the service. boolean IsRunning() Returns true if the service has been started and is currently active. Otherwise, it returns false. boolean IsExternal() Returns true if the service was registered using the Database.RegisterService method instead of a .service file. The Start and Stop methods are not applicable to external services and will return an error. array{string} ListTrusts() [experimental] Returns a list of remote devices that are trusted for the service. void SetTrusted(string address) [experimental] Marks the user as trusted. Possible errors: org.bluez.Error.InvalidArguments org.bluez.Error.AlreadyExists boolean IsTrusted(string address) [experimental] Returns true if the user is trusted or false otherwise. The address parameter must match one of the current users of the service. Possible errors: org.bluez.Error.InvalidArguments void RemoveTrust(string address) [experimental] Marks the user as not trusted. Possible errors: org.bluez.Error.InvalidArguments org.bluez.Error.DoesNotExistSignals void Started() The object path of this signal contains which service was started. void Stopped() The object path of this signal contains which service was stopped. void TrustAdded(string address) Sent when SetTrusted() is called. void TrustRemoved(string address) Sent when RemoveTrust() is called.Security hierarchy==================Service org.bluezInterface org.bluez.SecurityObject path /org/bluez or /org/bluez/{hci0,hci1,...}Methods void RegisterDefaultPasskeyAgent(string path) This registers the default passkey agent. It can register a passkey for all adapters or for a specific device depending on with object path has been used. The path parameter defines the object path of the passkey agent that will be called when a passkey needs to be entered. If an application disconnects from the bus all registered passkey agent will be removed. Possible errors: org.bluez.Error.AlreadyExists void UnregisterDefaultPasskeyAgent(string path) This unregisters a default passkey agent that has been previously registered. The object path and the path parameter must match the same values that has been used on registration. Possible errors: org.bluez.Error.DoesNotExist void RegisterPasskeyAgent(string path, string address) This registers the application passkey agent that will be used for any application specific passkey tasks. The path parameter defines the object path of the passkey agent that will be called when a passkey needs to be entered. The address defines the remote device that it will answer passkey requests for. If an application disconnects from the bus all registered passkey agent will be removed. It will also be unregistered after a timeout and if the pairing succeeds or fails. The application has to take care of that it reregisters the passkey agent. Possible errors: org.bluez.Error.AlreadyExists void UnregisterPasskeyAgent(string path, string address) This unregisters a passkey agent that has been previously registered. The object path and the path and address parameter must match the same values that has been used on registration. The method is actually only needed if an application wants to removed the passkey agent and don't wanna wait for the automatic timeout. Possible errors: org.bluez.Error.DoesNotExist void RegisterDefaultAuthorizationAgent(string path) This registers the default authorization agent. It can register an authorization agent for all adapters or for a specific one depending on which object path has been used. The path parameter defines the object path of the authorization agent that will be called when an authorization request needs to be answered. void UnregisterDefaultAuthorizationAgent(string path) This unregisters a default authorization agent that has been previously registered. The path parameter must match the same value that has been used on registration.PasskeyAgent hierarchy======================Service unique nameInterface org.bluez.PasskeyAgentObject path freely definableMethods string Request(string path, string address, boolean numeric) This method gets called when the service daemon needs to get the passkey for an authentication. The return value is actual passkey. The first argument contains the path of the local adapter and the second one the remote address. The third argument signals if a numeric PIN code is expected or not. The default is a 1 to 16 byte PIN code in UTF-8 format. Possible errors: org.bluez.Error.Rejected org.bluez.Error.Canceled void Confirm(string path, string address, string value) This method gets called when the service daemon needs to verify a passkey. The verification is done by showing the value to the passkey agent and returning means a successful confirmation. In case the values don't match an error must be returned. Possible errors: org.bluez.Error.Rejected org.bluez.Error.Canceled void Display(string path, string address, string value) This method gets called when the service daemon needs to display the passkey value. No return value is needed. A successful paring will be indicated by the Complete method and a failure will be signaled with Cancel. void Keypress(string path, string address) This method indicates keypresses from the remote device. This can happen when pairing with a keyboard. void Complete(string path, string address) This method gets called to indicate that the authentication has been completed. void Cancel(string path, string address) This method gets called to indicate that the authentication request failed before a reply was returned by the Request method. void Release() This method gets called when the service daemon unregisters a passkey agent. An agent can use it to do cleanup tasks. There is no need to unregister the agent, because when this method gets called it has already been unregistered.AuthorizationAgent hierarchy (experimental)===========================================Service unique nameInterface org.bluez.AuthorizationAgentObject path freely definableMethods void Authorize(string adapter_path, string address, string service_path, string uuid) This method gets called when the service daemon wants to get an authorization for accessing a service. This method should return if the remote user is granted access or an error otherwise. The adapter_path parameter is the object path of the local adapter. The address, service_path and action parameters correspond to the remote device address, the object path of the service and the uuid of the profile. Possible errors: org.bluez.Error.Rejected org.bluez.Error.Canceled void Cancel(string adapter_path, string address, string service_path, string uuid) This method cancels a previous authorization request. The adapter_path, address, service_path and uuid parameters must match the same values that have been used when the Authorize() method was called. void Release() This method gets called when the service daemon unregisters an authorization agent. An agent can use it to do cleanup tasks. There is no need to unregister the agent, because when this method gets called it has already been unregistered.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -