public class SensoroBeaconConnectionV4
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
SensoroBeaconConnectionV4.BeaconConnectionCallback |
static interface |
SensoroBeaconConnectionV4.SensorListener
The callback of sensor update.
|
static interface |
SensoroBeaconConnectionV4.WriteCallback |
Constructor and Description |
---|
SensoroBeaconConnectionV4(Context context,
Beacon beacon) |
Modifier and Type | Method and Description |
---|---|
void |
connect(java.lang.String password,
SensoroBeaconConnectionV4.BeaconConnectionCallback beaconConnectionCallback)
Connect to beacon.
|
void |
disconnect()
Disconnect from beacon.
|
void |
flashLightWitCommand(byte repeat,
int repeatCount,
SensoroBeaconConnectionV4.WriteCallback writeCallback)
Flash light of Yunzi major and minor of this beacon.
|
void |
reloadSensorData(SensoroBeaconConnectionV4.WriteCallback writeCallback)
Reload the sensor data.Force to reload the sensoro data.
|
void |
resetAcceleratorCount(SensoroBeaconConnectionV4.WriteCallback writeCallback)
Reset the count of the acceleration sensor.
|
void |
resetToFactorySettings(SensoroBeaconConnectionV4.WriteCallback writeCallback)
Reset to factory.
|
void |
setSensorListener(SensoroBeaconConnectionV4.SensorListener sensorListener)
Set the sensor callback of beacon.
|
void |
writeBeaconConfiguration(BeaconConfiguration beaconConfiguration,
SensoroBeaconConnectionV4.WriteCallback writeCallback)
Since firmware 4.0, use this method to set beacon configuration.
|
public SensoroBeaconConnectionV4(Context context, Beacon beacon)
public void connect(java.lang.String password, SensoroBeaconConnectionV4.BeaconConnectionCallback beaconConnectionCallback) throws java.lang.Exception
password
- If beacon has no password, set value null.beaconConnectionCallback
- The callback of beacon connection.java.lang.Exception
public void writeBeaconConfiguration(BeaconConfiguration beaconConfiguration, SensoroBeaconConnectionV4.WriteCallback writeCallback)
beaconConfiguration
- The configuration of beacon.writeCallback
- The result of write beacon configuration.public void flashLightWitCommand(byte repeat, int repeatCount, SensoroBeaconConnectionV4.WriteCallback writeCallback)
repeat
- If the bit of command is 1, then this light will turn on one times, if 0 ,the light turn off.
you can use custom command, or use SensorSettings.FlashLightCommand
repeatCount
- The count that command was repeat.writeCallback
- The callback of flash light.public void resetToFactorySettings(SensoroBeaconConnectionV4.WriteCallback writeCallback)
writeCallback
- The callback of reset to factory.public void reloadSensorData(SensoroBeaconConnectionV4.WriteCallback writeCallback)
writeCallback
- The callback of reload sensor data.public void resetAcceleratorCount(SensoroBeaconConnectionV4.WriteCallback writeCallback)
writeCallback
- The result of resetting the count of the acceleration sensor.public void setSensorListener(SensoroBeaconConnectionV4.SensorListener sensorListener)
sensorListener
- If the sensor have new data, such as light, temperature and accelerator ,this callback will be called.public void disconnect()