Direct-BT
2.3.1
Direct-BT - Direct Bluetooth Programming.
|
Go to the documentation of this file.
29 package org.direct_bt;
31 import java.util.Iterator;
32 import java.util.List;
103 if(
null == listener ) {
104 throw new IllegalArgumentException(
"listener argument null");
107 throw new IllegalArgumentException(
"listener's associated characteristic is not null");
110 for(
final Iterator<BTGattService> is = services.iterator(); is.hasNext(); ) {
112 final List<BTGattChar> characteristics = s.
getChars();
113 for(
final Iterator<BTGattChar> ic = characteristics.iterator(); ic.hasNext(); ) {
114 ic.next().enableNotificationOrIndication(
new boolean[2]);
130 for(
final Iterator<BTGattService> is = services.iterator(); is.hasNext(); ) {
132 final List<BTGattChar> characteristics = s.
getChars();
133 for(
final Iterator<BTGattChar> ic = characteristics.iterator(); ic.hasNext(); ) {
134 ic.next().configNotificationIndication(
false ,
false ,
new boolean[2]);
148 for(
final Iterator<BTGattService> is = services.iterator(); is.hasNext(); ) {
150 final List<BTGattChar> characteristics = s.
getChars();
151 for(
final Iterator<BTGattChar> ic = characteristics.iterator(); ic.hasNext(); ) {
152 ic.next().configNotificationIndication(
false ,
false ,
new boolean[2]);
BTDevice getDevice()
Returns the device to which this service belongs to.
int removeAllCharListener()
Remove all BTGattCharListener from the list.
static boolean removeCharListenerFromAll(final BTDevice device, final List< BTGattService > services, final BTGattCharListener listener)
Removes the given BTGattCharListener from the BTDevice.
Provides access to Bluetooth GATT characteristic.
boolean removeCharListener(final BTGattCharListener l)
Remove the given BTGattCharListener from the listener list.
List< BTGattChar > getChars()
Returns a list of BTGattChar this service exposes.
BTGattChar find(String UUID, long timeoutMS)
Find a BTGattChar.
boolean addCharListener(final BTGattCharListener listener)
Add the given BTGattCharListener to the listener list if not already present.
boolean getPrimary()
Returns true if this service is a primary service, false if secondary.
Provides access to Bluetooth GATT characteristic.
Provides access to Bluetooth adapters.
static int removeAllCharListener(final BTDevice device, final List< BTGattService > services)
Removes all BTGattCharListener from the BTDevice.
static boolean addCharListenerToAll(final BTDevice device, final List< BTGattService > services, final BTGattCharListener listener)
Adds the given BTGattCharListener to the BTDevice and BTGattChar#enableNotificationOrIndication(boole...
final BTGattChar getAssociatedChar()
Returns the weakly associated BTGattChar to this listener instance.
BTGattChar event listener for notification and indication events.
String getUUID()
Get the UUID of this service.
BTGattChar find(String UUID)
Find a BTGattChar.