Package ej.bluetooth.util
Class DescriptorHelper
- java.lang.Object
-
- ej.bluetooth.util.DescriptorHelper
-
public class DescriptorHelper extends java.lang.ObjectProvides constants and utility methods related to GATT descriptors.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancheckIndicationsEnabled(byte[] value)Returns whether indications are enabled in the given CCC descriptor value.static booleancheckNotificationsEnabled(byte[] value)Returns whether notifications are enabled in the given CCC descriptor value.static byte[]createCccValue(boolean notificationsEnabled, boolean indicationsEnabled)Creates a CCC descriptor value specifying whether or not notifications and indications should be enabled.
-
-
-
Method Detail
-
createCccValue
public static byte[] createCccValue(boolean notificationsEnabled, boolean indicationsEnabled)Creates a CCC descriptor value specifying whether or not notifications and indications should be enabled.- Parameters:
notificationsEnabled- whether notifications should be enabled.indicationsEnabled- whether indications should be enabled.- Returns:
- the CCC descriptor value.
-
checkNotificationsEnabled
public static boolean checkNotificationsEnabled(byte[] value)
Returns whether notifications are enabled in the given CCC descriptor value.- Parameters:
value- the value of the CCC descriptor.- Returns:
- true if notifications are enabled, false otherwise.
-
checkIndicationsEnabled
public static boolean checkIndicationsEnabled(byte[] value)
Returns whether indications are enabled in the given CCC descriptor value.- Parameters:
value- the value of the CCC descriptor.- Returns:
- true if indications are enabled, false otherwise.
-
-