xxxxxxxxxx11public boolean isBLEEnabled(Context context)xxxxxxxxxx11public void requestBleEnable(Activity activity)xxxxxxxxxx11public void prepareBTService(Context context)xxxxxxxxxx11public void stopBTService()xxxxxxxxxx11public void startScanLock(ScanLockCallback callback)xxxxxxxxxx11public void stopScanLock()xxxxxxxxxx11public void initLock(ExtendedBluetoothDevice device, InitLockCallback callback)Reset the ekey, and the lockFlagPos will change.
xxxxxxxxxx11public void resetEkey(String lockData, ResetKeyCallback callback)The lock will be reset to factory mode and if you want to use it,you should do initLock.
xxxxxxxxxx11public void resetLock(String lockData, ResetLockCallback callback)xxxxxxxxxx51public void controlLock(2 controlAction, 3 lockData, 4 lockMac, 5 ControlLockCallback callback)xxxxxxxxxx41public void getMuteModeState(2 String lockData,3 String lockMac,4 GetLockMuteModeStateCallback callback)true – on, false – off
xxxxxxxxxx41public void setMuteMode(2 boolean enable,3 String lockData,4 SetLockMuteModeCallback callback)true – on, false – off
xxxxxxxxxx41public void setRemoteUnlockSwitchState(2 boolean enable,3 String lockData,4 SetRemoteUnlockSwitchCallback callback)This setting will change the lock feature value, you need to call Update lock data API to synchronize the cloud data with the new lockdata returned
true – on, false – off
xxxxxxxxxx31public void getRemoteUnlockSwitchState(2 String lockData,3 GetRemoteUnlockStateCallback callback)xxxxxxxxxx41public void setLockTime(2 long timestamp,3 String lockData,4 SetLockTimeCallback callback)xxxxxxxxxx31public void getLockTime(2 String lockData,3 GetLockTimeCallback callback)LogType.NEW - only the new added operation record from last time you get log.
LogType. ALL - all the operation record from lock is initialized.
xxxxxxxxxx41public void getOperationLog(2 int logType,3 String lockData,4 GetOperationLogCallback callback)xxxxxxxxxx31public void getBatteryLevel(2 String lockData,3 GetBatteryLevelCallback callback)xxxxxxxxxx41public void setAutomaticLockingPeriod(2 int seconds,3 String lockData,4 SetAutoLockingPeriodCallback callback)xxxxxxxxxx61public void createCustomPasscode(2 String passcode,3 long startDate,4 long endDate,5 String lockData,6 CreateCustomPasscodeCallback callback)If newPasscode is null or "" means you do not want to change original passcode.
startDate and endDate values are both 0 means you do not want to change expired date,or both values should not be 0.
xxxxxxxxxx71public void modifyPasscode(2 String originalCode,3 String newCode,4 long startDate,5 long endDate,6 String lockData,7 ModifyPasscodeCallback callback)xxxxxxxxxx51public void deletePasscode(2 String passcode,3 String lockData,4 String lockMac,5 DeletePasscodeCallback callback)xxxxxxxxxx31public void resetPasscode(2 String lockData,3 ResetPasscodeCallback callback)xxxxxxxxxx31public void getAllValidPasscodes(2 String lockData,3 GetAllValidPasscodeCallback callback)xxxxxxxxxx41public void modifyAdminPasscode(2 String newPasscode,3 String lockData,4 ModifyAdminPasscodeCallback callback)startDate and endDate set 0 means the card will be valid for ever.
onEnterAddMode:the lock is ready to add a card.
xxxxxxxxxx51public void addICCard(2 long startDate,3 long endDate,4 String lockData,5 AddICCardCallback callback)xxxxxxxxxx61public void modifyICCardValidityPeriod(2 long startDate,3 long endDate,4 String cardNum,5 String lockData,6 ModifyICCardPeriodCallback callback)xxxxxxxxxx31public void getAllValidICCards(2 String lockData,3 GetAllValidICCardCallback callback)xxxxxxxxxx41public void deleteICCard(2 String cardNum,3 String lockData,4 DeleteICCardCallback callback)xxxxxxxxxx31public void clearAllICCard(2 String lockData,3 ClearAllICCardCallback callback)startDate and endDate set 0 means the fingerprint will be valid for ever.
onEnterAddMode:the lock is ready to add a fingerprint.
totalCount: lock collect your fingerprint needed.
currentCount : current count the lock is collecting.
xxxxxxxxxx51public void addFingerprint(2long startDate,3long endDate,4String lockData,5AddFingerprintCallback callback)
xxxxxxxxxx31public void getAllValidFingerprints(2 String lockData,3 GetAllValidFingerprintCallback callback)xxxxxxxxxx41public void deleteFingerprint(2 String fingerprintNum,3 String lockData,4 DeleteFingerprintCallback callback)xxxxxxxxxx31public void clearAllFingerprints(2 String lockData,3 ClearAllFingerprintCallback callback)xxxxxxxxxx61public void modifyFingerprintValidityPeriod(2 long startDate,3 long endDate,4 String fingerprintNum,5 String lockData,6 ModifyFingerprintPeriodCallback callback)xxxxxxxxxx31public void getPassageMode(2 String lockData,3 GetPassageModeCallback callback)PassageModeType.Weekly effective value from 1 to 7,1 means Monday 2 means Tuesday ,...,7 means Sunday, 0 means everydays
xxxxxxxxxx41public void setPassageMode(2 PassageModeConfig modeData,3 String lockData,4 SetPassageModeCallback callback)xxxxxxxxxx41public void deletePassageMode(2 PassageModeConfig modeData,3 String lockData,4 DeletePassageModeCallback callback)xxxxxxxxxx31public void clearPassageMode(2 String lockData,3 ClearPassageModeCallback callback)Currently, only support 2.4G wifi, 5 G don't support.
xxxxxxxxxx11public void scanWifi(String lockData, ScanWifiCallback callback)xxxxxxxxxx11public void configWifi(String wifiName, String wifiPassword, String lockData, ConfigWifiCallback callback)The server and port of the wifi lock
serverAddress = "wifilock.ttlock.com";
portNumber = 4999;
xxxxxxxxxx21public void configServer(String serverAddress, int portNumber, String lockData, 2 ConfigServerCallback callback)xxxxxxxxxx111WifiLockInfo {2 /**3 */4 private String wifiMac;5
6 /**7 *8 * disconnected return -1279 */10 private int wifiRssi;11}xxxxxxxxxx11public void configWifi(String wifiName, String wifiPassword, String lockData, ConfigWifiCallback callback)Need support below feature.
xxxxxxxxxx11FeatureValueUtil.isSupportFeature(lockData, FeatureValue.WIFI_LOCK_SUPPORT_STATIC_IP);Para info:
xxxxxxxxxx341IpSetting {2
3 public static final int STATIC_IP = 0;4 public static final int DHCP = 1;5
6 /**7 * 0 -static ip8 * 1 -DHCP 9 */10 private int type;11
12 /**13 * static ip14 */15 private String ipAddress;16 /**17 * 18 */19 private String subnetMask;20 /**21 * 22 */23 private String router;24
25 /**26 * dns127 */28 private String preferredDns;29
30 /**31 * dns232 */33 private String alternateDns;34}xxxxxxxxxx11public void configIp(IpSetting ipSetting, String lockData, ConfigIpCallback callback)Type info:
xxxxxxxxxx391TTLockConfigType {2 /**3 * By turning on,if the lock is destroyed by violence, it will sound an alarm.4 */5 TAMPER_ALERT(0x01),6 /**7 * By turning on, you can pair the lock again by long pressing the RESET button.8 * By turning off, the RESET button is disabled.9 */10 RESET_BUTTON(0x02),11 /**12 * Privacy lock api and privacy lock button on the lock both turning on, 13 * will enable the privacy function.14 * Only admin key、 admin super code and the privacy card can unlock the lock15 * 16 */17 PRIVACY_LOCK(0x04),18 /**19 * UnlockDirection.LEFT : true20 * UnlockDirection.RIGHT : false21 */22 UNLOCK_DIRECTION(0x10),23 /**24 * 25 */26 LOCK_SOUND(0x05),27 /**28 */29 PASSCODE_VISIBLE(0x06),30 /**31 */32 LOCK_FREEZE(0x07),33 /**34 * 35 * false-keep alive mode(can do all remote operations,need more power)36 * true-power saving mode(can only upload the records automatically by the wifi lock)37 */38 WIFI_LOCK_POWER_SAVING_MODE(0x80);39}xxxxxxxxxx11public void setLockConfig(TTLockConfigType ttLockConfigType, boolean switchOn, String lockData, SetLockConfigCallback callback) xxxxxxxxxx11public void setLockSoundWithSoundVolume(SoundVolume soundVolume, String lockData, SetLockSoundWithSoundVolumeCallback callback) para info
xxxxxxxxxx161SoundVolume {2 FIRST_LEVEL(1),3 SECOND_LEVEL(2),4 THIRD_LEVEL(3),5 FOUTH_LEVEL(4),6 FIFTH_LEVEL(5),7
8 /**9 * mute10 */11 OFF(-1),12 /**13 * open14 */15 ON(-2);16}xxxxxxxxxx11public void getLockSoundWithSoundVolume(String lockData, GetLockSoundWithSoundVolumeCallback callback)xxxxxxxxxx11public void addRemote(String remoteMac, ValidityInfo validityInfo, String lockData, AddRemoteCallback callback)xxxxxxxxxx11public void modifyRemoteValidityPeriod(String remoteMac, ValidityInfo validityInfo, String lockData, ModifyRemoteValidityPeriodCallback callback)xxxxxxxxxx11public void deleteRemote(String remoteMac, String lockData, DeleteRemoteCallback callback)xxxxxxxxxx11public void clearRemote(String lockData, ClearRemoteCallback callback)xxxxxxxxxx11public void addDoorSensor(String doorSensorMac, String lockData, AddDoorSensorCallback callback)xxxxxxxxxx11public void deleteDoorSensor(String lockData, DeleteDoorSensorCallback callback)xxxxxxxxxx11public void getNetworkMac(GetNetworkMacCallback callback)hotelData: hotelData.setHotelInfo(hotelInfo); gain hotelinfo from cloud API hotelData.setBuildingNumber(buildingNumber); BuildingNo hotelData.setFloorNumber(floorNumber); FloorNo
xxxxxxxxxx11public void setHotelData(HotelData hotelData, String lockData, SetHotelDataCallback callback)sectorStr (start counting from 1, Data format "1,2,3" means write sector 1, 2, 3)
xxxxxxxxxx11public void setHotelCardSector(String sectorStr, String lockData, SetHotelCardSectorCallback callback)ttLiftWorkMode: ActivateAllFloors (Allow control all floors after use card) ActivateSpecificFloor (Allow control floors that same as card data)
xxxxxxxxxx11public void setLiftWorkMode(TTLiftWorkMode ttLiftWorkMode, String lockData, SetLiftWorkModeCallback callback)controlableFloors (Data format "1,2,3" means the associated floor is 1、2、3)
xxxxxxxxxx11public void setLiftControlableFloors(String controlableFloors, String lockData, SetLiftControlableFloorsCallback callback)activateFloors (List of floors that can be arrived) currentDate (System current time)
xxxxxxxxxx11public void activateLiftFloors(List<Integer> activateFloors, long currentDate, String lockData, ActivateLiftFloorsCallback callback)xxxxxxxxxx11public void getAccessoryBatteryLevel(AccessoryInfo accessoryInfo, String lockData, GetAccessoryBatteryLevelCallback callback)xxxxxxxxxx61public class AccessoryInfo implements Serializable {2 private AccessoryType accessoryType;3 private String accessoryMac;4 private long batteryDate;5 private int accessoryBattery;6}para info:
xxxxxxxxxx51AccessoryType{2 WIRELESS_KEYPAD(1),3 REMOTE(2),4 DOOR_SENSOR(3);5}xxxxxxxxxx11public void addFace(String lockData, ValidityInfo validityInfo, AddFaceCallback callback)xxxxxxxxxx11public void modifyFaceValidityPeriod(String lockData, long faceNumber, ValidityInfo validityInfo, ModifyFacePeriodCallback callback)xxxxxxxxxx11public void deleteFace(String lockData, long faceNumber, DeleteFaceCallback callback)xxxxxxxxxx11public void clearFace(String lockData, ClearFaceCallback callback)featureData; Human face feature data
xxxxxxxxxx11public void addFaceFeatureData(String lockData, String featureData, ValidityInfo validityInfo, AddFaceCallback callback)xxxxxxxxxx11public void getAllValidFaces(String lockData, GetAllFacesCallback callback)xxxxxxxxxx11public void addPalmVein(String lockData, ValidityInfo validityInfo, AddPalmVeinCallback callback)xxxxxxxxxx11public void modifyPalmVeinValidityPeriod(String lockData, long palmVeinNumber, ValidityInfo validityInfo, ModifyPalmVeinPeriodCallback callback)xxxxxxxxxx11public void deletePalmVein(String lockData, long palmVeinNumber, DeletePalmVeinCallback callback)xxxxxxxxxx11public void clearPalmVein(String lockData, ClearPalmVeinCallback callback)xxxxxxxxxx11public void getAllValidPalmVeins(String lockData, GetAllPalmVeinsCallback callback)xxxxxxxxxx91/**2 * Proximity sensor setting, when 3D face detection or QR code detection is enabled, there is a proximity sensor function. When an object such as a human or a mobile phone approaches the lock, the face detection or QR code detection will be automatically started. This function is used to set whether to turn on or off this sensor function, or to set the sensing distance (far, medium, near).3 * @param sensitivity4 * 0- off5 * 1- low sensitivity(near)6 * 2- medium sensitivity(medium)7 * 3- high sensiticity(far)8 */9public void setSensitivity(String lockData, int sensitivity, SetSensitivityCallback callback)xxxxxxxxxx11public void getSensitivity(String lockData, GetSensitivityCallback callback)time (Door unclosed alarm time, unit of seconds)
xxxxxxxxxx11public void setDoorSensorAlertTime(int time, String lockData, SetDoorSensorAlertTimeCallback callback)PowerSaveWorkMode: ALL_CARDS (All cards can active the power saver) HOTEL_CARD (Only hotel card can active the power saver) ROOM_CARD (Only room card can active the power saver)
xxxxxxxxxx11public void setPowerSaverWorkMode(PowerSaverWorkMode powerSaverWorkMode, String lockData, SetPowerSaverWorkModeCallback callback)76.Set unauthorized attempt alert
xxxxxxxxxx121/**2 * Set unauthorized attempt alarm.3 *4 * When enabled, the lock locks for lockoutDuration seconds after attemptAlertCount failed unlocks5 * of the given unlock modes; attemptAlertCount=0 disables the feature.6 *7 * @param data (attemptAlertCount 0~50,0=关闭;lockoutDuration 0~900 秒)/ alert config8 * @param lockData / lock data9 * @param callback / callback10 */11 public void setUnauthorizedAttemptAlert(UnauthorizedAttemptAlertData data, String lockData,12 SetUnauthorizedAttemptAlertCallback callback)xxxxxxxxxx171/**2 * Unauthorized attempt alert config data (used both as the get result and the set input carrier).3 * Max failed unlock attempts (range 0~50); 0 means the feature is disabled. Maps to server field unauthorizedAttemptAlertCount.4 * Lockout duration after reaching the failed attempt limit (unit: second, range 0~900). Maps to server field unauthorizedAttemptAlertLockTime.5 * Unlock modes that trigger lockout (passcode/card/fingerprint).6 */7public class UnauthorizedAttemptAlertData {8
9 /** / Max failed attempts (0~50; 0 means disabled) */10 private int attemptAlertCount;11
12 /** Lockout duration in seconds (0~900) */13 private int lockoutDuration;14
15 /** Unlock modes that trigger lockout */16 private List<UnlockMode> unlockModes;17}77.Get unauthorized attempt alert config.
xxxxxxxxxx71/**2 * Get unauthorized attempt alert config.3 *4 * @param lockData / lock data5 * @param callback / callback6 */7 public void getUnauthorizedAttemptAlert(String lockData, GetUnauthorizedAttemptAlertCallback callback)