public class BluetoothLEHelper4
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
BluetoothLEHelper4.GattInfo |
Constructor and Description |
---|
BluetoothLEHelper4(Context context) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkEddystoneServices(java.util.List<BluetoothGattService> gattServiceList)
add by fangping
|
boolean |
checkGattServices(java.util.List<BluetoothGattService> gattServiceList)
check beacon service.
|
boolean |
close()
close gatt connection
|
boolean |
connect(java.lang.String address,
BluetoothGattCallback gattCallback)
Connects to the GATT server hosted on the Bluetooth LE device.
|
int |
flashLightWitCommand(byte repeat,
int repeatCount) |
CmdResponse |
getResponse()
get cmd response.
|
int |
getSendCmdType() |
boolean |
initialize()
Initializes a reference to the local Bluetooth adapter.
|
boolean |
listenLockStateChar() |
void |
listenReadChar()
listen reading sensor char
|
boolean |
listenResetChar() |
void |
listenSensorChar()
listen sensor char
|
boolean |
listenUnLockChar() |
int |
readConfiguration(Beacon beacon) |
int |
receivePacket(BluetoothGattCharacteristic characteristic)
listen characteristic change.
|
int |
reloadSensorData() |
int |
requireWritePermission(java.lang.String password) |
int |
resetAcceleratorCount() |
void |
resetSendPacket() |
int |
resetToFactorySettings() |
void |
sendPacket(BluetoothGattCharacteristic characteristic)
series to write package.
|
int |
setPassword(java.lang.String password) |
int |
writeBeaconConfiguration(BeaconConfiguration beaconConfiguration) |
int |
writeBroadcastKey(java.lang.String broadcastKey) |
int |
writeEddystoneLockConfiguration() |
int |
writeEddystoneResetConfiguration() |
int |
writeEddystoneUnlockConfiguration(byte[] aes_data) |
public boolean initialize()
public boolean connect(java.lang.String address, BluetoothGattCallback gattCallback)
address
- The device address of the destination device.BluetoothGattCallback#onConnectionStateChange(android.bluetooth.BluetoothGatt, int, int)
callback.public int readConfiguration(Beacon beacon)
public int requireWritePermission(java.lang.String password)
public int writeEddystoneResetConfiguration()
public int writeEddystoneLockConfiguration()
public int writeEddystoneUnlockConfiguration(byte[] aes_data)
public int writeBeaconConfiguration(BeaconConfiguration beaconConfiguration)
public int flashLightWitCommand(byte repeat, int repeatCount)
public int resetToFactorySettings()
public int reloadSensorData()
public int resetAcceleratorCount()
public int writeBroadcastKey(java.lang.String broadcastKey)
public int setPassword(java.lang.String password)
public boolean close()
public boolean checkGattServices(java.util.List<BluetoothGattService> gattServiceList)
gattServiceList
- public boolean checkEddystoneServices(java.util.List<BluetoothGattService> gattServiceList)
gattServiceList
- public void listenSensorChar()
public boolean listenLockStateChar()
public boolean listenUnLockChar()
public boolean listenResetChar()
public void listenReadChar()
public void resetSendPacket()
public int getSendCmdType()
public void sendPacket(BluetoothGattCharacteristic characteristic)
characteristic
- public CmdResponse getResponse()
public int receivePacket(BluetoothGattCharacteristic characteristic)
characteristic
-