All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bluez.GattCharacteristic1 Maven / Gradle / Ivy

There is a newer version: 0.3.0
Show newest version
package org.bluez;

import java.io.FileDescriptor;
import java.util.Map;

import org.bluez.datatypes.TwoTuple;
import org.bluez.exceptions.BluezFailedException;
import org.bluez.exceptions.BluezInProgressException;
import org.bluez.exceptions.BluezInvalidOffsetException;
import org.bluez.exceptions.BluezInvalidValueLengthException;
import org.bluez.exceptions.BluezNotAuthorizedException;
import org.bluez.exceptions.BluezNotPermittedException;
import org.bluez.exceptions.BluezNotSupportedException;
import org.freedesktop.dbus.interfaces.DBusInterface;
import org.freedesktop.dbus.interfaces.Properties;
import org.freedesktop.dbus.types.UInt16;
import org.freedesktop.dbus.types.Variant;

/**
 * File generated - 2018-07-25.
* Based on bluez Documentation: gatt-api.txt.
*
* Service: org.bluez
* Interface: org.bluez.GattCharacteristic1
*
* Object path:
* [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX/charYYYY
*
* Supported properties:
*
* string UUID [read-only]
*
* 128-bit characteristic UUID.
*
* object Service [read-only]
*
* Object path of the GATT service the characteristic
* belongs to.
*
* array{byte} Value [read-only, optional]
*
* The cached value of the characteristic. This property
* gets updated only after a successful read request and
* when a notification or indication is received, upon
* which a PropertiesChanged signal will be emitted.
*
* boolean WriteAcquired [read-only, optional]
*
* True, if this characteristic has been acquired by any
* client using AcquireWrite.
*
* For client properties is ommited in case
* 'write-without-response' flag is not set.
*
* For server the presence of this property indicates
* that AcquireWrite is supported.
*
* boolean NotifyAcquired [read-only, optional]
*
* True, if this characteristic has been acquired by any
* client using AcquireNotify.
*
* For client this properties is ommited in case 'notify'
* flag is not set.
*
* For server the presence of this property indicates
* that AcquireNotify is supported.
*
* boolean Notifying [read-only, optional]
*
* True, if notifications or indications on this
* characteristic are currently enabled.
*
* array{string} Flags [read-only]
*
* Defines how the characteristic value can be used. See
* Core spec "Table 3.5: Characteristic Properties bit
* field", and "Table 3.8: Characteristic Extended
* Properties bit field". Allowed values:
*
* "broadcast"
* "read"
* "write-without-response"
* "write"
* "notify"
* "indicate"
* "authenticated-signed-writes"
* "reliable-write"
* "writable-auxiliaries"
* "encrypt-read"
* "encrypt-write"
* "encrypt-authenticated-read"
* "encrypt-authenticated-write"
* "secure-read" (Server only)
* "secure-write" (Server only)
* "authorize"
*
*
*/ public interface GattCharacteristic1 extends DBusInterface, Properties { /** * From bluez documentation:
*
* Issues a request to read the value of the
* characteristic and returns the value if the
* operation was successful.
*
* Possible options: "offset": uint16 offset
* "device": Object Device (Server only)
*
* * @param _options * * @throws BluezFailedException on failure * @throws BluezInProgressException when operation already in progress * @throws BluezNotPermittedException * @throws BluezNotAuthorizedException when not authorized * @throws BluezInvalidOffsetException * @throws BluezNotSupportedException when operation not supported */ byte[] ReadValue(Map> _options) throws BluezFailedException, BluezInProgressException, BluezNotPermittedException, BluezNotAuthorizedException, BluezInvalidOffsetException, BluezNotSupportedException; /** * From bluez documentation:
*
* Issues a request to write the value of the
* characteristic.
*
* Possible options: "offset": Start offset
* "device": Device path (Server only)
* "link": Link type (Server only)
* "prepare-authorize": boolean Is prepare request
*
* * @param _value * @param _options * * @throws BluezFailedException on failure * @throws BluezInProgressException when operation already in progress * @throws BluezNotPermittedException * @throws BluezInvalidValueLengthException * @throws BluezNotAuthorizedException when not authorized * @throws BluezNotSupportedException when operation not supported */ void WriteValue(byte[] _value, Map> _options) throws BluezFailedException, BluezInProgressException, BluezNotPermittedException, BluezInvalidValueLengthException, BluezNotAuthorizedException, BluezNotSupportedException; /** * From bluez documentation:
*
* Acquire file descriptor and MTU for writing. Usage of
* WriteValue will be locked causing it to return
* NotPermitted error.
*
* For server the MTU returned shall be equal or smaller
* than the negotiated MTU.
*
* For client it only works with characteristic that has
* WriteAcquired property which relies on
* write-without-response Flag.
*
* To release the lock the client shall close the file
* descriptor, a HUP is generated in case the device
* is disconnected.
*
* Note: the MTU can only be negotiated once and is
* symmetric therefore this method may be delayed in
* order to have the exchange MTU completed, because of
* that the file descriptor is closed during
* reconnections as the MTU has to be renegotiated.
*
* Possible options: "device": Object Device (Server only)
* "MTU": Exchanged MTU (Server only)
* "link": Link type (Server only)
*
* * @param _options * * @throws BluezFailedException on failure * @throws BluezNotSupportedException when operation not supported */ TwoTuple AcquireWrite(Map> _options) throws BluezFailedException, BluezNotSupportedException; /** * From bluez documentation:
*
* Acquire file descriptor and MTU for notify. Usage of
* StartNotify will be locked causing it to return
* NotPermitted error.
*
* For server the MTU returned shall be equal or smaller
* than the negotiated MTU.
*
* Only works with characteristic that has NotifyAcquired
* which relies on notify Flag and no other client have
* called StartNotify.
*
* Notification are enabled during this procedure so
* StartNotify shall not be called, any notification
* will be dispatched via file descriptor therefore the
* Value property is not affected during the time where
* notify has been acquired.
*
* To release the lock the client shall close the file
* descriptor, a HUP is generated in case the device
* is disconnected.
*
* Note: the MTU can only be negotiated once and is
* symmetric therefore this method may be delayed in
* order to have the exchange MTU completed, because of
* that the file descriptor is closed during
* reconnections as the MTU has to be renegotiated.
*
* Possible options: "device": Object Device (Server only)
* "MTU": Exchanged MTU (Server only)
* "link": Link type (Server only)
*
* * @param _options * * @throws BluezFailedException on failure * @throws BluezNotSupportedException when operation not supported */ TwoTuple AcquireNotify(Map> _options) throws BluezFailedException, BluezNotSupportedException; /** * From bluez documentation:
*
* Starts a notification session from this characteristic
* if it supports value notifications or indications.
*
* * @throws BluezFailedException on failure * @throws BluezNotPermittedException * @throws BluezInProgressException when operation already in progress * @throws BluezNotSupportedException when operation not supported */ void StartNotify() throws BluezFailedException, BluezNotPermittedException, BluezInProgressException, BluezNotSupportedException; /** * From bluez documentation:
*
* This method will cancel any previous StartNotify
* transaction. Note that notifications from a
* characteristic are shared between sessions thus
* calling StopNotify will release a single session.
*
* * @throws BluezFailedException on failure */ void StopNotify() throws BluezFailedException; /** * From bluez documentation:
*
* This method doesn't expect a reply so it is just a
* confirmation that value was received.
*
* * @throws BluezFailedException on failure */ void Confirm() throws BluezFailedException; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy