Smart Lock products

Bosma lock module belongs to the business layer, which mainly provides support for related services for intelligent door lock series products. The main products are: Aegis, Gateway, Keypad, etc.

Aegis

The operation class for Aegis devices is: AegisBusinessHelper, so before using Aeigs, initialize the operation class

AegisBusinessHelper.initializeKey(mDeviceModel);

// register command business 
AegisBusinessHelper.registerBusinessListener(OnBleBusinessListener listener)
AegisBusinessHelper.unRegisterBusinessListener(OnBleBusinessListener listener)
        

To check Lock and door current status, there are two ways

  1. When the lock is connected, send the query door lock details command through BLE and return the details AegisDetailResp

    The first time the door lock is added, the calibrateStatus in AegisDetailResp determines whether calibration is required.

    /***
         * Door lock calibration status
         * 0x00 Doorlocks are not calibrated
         * 0x01 Latch and door status are corrected
         * 0x02 Door status is corrected, latch status is not corrected
         * 0x03 The door status is not corrected, the latch status is corrected
         */
        var calibrateStatus: Int = 0,
       
    
  2. No ble connection, query the status of the door lock through the web interface (Aegis needs to bind Gateway or Sentry first)

    //Recommanded,callback see  onBusinessResp  SmartLockConst.ERROR_CODE.DATA_CODE_UPDATE_AEGIS_REMOTE_RESPONSE
    AegisBusinessHelper.queryRemoteInfoStatus()
    
    //or
    SmartLockHttpHelper.getAegisRemoteInfo(pid)
    
    

The door lock is not calibrated and neither local (ble) unlocking nor remote unlocking is available. To test the door lock switch, use.

AegisBusinessHelper.testMotorCommand()

Add Aegis

The Aegis device has a built-in Bluetooth module, so when adding a device we do so via the Bluetooth module.

Bluetooth add process, please see the sample code for details see Demo

Device calibration for Aegis

  1. Before using the Aegis device, it needs to be calibrated in steps that require interaction with the user, see the sample code demo for calibration details

    Aegis must be properly installed to enter the calibration process, and the calibration steps are divided into.

    1. Step 1: Guide the user to close the door, and then click Next to send the command to enter the calibration process

       AegisBusinessHelper.sendCalibrateCommand(CMD_AEGIS_CALIBRATE_STEP_1_START);
      
    2. Step 2: Guide the user to unlock the door and then click next to send a command to unlock the door to confirm

       AegisBusinessHelper.sendCalibrateCommand(CMD_AEGIS_CALIBRATE_STEP_2_UNLOCK);
      
    3. Step 3: Guide the user to open the door, then click next to send the command to open the door to confirm

       AegisBusinessHelper.sendCalibrateCommand(CMD_AEGIS_CALIBRATE_STEP_3_OPEN_DOOR);
      
    4. Step 4: Guide the user to close the door and then click next to send the command to close the door to confirm

      AegisBusinessHelper.sendCalibrateCommand(CMD_AEGIS_CALIBRATE_STEP_4_CLOSE_DOOR_UNLOCK);
      
    5. Step 5: Guide the user to turn off the lock, then click Next to send the command to turn off the lock to confirm

       AegisBusinessHelper.sendCalibrateCommand(CMD_AEGIS_CALIBRATE_STEP_5_CLOSE_DOOR_LOCK);
      
    6. Step 6: Guide the user to unlock the door and then click next to send a command to unlock the door to confirm

      AegisBusinessHelper.sendCalibrateCommand(CMD_AEGIS_CALIBRATE_STEP_6_UNLOCK);
      

Operation control of Aeigs

Luck/Unlock Aegis by ble local

Execute the Lock/Unlock command

AegisBusinessHelper.ownerLocalUnLockCommand()
AegisBusinessHelper.ownerLocalLockCommand()

If executed successfully, the callback in onBusinessResp and returns AegisLockStatusAutoResp

Luck/Unlock Aegis by remote

  • First call the following method to execute the switch lock
AegisBusinessHelper.doRemoteUnlockTask()

If the operation is successful, callback in onBusinessResp , DATA_CODE_DATA_ERROR_REMOTE_UNLOCK_SUCCESS, and then poll the query results

  • Then call the following method to query the results of the remote switch lock.
AegisBusinessHelper.queryRemoteUnLockStatus()

Aeigs Settings

Auto lock

This function sets whether to turn on the door lock to lock automatically, and how long to lock automatically

AegisBusinessHelper.sendGetAutoLockCommand()
AegisBusinessHelper.sendSetAutoLockCommand(boolean isAutoLock, int second)

Callback data see:AegisGetParamsResp and AegisSetParamsResp (New version)

 val enableAuto = BlueUtils.parseInt(BlueUtils.getSubString(value.content, 0, 2))
 val second = BlueUtils.parseInt(BlueUtils.getSubString(value.content, 2, 6))
 val resp = AegisIsAutoLockResp()
 resp.isOpen = enableAuto == 1

response:AegisIsAutoLockRespAegisSetAutoLockResp (Old version)

Impact sensitivity

Impact sensitivity is used to set the sensitivity of the warning when the door lock is hit, the range of values is 1~100, the larger the value, the lower the sensitivity. Close warning setting 255

query:

//Get only aegis is conneted
AegisBusinessHelper.getImpact()

set:

AegisBusinessHelper.sendSetImpactCommand(int progress) 

command callback AegisSetHitThresholdResp

Sound setting

Door lock sound, there are crashing alarm, blocking alarm, closing beep, opening beep, arming beep.

  • A value of 255 means that this function cannot be used and set

  • A value of 1 means on, 0 means off

query:

AegisBusinessHelper.sendGetSoundParamsCommand()

callback response:AegisGetParamsResp

// property  value "1" is sound params

//Impact alarm sound
 tempValues[0] = BlueUtils.parseInt(BlueUtils.getSubString(value.content, 0, 2))
//Blocking rotation alarm sound
 tempValues[1] = BlueUtils.parseInt(BlueUtils.getSubString(value.content, 2, 4))
//Door closing sound
 tempValues[2] = BlueUtils.parseInt(BlueUtils.getSubString(value.content, 4, 6))
//Door opening sound  
 tempValues[3] = BlueUtils.parseInt(BlueUtils.getSubString(value.content, 6, 8))
//Arming sound
 tempValues[4] = BlueUtils.parseInt(BlueUtils.getSubString(value.content, 8, 10))

set:

//  * 00:Impact alarm sound
//  * 01:Blocking rotation alarm sound
//  * 02:Door closing sound
//  * 03:Door opening sound  
//  * 04:Arming sound
val str01 = BlueUtils.padPreFix(tempValues[0].toHexString(), BlueUtils.TYPE_SIZE_1)
val str02 = BlueUtils.padPreFix(tempValues[1].toHexString(), BlueUtils.TYPE_SIZE_1)
val str03 = BlueUtils.padPreFix(tempValues[2].toHexString(), BlueUtils.TYPE_SIZE_1)
val str04 = BlueUtils.padPreFix(tempValues[3].toHexString(), BlueUtils.TYPE_SIZE_1)
val str05 = BlueUtils.padPreFix(tempValues[4].toHexString(), BlueUtils.TYPE_SIZE_1)
AegisBusinessHelper.sendSetSoundParamsCommand(str01 + str02 + str03 + str04 + str05)

callback responseAegisSetParamsResp

Auto unlock

coming soon

Gateway

The Gateway device is a networkable device and the Aegis does not have a network module, so once the Aegis is tied to the Gateway, the Aegis is specifically networkable.

Add Gateway

Before we can add Gateway, we need to complete the addition of Aegis. Since the Gateway device has a Bluetooth module embedded in it, we can add the Gateway via Bluetooth. The sample code is shown in the demo

Gateway Add process.

Gateway operation control

Because Gateway is for other devices, you must configure the data of Gateway's linked devices and query the status before using Gateway

For Gateway details.:

 AegisBusinessHelper.sendGetGatewayDetailCommand();

Once you find the details, you can check the current version of Gateway, WiFi connection status

See SDK Demo

Keypad

Keypad device addition

Keypad is a device that serves Aegis, so before binding Keypad, we need to bind Aegis and Gateway first, and establish the binding relationship between Aegis and Gateway. The specific process is as follows, see Demo for sample code

Keypad device control management

Before using the Keypad, you need to complete the configuration data of the device. The specific process is as follows, and the sample code is shown in Demo

Keypad device OTA

The OTA of the device requires the user to enter the OTA operation code on the Keypad to ensure that the user is near the Keypad. The specific process is as follows, and the sample code is shown in Demo

Updated at November 17th, 2022