io.qt.bluetooth.QLowEnergyService Maven / Gradle / Ivy
package io.qt.bluetooth;
import io.qt.*;
/**
* Represents an individual service on a Bluetooth Low Energy Device
* Java wrapper for Qt class QLowEnergyService
*/
public final class QLowEnergyService extends io.qt.core.QObject
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* This variable stores the meta-object for the class.
*/
public static final io.qt.core.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QLowEnergyService.class);
/**
* Java wrapper for Qt enum QLowEnergyService::DiscoveryMode
*/
public enum DiscoveryMode implements QtEnumerator {
/**
* Representing QLowEnergyService:: FullDiscovery
*/
FullDiscovery(0),
/**
* Representing QLowEnergyService:: SkipValueDiscovery
*/
SkipValueDiscovery(1);
static {
QtJambi_LibraryUtilities.initialize();
}
private DiscoveryMode(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull DiscoveryMode resolve(int value) {
switch (value) {
case 0: return FullDiscovery;
case 1: return SkipValueDiscovery;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QLowEnergyService::ServiceError
*/
public enum ServiceError implements QtEnumerator {
/**
* Representing QLowEnergyService:: NoError
*/
NoError(0),
/**
* Representing QLowEnergyService:: OperationError
*/
OperationError(1),
/**
* Representing QLowEnergyService:: CharacteristicWriteError
*/
CharacteristicWriteError(2),
/**
* Representing QLowEnergyService:: DescriptorWriteError
*/
DescriptorWriteError(3),
/**
* Representing QLowEnergyService:: UnknownError
*/
UnknownError(4),
/**
* Representing QLowEnergyService:: CharacteristicReadError
*/
CharacteristicReadError(5),
/**
* Representing QLowEnergyService:: DescriptorReadError
*/
DescriptorReadError(6);
static {
QtJambi_LibraryUtilities.initialize();
}
private ServiceError(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull ServiceError resolve(int value) {
switch (value) {
case 0: return NoError;
case 1: return OperationError;
case 2: return CharacteristicWriteError;
case 3: return DescriptorWriteError;
case 4: return UnknownError;
case 5: return CharacteristicReadError;
case 6: return DescriptorReadError;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QLowEnergyService::ServiceState
*/
@QtRejectedEntries({"DiscoveryRequired", "DiscoveringService", "ServiceDiscovered"})
public enum ServiceState implements QtEnumerator {
/**
* Representing QLowEnergyService:: InvalidService
*/
InvalidService(0),
/**
* Representing QLowEnergyService:: RemoteService
*/
RemoteService(1),
/**
* Representing QLowEnergyService:: RemoteServiceDiscovering
*/
RemoteServiceDiscovering(2),
/**
* Representing QLowEnergyService:: RemoteServiceDiscovered
*/
RemoteServiceDiscovered(3),
/**
* Representing QLowEnergyService:: LocalService
*/
LocalService(4),
@Deprecated
/**
* Representing QLowEnergyService:: DiscoveryRequired
* @deprecated DiscoveryRequired was renamed to RemoteService.
*/
DiscoveryRequired(1),
@Deprecated
/**
* Representing QLowEnergyService:: DiscoveringService
* @deprecated DiscoveringService was renamed to RemoteServiceDiscovering.
*/
DiscoveringService(2),
@Deprecated
/**
* Representing QLowEnergyService:: ServiceDiscovered
* @deprecated ServiceDiscovered was renamed to RemoteServiceDiscovered.
*/
ServiceDiscovered(3);
static {
QtJambi_LibraryUtilities.initialize();
}
private ServiceState(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull ServiceState resolve(int value) {
switch (value) {
case 0: return InvalidService;
case 1: return RemoteService;
case 2: return RemoteServiceDiscovering;
case 3: return RemoteServiceDiscovered;
case 4: return LocalService;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* Java wrapper for Qt enum QLowEnergyService::ServiceType
*
* @see ServiceTypes
*/
public enum ServiceType implements QtFlagEnumerator {
/**
* Representing QLowEnergyService:: PrimaryService
*/
PrimaryService(1),
/**
* Representing QLowEnergyService:: IncludedService
*/
IncludedService(2);
static {
QtJambi_LibraryUtilities.initialize();
}
private ServiceType(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public @NonNull ServiceTypes asFlags() {
return new ServiceTypes(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull ServiceTypes combined(@NonNull ServiceType e) {
return asFlags().setFlag(e, true);
}
/**
* Excludes other enum entry from a flag of this entry.
* @param e enum entry
* @return new flag
*/
public @NonNull ServiceTypes cleared(@NonNull ServiceType e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link ServiceTypes} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull ServiceTypes flags(@Nullable ServiceType @NonNull... values) {
return new ServiceTypes(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull ServiceType resolve(int value) {
switch (value) {
case 1: return PrimaryService;
case 2: return IncludedService;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link ServiceType}
*/
public static final class ServiceTypes extends QFlags implements Comparable {
private static final long serialVersionUID = 0xb6014974a8ba79a0L;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new ServiceTypes where the flags in args
are set.
* @param args enum entries
*/
public ServiceTypes(@Nullable ServiceType @NonNull... args){
super(args);
}
/**
* Creates a new ServiceTypes with given value
.
* @param value
*/
public ServiceTypes(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new ServiceTypes
*/
@Override
public final @NonNull ServiceTypes combined(@StrictNonNull ServiceType e){
return new ServiceTypes(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final @NonNull ServiceTypes setFlag(@Nullable ServiceType e){
return setFlag(e, true);
}
/**
* Sets or clears the flag flag
* @param e enum entry
* @param on set (true) or clear (false)
* @return this
*/
public final @NonNull ServiceTypes setFlag(@Nullable ServiceType e, boolean on){
if (on) {
setValue(value() | e.value());
}else {
setValue(value() & ~e.value());
}
return this;
}
/**
* Returns an array of flag objects represented by this ServiceTypes.
* @return array of enum entries
*/
@Override
public final @NonNull ServiceType @NonNull[] flags(){
return super.flags(ServiceType.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull ServiceTypes clone(){
return new ServiceTypes(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull ServiceTypes other){
return Integer.compare(value(), other.value());
}
}
/**
* Java wrapper for Qt enum QLowEnergyService::WriteMode
*/
public enum WriteMode implements QtEnumerator {
/**
* Representing QLowEnergyService:: WriteWithResponse
*/
WriteWithResponse(0),
/**
* Representing QLowEnergyService:: WriteWithoutResponse
*/
WriteWithoutResponse(1),
/**
* Representing QLowEnergyService:: WriteSigned
*/
WriteSigned(2);
static {
QtJambi_LibraryUtilities.initialize();
}
private WriteMode(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull WriteMode resolve(int value) {
switch (value) {
case 0: return WriteWithResponse;
case 1: return WriteWithoutResponse;
case 2: return WriteSigned;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* See QLowEnergyService:: characteristicChanged(QLowEnergyCharacteristic, QByteArray)
*/
public final @NonNull Signal2 characteristicChanged = new Signal2<>();
/**
* See QLowEnergyService:: characteristicRead(QLowEnergyCharacteristic, QByteArray)
*/
public final @NonNull Signal2 characteristicRead = new Signal2<>();
/**
* See QLowEnergyService:: characteristicWritten(QLowEnergyCharacteristic, QByteArray)
*/
public final @NonNull Signal2 characteristicWritten = new Signal2<>();
/**
* See QLowEnergyService:: descriptorRead(QLowEnergyDescriptor, QByteArray)
*/
public final @NonNull Signal2 descriptorRead = new Signal2<>();
/**
* See QLowEnergyService:: descriptorWritten(QLowEnergyDescriptor, QByteArray)
*/
public final @NonNull Signal2 descriptorWritten = new Signal2<>();
/**
* See QLowEnergyService:: errorOccurred(QLowEnergyService::ServiceError)
*/
public final @NonNull Signal1 errorOccurred = new Signal1<>();
/**
* See QLowEnergyService:: stateChanged(QLowEnergyService::ServiceState)
*/
public final @NonNull Signal1 stateChanged = new Signal1<>();
/**
* See QLowEnergyService:: characteristic(QBluetoothUuid)const
*/
@QtUninvokable
public final io.qt.bluetooth.@NonNull QLowEnergyCharacteristic characteristic(io.qt.bluetooth.@NonNull QBluetoothUuid uuid){
return characteristic_native_cref_QBluetoothUuid_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(uuid));
}
@QtUninvokable
private native io.qt.bluetooth.QLowEnergyCharacteristic characteristic_native_cref_QBluetoothUuid_constfct(long __this__nativeId, long uuid);
/**
* See QLowEnergyService:: characteristics()const
*/
@QtUninvokable
public final io.qt.core.@NonNull QList characteristics(){
return characteristics_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QList characteristics_native_constfct(long __this__nativeId);
/**
* See QLowEnergyService:: contains(QLowEnergyCharacteristic)const
*/
@QtUninvokable
public final boolean contains(io.qt.bluetooth.@NonNull QLowEnergyCharacteristic characteristic){
return contains_native_cref_QLowEnergyCharacteristic_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(characteristic));
}
@QtUninvokable
private native boolean contains_native_cref_QLowEnergyCharacteristic_constfct(long __this__nativeId, long characteristic);
/**
* See QLowEnergyService:: contains(QLowEnergyDescriptor)const
*/
@QtUninvokable
public final boolean contains(io.qt.bluetooth.@NonNull QLowEnergyDescriptor descriptor){
return contains_native_cref_QLowEnergyDescriptor_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(descriptor));
}
@QtUninvokable
private native boolean contains_native_cref_QLowEnergyDescriptor_constfct(long __this__nativeId, long descriptor);
/**
* See QLowEnergyService:: discoverDetails(QLowEnergyService::DiscoveryMode)
*/
@QtUninvokable
public final void discoverDetails(io.qt.bluetooth.QLowEnergyService.@NonNull DiscoveryMode mode){
discoverDetails_native_QLowEnergyService_DiscoveryMode(QtJambi_LibraryUtilities.internal.nativeId(this), mode.value());
}
@QtUninvokable
private native void discoverDetails_native_QLowEnergyService_DiscoveryMode(long __this__nativeId, int mode);
/**
* See QLowEnergyService:: error()const
*/
@QtUninvokable
public final io.qt.bluetooth.QLowEnergyService.@NonNull ServiceError error(){
return io.qt.bluetooth.QLowEnergyService.ServiceError.resolve(error_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int error_native_constfct(long __this__nativeId);
/**
* See QLowEnergyService:: includedServices()const
*/
@QtUninvokable
public final io.qt.core.@NonNull QList includedServices(){
return includedServices_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QList includedServices_native_constfct(long __this__nativeId);
/**
* See QLowEnergyService:: readCharacteristic(QLowEnergyCharacteristic)
*/
@QtUninvokable
public final void readCharacteristic(io.qt.bluetooth.@NonNull QLowEnergyCharacteristic characteristic){
readCharacteristic_native_cref_QLowEnergyCharacteristic(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(characteristic));
}
@QtUninvokable
private native void readCharacteristic_native_cref_QLowEnergyCharacteristic(long __this__nativeId, long characteristic);
/**
* See QLowEnergyService:: readDescriptor(QLowEnergyDescriptor)
*/
@QtUninvokable
public final void readDescriptor(io.qt.bluetooth.@NonNull QLowEnergyDescriptor descriptor){
readDescriptor_native_cref_QLowEnergyDescriptor(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(descriptor));
}
@QtUninvokable
private native void readDescriptor_native_cref_QLowEnergyDescriptor(long __this__nativeId, long descriptor);
/**
* See QLowEnergyService:: serviceName()const
*/
@QtUninvokable
public final java.lang.@NonNull String serviceName(){
return serviceName_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native java.lang.String serviceName_native_constfct(long __this__nativeId);
/**
* See QLowEnergyService:: serviceUuid()const
*/
@QtUninvokable
public final io.qt.bluetooth.@NonNull QBluetoothUuid serviceUuid(){
return serviceUuid_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.bluetooth.QBluetoothUuid serviceUuid_native_constfct(long __this__nativeId);
/**
* See QLowEnergyService:: state()const
*/
@QtUninvokable
public final io.qt.bluetooth.QLowEnergyService.@NonNull ServiceState state(){
return io.qt.bluetooth.QLowEnergyService.ServiceState.resolve(state_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int state_native_constfct(long __this__nativeId);
/**
* See QLowEnergyService:: type()const
*/
@QtUninvokable
public final io.qt.bluetooth.QLowEnergyService.@NonNull ServiceTypes type(){
return new io.qt.bluetooth.QLowEnergyService.ServiceTypes(type_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int type_native_constfct(long __this__nativeId);
/**
*
*/
@QtUninvokable
public final void writeCharacteristic(io.qt.bluetooth.@NonNull QLowEnergyCharacteristic characteristic, io.qt.core.@NonNull QByteArray newValue, io.qt.bluetooth.QLowEnergyService.@NonNull WriteMode mode){
writeCharacteristic_native_cref_QLowEnergyCharacteristic_cref_QByteArray_QLowEnergyService_WriteMode(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(characteristic), QtJambi_LibraryUtilities.internal.checkedNativeId(newValue), mode.value());
}
@QtUninvokable
private native void writeCharacteristic_native_cref_QLowEnergyCharacteristic_cref_QByteArray_QLowEnergyService_WriteMode(long __this__nativeId, long characteristic, long newValue, int mode);
/**
* See QLowEnergyService:: writeDescriptor(QLowEnergyDescriptor, QByteArray)
*/
@QtUninvokable
public final void writeDescriptor(io.qt.bluetooth.@NonNull QLowEnergyDescriptor descriptor, io.qt.core.@NonNull QByteArray newValue){
writeDescriptor_native_cref_QLowEnergyDescriptor_cref_QByteArray(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(descriptor), QtJambi_LibraryUtilities.internal.checkedNativeId(newValue));
}
@QtUninvokable
private native void writeDescriptor_native_cref_QLowEnergyDescriptor_cref_QByteArray(long __this__nativeId, long descriptor, long newValue);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QLowEnergyService(QPrivateConstructor p) { super(p); }
/**
* Overloaded function for {@link #characteristic(io.qt.bluetooth.QBluetoothUuid)}.
*/
@QtUninvokable
public final io.qt.bluetooth.@NonNull QLowEnergyCharacteristic characteristic(io.qt.bluetooth.QBluetoothUuid.@NonNull ProtocolUuid uuid) {
return characteristic(new io.qt.bluetooth.QBluetoothUuid(uuid));
}
/**
* Overloaded function for {@link #characteristic(io.qt.bluetooth.QBluetoothUuid)}.
*/
@QtUninvokable
public final io.qt.bluetooth.@NonNull QLowEnergyCharacteristic characteristic(io.qt.bluetooth.QBluetoothUuid.@NonNull ServiceClassUuid uuid) {
return characteristic(new io.qt.bluetooth.QBluetoothUuid(uuid));
}
/**
* Overloaded function for {@link #characteristic(io.qt.bluetooth.QBluetoothUuid)}.
*/
@QtUninvokable
public final io.qt.bluetooth.@NonNull QLowEnergyCharacteristic characteristic(io.qt.bluetooth.QBluetoothUuid.@NonNull CharacteristicType uuid) {
return characteristic(new io.qt.bluetooth.QBluetoothUuid(uuid));
}
/**
* Overloaded function for {@link #characteristic(io.qt.bluetooth.QBluetoothUuid)}.
*/
@QtUninvokable
public final io.qt.bluetooth.@NonNull QLowEnergyCharacteristic characteristic(io.qt.bluetooth.QBluetoothUuid.@NonNull DescriptorType uuid) {
return characteristic(new io.qt.bluetooth.QBluetoothUuid(uuid));
}
/**
* Overloaded function for {@link #characteristic(io.qt.bluetooth.QBluetoothUuid)}.
*/
@QtUninvokable
public final io.qt.bluetooth.@NonNull QLowEnergyCharacteristic characteristic(io.qt.core.@NonNull QUuid uuid) {
return characteristic(new io.qt.bluetooth.QBluetoothUuid(uuid));
}
/**
* Overloaded function for {@link #discoverDetails(io.qt.bluetooth.QLowEnergyService.DiscoveryMode)}
* with mode = io.qt.bluetooth.QLowEnergyService.DiscoveryMode.FullDiscovery
.
*/
@QtUninvokable
public final void discoverDetails() {
discoverDetails(io.qt.bluetooth.QLowEnergyService.DiscoveryMode.FullDiscovery);
}
/**
* Overloaded function for {@link #writeCharacteristic(io.qt.bluetooth.QLowEnergyCharacteristic, io.qt.core.QByteArray, io.qt.bluetooth.QLowEnergyService.WriteMode)}
* with mode = io.qt.bluetooth.QLowEnergyService.WriteMode.WriteWithResponse
.
*/
@QtUninvokable
public final void writeCharacteristic(io.qt.bluetooth.@NonNull QLowEnergyCharacteristic characteristic, io.qt.core.@NonNull QByteArray newValue) {
writeCharacteristic(characteristic, newValue, io.qt.bluetooth.QLowEnergyService.WriteMode.WriteWithResponse);
}
/**
* Overloaded function for {@link #writeCharacteristic(io.qt.bluetooth.QLowEnergyCharacteristic, byte[], io.qt.bluetooth.QLowEnergyService.WriteMode)}
* with mode = io.qt.bluetooth.QLowEnergyService.WriteMode.WriteWithResponse
.
*/
@QtUninvokable
public final void writeCharacteristic(io.qt.bluetooth.@NonNull QLowEnergyCharacteristic characteristic, byte @NonNull[] newValue) {
writeCharacteristic(characteristic, newValue, io.qt.bluetooth.QLowEnergyService.WriteMode.WriteWithResponse);
}
/**
* Overloaded function for {@link #writeCharacteristic(io.qt.bluetooth.QLowEnergyCharacteristic, io.qt.core.QByteArray, io.qt.bluetooth.QLowEnergyService.WriteMode)}.
*/
@QtUninvokable
public final void writeCharacteristic(io.qt.bluetooth.@NonNull QLowEnergyCharacteristic characteristic, byte @NonNull[] newValue, io.qt.bluetooth.QLowEnergyService.@NonNull WriteMode mode) {
writeCharacteristic(characteristic, new io.qt.core.QByteArray(newValue), mode);
}
/**
* Overloaded function for {@link #writeDescriptor(io.qt.bluetooth.QLowEnergyDescriptor, io.qt.core.QByteArray)}.
*/
@QtUninvokable
public final void writeDescriptor(io.qt.bluetooth.@NonNull QLowEnergyDescriptor descriptor, byte @NonNull[] newValue) {
writeDescriptor(descriptor, new io.qt.core.QByteArray(newValue));
}
}