public class SensoroBeaconConnection
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
SensoroBeaconConnection.BeaconConnectionCallback
The callback interface of the beacon.
|
class |
SensoroBeaconConnection.SensoroException
The exception of the SDK.
|
Modifier and Type | Field and Description |
---|---|
static int |
AUTHORIZATION_FAILED
Authorization failed.
|
static int |
CONNECTED_TIME_OUT
Connect beacon timeout.
|
static int |
DISCONNECTED_BY_REMOTE_DEVICE
Disconnected from remote device.
|
static int |
ERROR_BEACON_MODEL
Beacon model error.
|
static int |
FAILURE
Failure.
|
static int |
NOT_SUPPORT
The method is not support the current version of Yunzi.
|
static int |
SETTING_DATA_INVALID
Setting data invalid.
|
static int |
SUCCESS
Success.
|
static int |
WRITE_NOT_PERMITTED
Write not permitted.
|
Constructor and Description |
---|
SensoroBeaconConnection(Context context,
Beacon beacon,
SensoroBeaconConnection.BeaconConnectionCallback callback) |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Connect the beacon.The callback
SensoroBeaconConnection.BeaconConnectionCallback.onConnectedState(Beacon, int, int)
will be called. |
void |
disableAliBeacon()
Disable AliBeacon function of SmartBeacon-4AA.
Only support C0-3.1 and above.
|
void |
disableBackgroundEnhancement()
Disable background enhancement function of SmartBeacon-4AA.
Only support C0-3.1 and above.
|
void |
disableIBeacon()
Disable iBeacon function of Yunzi.
Added from SDK_VERION
SensoroBeaconManager.SDK_VERSION 3.0.0, only support B0-3.0,C0-3.0,C0-3.1 and above. |
void |
disablePassword()
Disabled the password of the beacon.
|
void |
disableSecondIBeacon() |
void |
disconnect()
Disconnect the beacon.
|
void |
enableAliBeacon()
Enable AliBeacon function of SmartBeacon-4AA.
Only support C0-3.1 and above.
|
void |
enableBackgroundEnhancement()
Enable background enhancement function of SmartBeacon-4AA.
Only support C0-3.1 and above.
|
void |
enableIBeacon()
Enable iBeacon function of Yunzi.
Added from SDK_VERION
SensoroBeaconManager.SDK_VERSION 3.0.0, only support B0-3.0,C0-3.0,C0-3.1 and above. |
void |
enableSecondIBeacon() |
void |
flashLightWitCommand(byte cmd,
byte repeatCount)
Control the flash light of the beacon.This method only supports C0-3.1 and above.
|
boolean |
isConnected()
Return the status whether the beacon is connected or not.
|
void |
reloadSensorData()
Reload the sensor data.Force to reload the sensoro data.
|
void |
requireWritePermission(byte[] password)
Check the password with bytes.If the beacon has the password,you must check the
password one time at first before other operations.
|
void |
requireWritePermission(java.lang.String password)
Check the password.If the beacon has the password,you must check the
password one time at first before other operations.
|
void |
resetAccelerometerCount()
Reset the count of the acceleration sensor.
|
void |
resetToFactorySettings()
Reset to factory.
|
void |
writeBaseSettings(BaseSettings baseSetttings)
Modify the base settings of the beacon.
|
void |
writeBroadcastKey(java.lang.String broadcastKey)
Write the broadcast key of Yunzi.
Added from SDK_VERION
SensoroBeaconManager.SDK_VERSION 3.0.0, only support B0-3.0,C0-3.0,C0-3.1 and above. |
void |
writeMajorMinor(int major,
int minor)
Set the major and minor of the beacon.
|
void |
writePassword(byte[] password)
Set a new password of the beacon with bytes.If you set the new password
successfully,you must check the password one time before other operations
after connecting successfully.
|
void |
writePassword(java.lang.String password)
Set a new password of the beacon.If you set the new password
successfully,you must check the password one time before other operations
after connecting successfully.
|
void |
writeProximityUUID(java.lang.String proximityUuid)
Set the UUID of the beacon.
|
void |
writeSecondMajorMinor(int major,
int minor) |
void |
writeSecondProximityUUID(java.lang.String proximityUuid) |
void |
writeSecureBroadcastInterval(SecureBroadcastInterval secureBroadcastInterval)
Write the secure broadcast interval of the beacon.
SecureBroadcastInterval.DISABLED only effect on B0-2.3. |
void |
writeSensorSettings(SensorSettings sensorSettings)
Modify the sensor settings of the beacon.
|
public static final int SUCCESS
public static final int FAILURE
public static final int SETTING_DATA_INVALID
public static final int WRITE_NOT_PERMITTED
public static final int AUTHORIZATION_FAILED
public static final int CONNECTED_TIME_OUT
public static final int ERROR_BEACON_MODEL
public static final int NOT_SUPPORT
public static final int DISCONNECTED_BY_REMOTE_DEVICE
public SensoroBeaconConnection(Context context, Beacon beacon, SensoroBeaconConnection.BeaconConnectionCallback callback) throws SensoroBeaconConnection.SensoroException
public void connect()
SensoroBeaconConnection.BeaconConnectionCallback.onConnectedState(Beacon, int, int)
will be called.public void disconnect()
public boolean isConnected()
public void resetToFactorySettings()
public void resetAccelerometerCount()
public void writePassword(java.lang.String password)
password
- new password.public void writePassword(byte[] password)
password
- new password.public void disablePassword()
public void requireWritePermission(java.lang.String password)
password
- the password to check.public void requireWritePermission(byte[] password)
password
- the password to check.public void writeBaseSettings(BaseSettings baseSetttings)
baseSetttings
- The base settings to set.public void writeSensorSettings(SensorSettings sensorSettings)
sensorSettings
- The sensor settings to set.public void writeProximityUUID(java.lang.String proximityUuid)
proximityUuid
- The UUID to set.
(format:"00000000-0000-0000-0000-000000000000")
public void writeSecondProximityUUID(java.lang.String proximityUuid)
public void writeMajorMinor(int major, int minor)
major
- (range:0~65535)minor
- (range:0~65535)public void writeSecondMajorMinor(int major, int minor)
public void reloadSensorData()
public void disableIBeacon()
SensoroBeaconManager.SDK_VERSION
3.0.0, only support B0-3.0,C0-3.0,C0-3.1 and above.public void disableSecondIBeacon()
public void enableIBeacon()
SensoroBeaconManager.SDK_VERSION
3.0.0, only support B0-3.0,C0-3.0,C0-3.1 and above.public void enableSecondIBeacon()
public void enableAliBeacon()
public void disableAliBeacon()
public void enableBackgroundEnhancement()
public void disableBackgroundEnhancement()
public void writeBroadcastKey(java.lang.String broadcastKey)
SensoroBeaconManager.SDK_VERSION
3.0.0, only support B0-3.0,C0-3.0,C0-3.1 and above.broadcastKey
- The value of broadcast key.public void writeSecureBroadcastInterval(SecureBroadcastInterval secureBroadcastInterval)
SecureBroadcastInterval.DISABLED
only effect on B0-2.3.secureBroadcastInterval
- The value of SecureBroadcastInterval
.public void flashLightWitCommand(byte cmd, byte repeatCount)
cmd
- If one bit in the byte is 1, then this light will turn on for 500 ms, if 0 ,the light will turn off for 500 ms.
you can use custom commands, or use SensorSettings.FlashLightCommand
repeatCount
- The count that command was cmd.