このページのみ全てのページ
GitBook提供
1 / 23

2.1.1-English

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Documentation

https://docs.japancv.co.jp/thundersdk/english-dev-documents

Introduction

Thunder SDK is a development kit that allows you to build your own applications with various functions to Sense Thunder. It enables unique development that is optimal for stores and facilities, such as attribute detection function, UI change, and QR code reading function.

Release Note

Thunder SDK Package Introduction

The Thunder SDK Package (zip file) has the contents shown below.

  • dev-documents

    • : English version of the developer's manual.

    • : English version of the api introduction document for Thunder SDK.

    • : English version of link api developer's manual.

    • : English version of Thing Specification Language developer's manual.

  • model: It stores the algorithm model available to the public and selects the appropriate model to apply to the project according to the requirements. For more information on how to choose the model, please see .

  • sample: a sample program that demonstrates the basic functionality of Thunder SDK. You need to copy relevant resources into the sample based on the access steps described in to compile and run normally.

  • jniLibs: It stores the dynamic libraries of core algorithms for multiple devices and platforms available to the public and selects the appropriate dynamic library to apply to the project according to the requirements. For more information on how to choose the library, please see .

  • license: It contains the test certificates that need to be used on different hardware platforms, which can only be used for testing and need to be applied separately when the product is officially released. For more information on how to use it, please see .

  • thunder-android*.aar: Thunder SDK development kit. You need to copy the aar into the project at development time. For more information on how to use it, please see .

Date

Version

Release Note

2021/4/15

2.0.0(beta)

Opening AI capabilities such as face recognition/temperature measurement in SensePass, SenseThunderE, SenseThunderE-mini, SenseThunderAir. Face Algorithms - 1:1 face recognition - 1:N face recognition - Liveness detection - Mask detection - Server-side FR Temp Measurement - Temperature measurement Senselink Connection - Public cloud (Senselink Cloud 2.4.0) - Register device - User log in - Data synchronization - Record upload - Configuration delivery HW Control - Camera management - Thermal imaging system management - Door access control (relay, Wiegand)

2021/4/28

2.0.0

Add Japanese documentation

2021/4/30

2.1.0

Support out video stream (combined RGB and IR)

Support image rotation

Support face recognition image calibration check

Update temperature algorithm

Support attribute recognition and detection

2021/6/30

2.1.1

Revise sample code

Revise an API of the camera

Development manual
API reference
Senselink connection
Introduction to Thing Specification Language
Development manual
Development manual
Development manual
Development manual
Development manual

Check the face calibration

Check whether the face calibration is correct

Description of functional types

CalibrationUtils

Member Function

Description

Version Introduced

boolean checkCalibration(Bitmap rgbFace, Bitmap irFace)

check whether the face calibration is correct

2.1.0

Description of Member Function

boolean checkCalibration(Bitmap rgbFace, Bitmap irFace)

Parameter

Parameter Name

Type

Description

Note

Version Introduced

rgbFace

Bitmap

RGB face image

None

2.1.0

irFace

Bitmap

IR face image

None

2.1.0

Return

true if the face calibration is correct, false if not

Exception

None

API reference

This document, which describes the functions of a single type, is mainly for developers. The main purpose is to let developers understand the specific purpose and functions provided by each type.

Version

Revision Date

Revision Content

2.0.0

03/01/2021

First Draft

2.1.0

04/30/2021

Added an API for video stream output

Added APIs for attribute detection

Added an API for FR face calibration check

Added an API for image rotation

Updated the temperature detection model

2.1.1

06/30/2021

Revised camera function description

Updated the temperature detection model

LinkSDK

Encapsulation of SenseLink RESTful interface and Mqtt message push mechanism

Rotate image

Rotate image

Description of functional types

RotateImageUtil

Member Function

Description

Version Introduced

byte[] rotateImage(@NonNull byte[] resBuff, @NonNull MidPixelFormat pixelFormat, int width, int height, int degree)

rotate image

2.1.0

Description of Member Function

byte[] rotateImage(@NonNull byte[] resBuff, @NonNull MidPixelFormat pixelFormat, int width, int height, int degree)

Parameter

Parameter Name

Type

Description

Note

Version Introduced

resBuff

byte[]

image data

None

2.1.0

pixelFormat

MidPixelFormat

image format

None

2.1.0

width

int

image width

None

2.1.0

height

int

image height

None

2.1.0

degree

MidPixelFormat

image rotation degree

None

2.1.0

Return

byte[] of rotated image

SDK Authorization

Thunder SDK initiation and authorization

Description of functional types

WuKong

Member Function

Description

Version Introduced

void init(Context context)

Initiation

2.0.0

void auth(String licFileName, boolean isLeafLic, String productName, PassModel modelConfig,IAuthCallback authCallback)

Authorization

2.0.0

void release()

Release SDK resource

2.0.0

Description of Member Function

void init (Context context)

Initiation

Parameter

Parameter Name

Type

Description

Note

Version Introduced

context

Context

context object

None

2.0.0

Return

None

Exception

None

void auth (String licFileName, boolean isLeafLic, String productName, PassModel modelConfig, IAuthCallback authCallback)

Authorization

Parameter

Parameter Name

Type

Description

Note

Version Introduced

licFileName

String

license file name

None

2.0.0

isLeafLic

boolean

Is Leaf License

None

2.0.0

productName

String

Device Product Name

None

2.0.0

modelConfig

PassModel

Model Configuration

None

2.0.0

authCallback

IAuthCallback

Authorization Callback

None

2.0.0

Return

None

Exception

None

void release ()

Release SDK resource

Parameter

None

Return

None

Exception

None

Sample Software Introduction

Introduction to the main functions of the software

  • Face recognition: 1:1 verification, 1:N identification, server identification, QR code identification, temperature measurement + identification

  • Operate hardware peripherals

  • Access SenseLink

The running result is shown below:

Face Recognition

It includes 1:1 face verification, 1:N face identification, server-side identification, QR code identification, and temperature measurement + identification, as shown below:

1:1 Face Verification

The “1:1 Face verification" is a process of proving "you are you", which means that you already have someone's identity information to determine whether the person's face information in the camera view matches the existing identity information.

You need to add a photo of the target person before using it, as shown below:

Then enter the 1:1 matching

1:N Face Identification

The “1:N Face identification” refers to registering the set of face images to be recognized into the local face feature library, and comparing them with the set of face features in the face feature library when the camera acquires the face information to derive the identification result.

Build a facial feature database before using it, as shown below:

Then enter the 1:N identification

Server-side Identification

Server identification is also a 1:N recognition mode, which only replaces the local execution with the remote execution in the "face comparison" link. Since face features are stored on the server, you do not need to build the face feature library at this point, but just enter it directly, as shown below:

Please note that you, as a user, need to implement your own server comparison logic. Please refer to link-api-dev-manual-en .md for details.

QR Code Identification

It features parsing of QR code content, placing the QR code in the preview screen to ensure clear imaging of the QR code, and if identification is successful, the QR code content will be displayed on the screen, as shown below:

Temperature Measurement + Identification

Through the Face recognition function and temperature measurement module, the face and thermodynamic diagram data are processed by the algorithm to get the final face temperature. Currently, the temperature measurement modules supported are Arrow module, Guide 120 module, and Guide 256 module. It should be noted that the final face temperature value may deviate depending on the ambient temperature, module model, and usage strategy.

The "Temperature Measurement+Identification" is equipped with a 1:N face feature library. So before using it, you need to go to 1:N Face Identification to set the face features, and then enter the "Temperature Measurement + Identification" function after the setting is completed.

Operate hardware devices

It’s compatible with some peripherals of Pass and Thunder series. The peripherals supported are shown in the following figure:

Login SenseLink

If newDeviceKey is true, it means the current device has not logged into SenseLink. Input the server address, account name, and password, then click login. If the following graph is shown, the login is successful.

Upload record and TSL model

Upload the record obtained from face recognition, QR code, and etc. to SenseLink. Upload TSL model to SenseLink. Please check the following graph for detail.

Temperature Measurement

Temperature measurement algorithm initialization and calculation

Description of Class

TemperatureActionProxy

Member Function

Description

Version Introduced

int init(TempMeasureVersion algorithmVersion,iTemperConvertCallback temperConvertCallback )

Initialize temperature measurement algorithm

2.0.0

TemperInfo temperCalculateObtainRect(FaceInfo faceInfo, float[] imageData, int width, int height, int orient, float envTemper, float topN)

Measure temperature of single person on Sensepass, SenseThunderE, SenseThunderE-mini

2.0.0

TemperInfo multiTemperCalculate(MatchFace[] matchFaces, float[] temperatureData,int temperatureWidth, int temperatureHeight, float envTemper, int orient, float topN)

Measure temperature of multi persons on SenseThunderAir

2.0.0

void release()

Release temperature measurement resource

2.0.0

Description of Member Function

int init(TempMeasureVersion algorithmVersion,TemperConvertCallback temperConvertCallback )

Initialize temperature measurement algorithm

ThunderAir supports model 1.7.0 (summer mode) and 1.8.0 (normal mode) ThunderMini supports model 1.3.0 (summer mode), 1.5.0 (normal mode), 1.10.0 (winter mode), 1.11.0 (auto mode) Thunder-E supports model 1.2.0 (summer mode), 1.5.0 (normal mode)

Parameter

Parameter Name

Type

Description

Note

Version Introduced

algorithmVersion

TempMeasureVersion

Algorithm version

None

2.0.0

temperConvertCallback

TemperConvertCallback

Temperature measurement callback

None

2.0.0

Return

Return 0 if the init operation is successful, otherwise return negative value

Exception

None

TemperInfo temperCalculateObtainRect(FaceInfo faceInfo, float[] imageData, int width, int height, int orient, float envTemper, float topN)

Calculate temperature

Parameter

Parameter Name

Type

Description

Note

Version Introduced

faceInfo

FaceInfo

Face information

None

2.0.0

imageData

float[]

Image data

None

2.0.0

width

int

Image width

None

2.0.0

height

int

Image height

None

2.0.0

orient

int

Face orientation

None

2.0.0

envTemper

float

Environment temperature

None

2.0.0

topN

float

Face information(The temperature detection model detects temperature based on the points on the face. TOP N refers to a portion. Input is float such as 100%, 50%.)

None

2.0.0

Return

If the calculate operation is successful, return temperature data and region (the region is the face rectangle region where to measure the temperature), otherwise return null

Exception

None

TemperInfo[] multiTemperCalculate(MatchFace[] matchFaces, float[] temperatureData,int temperatureWidth, int temperatureHeight, float envTemper, int orient, float topN)

Calculate temperature

Parameter

Parameter Name

Type

Description

Note

Version Introduced

MatchFace[]

matchFaces

Matched face information array

None

2.0.0

temperatureData

float[]

Image data

None

2.0.0

temperatureWidth

int

Image width

None

2.0.0

temperatureHeight

int

Image height

None

2.0.0

orient

int

Face orientation

None

2.0.0

envTemper

float

Environment temperature

None

2.0.0

topN

float

Face information

None

2.0.0

Return

If the calculate is successful, return result array, otherwise return null array

Exception

None

void release()

Release temperature measurement resource

Parameter

None

Return

None

Exception

None

Introduction to Thing Specification Language

The Thing Specification Language (TSL) refers to a description file provided for the configuration between the end-side and the server, which is used to describe the configuration items supported by the end-side and the constraints corresponding to the configuration items.

Overview

The SenseLink platform supports devices to define the TSL. The data model consisting of the configuration (properties, status) of the actual device facilitates the management of the device through the cloud.

Function Type

Description

Properties

Include parameter naming, parameter types, control types, check rules for each function of the product. Triggered by the device or platform to modify

Status

The status of a peripheral component of the device. The platform only reads but does not write, and only maintains the latest status, such as door magnetism status, thermal imaging system connection status, bluetooth lock battery

TSL

TSL is a JSON format file that is reported by the device when it first accesses SenseLink and is stored in the backend. As you open the details of a device on the web, the web can then dynamically load the TSL and TSL values corresponding to the device. This allows you to ensure consistency between the remote configuration function in the cloud and the local function of the device without upgrading the backend service.

TSL Usage Flow

1.Add TSL to the app and complete the creation based on TSL Data Structure 2.Create the required language pack. For its format, please see TSL internationalization. 3.After completing the development, you can report properties and events on the device, and set properties and invoke services on the cloud, and view the interface call steps Update Process 4.The attributes, events and completed service call data reported from the device will be displayed on the Device Settings tab of Device Details page of the corresponding device in the SenseLink console after passing the data verification.

TSL Structure

TSL is a json file containing "engineVersion", "modelVersion" at the top level: "0.0.1", "deviceType" basic information and related setting status "properties", "status" composition:

{
  "engineVersion": "0.0.1",//Engine version
  "modelVersion": "0.0.1", //Model version
  "deviceType": "sps", // Device type
  "properties": [/*... */], // Function configuration items
  "status": [/*...*/]// Device peripheral status
}

Properties

Properties is composed of several modules, each containing multiple set items. Each setting item, also known as fields element, is a description and function definition for each setting item.

{
  "properties": [{
    "name": "group-name",
    "fields": [{ // Collection of configuration items
      "key": { // Description of the name of configuration items
        "name": "product_customer", // Name
        "desc": "vendor-customer" // used to describe name, with no real purpose
      },
      "value": {} // Description of optional values for configuration items
      ]
   }]
}

Field is composed of key and value. Key describes the name of the configuration item, and Value is the definition including the optional value, style, status of the configuration item. The following is an explanation of some fields. For more configuration, please see [TSL data structure] (# TSL data structure).

type: required, the type of the configuration item value, which can be int, float, string, boolean and others

ranges: optional, to express the interval of the value when the type is int, float, etc., including min: minimum value, max: maximum value, default: default value.

ui: optional, default as text, used to indicate web/device input control style.

List of available values for ui:

ui optional values

description

number

number picker

select

drop-down box

checkbox

multi-select box

radio

radio button

date

time picker

text

single-line text input

textarea

multi-line text input

image

image upload and display

options: optional, used when Value is exhaustible (such as wiegand32, wiegand34, and wiegand2602), generally used with select for ui.

Status

Refers to the status of a peripheral component of a device. The platform only reads and does not write, and only maintains the latest state. The JSON file contains name, enable, and options, corresponding to the name, display or not, and optional values. For more information, please see [TSL data structure] (# TSL data structure).

TSL Internationalization

Defines the display names of device types, attributes, and status of all TSL in the system on the device/web, and stores them separately by different languages. TSL internationalization is to explain the TSL values and names in layman's terms for the cloud console and reduce the difficulty of operation. Each language pack is composed of files in JSON format, and the corresponding Key is a translation for the corresponding part of the TSL.

Field

Description

deviceTypes

set of device types, e.g.: "deviceType": "spse"

groups

TSL categorization name, translation of name in Properties, e.g.: properties[{"name": "general", ...}]

fields

name of the configuration item, all "name" fields of fields under Properties

values

the value corresponding to the configuration, all values in TSL, including the value in Status

status

the display name of the device peripheral status, the "name" field under Status

common

common translation, e.g. "modelVersion": "Device model version"

For more information on data structure, please see Data structure of language pack.

Appendix

Update Process

Update Process

Data structure of language pack

An example of the data structure of the language pack is as follows.

{
  "versionInfo": {
    "version": "0.0.1",
    "log": "",
    "updated": "2020-04-21 12:00:00"
  },
  "common": {
    "modelVersion": "Device model version"
  },
  "deviceTypes": {
    "sps": "SensePass"
  },
  "groups": {
    "general": "General Settings"
  },
  "fields": {
    "identify_mode": "identify_mode"
  },
  "values": {
    "enable": "Enable",
    "disable": "Disable"
  },
  "status": {
    "door_status": "Magnetism Status"
  }
}

TSL Data Structure

An example of the JSON field structure for TSL is as follows:

{
  "engineVersion": "0.0.1",//Engine version
  "modelVersion": "0.0.1", //Model version
  "deviceType": "sps",
  "properties": [{
    "name": "features",
    "fields": [{
      "key": {
        "name": "identify_mode",
        "desc": "Enabled State"
      },
      "value": {
        "required": true, // required or not. It’s non-required by default if not set.
        "type": "int", //data type, must be set, including numeric, boolean, and string.
        "editable": true, // Editable or not. It cannot be edited by default if not set, 
        /*
        ** UI components must be set with the following types
        *** Number picker number
        *** Drop-down box select
        *** Multi-select box checkbox
        *** Radio button radio
        *** Time picker date
        *** Single line text input text
        *** Multi-line text input textarea
        *** Image upload and display image
        *** Default is text
        */
        "ui": "select",
        "ranges": [{
          "min": 1,
          "max": 2,
          "enable": "{open_way}==2", //js expression string or boolean value. It is enabled by default if not set. The fields in curly braces indicate the value to be replaced, e.g. if the open_way value is 2, the expression is parsed as "2==2".
          "default": 1.5
        },{
          "min": 3,
          "max": 4,
          "enable": "{open_way}==3",//js expression string or Boolean value. It is enabled by default if not set.
          "default": 3.5
        }],
        "step": 0.5,// Step size, only for values
        "precision": 1, // Precision, indicates the exact number of decimal places, non-negative integer, and works only for numeric values, not required
        "mult": true, //multiple-choice or not, not required. The passing parameter is a single value by default if it’s not set. Multiple values only work for dropdown and multi-select boxes.
        "enable": "{open_way}==1", // js expression string or boolean value, not required, indicates the display and hiding of the field via linkage control. If the enable property is not set, it is available by default.
        "size": 20, // string length, not required, only works for string and image base64
        "timeFormat": "yyyy-MM-dd HH:mm:ss", //if ui is date, the time format must be filled in. hh means 12 hours, HH means 24 hours
        "options": [{
          "value": 0,
          "name": "off",
          "enable": "{open_way}==2", // js expression string or boolean value. Returns true, indicating that the selected value can be used in the candidate item. If the enable property is not set, it is available by default.
        }, {
          "value": 1,
          "name": "on", // js expression string or boolean value. Returns true, indicating that the selected value can be used in the candidate item. If the enable property is not set, it is available by default.
          "enable": "{open_way}==3"
        }],
        //watch: indicates status listening
        /*
        ** The following example indicates that the value of the current field is associated with the use_mode field.
        ** When the use_mode field changes, the value of the current field is equal to the value after the expression is executed "{use_mode}==2?1.5:{use_mode}==1?2:{recognition_distance}"
        */
        "watch":{
          "use_mode": "{use_mode}==2?1.5:{use_mode}==1?2:{recognition_distance}"
        }
      },
    }]
  }],
  "status": [{
    "name": "wifi",
    "enable": true, // js expression string or boolean value. Controls the display condition of this field. If the enable property is not set, it is available by default.
    "options": [{
      "value": 0,
      "name": "off",
      "enable": "{open_way}==2", // js expression string or boolean value. Returns true, indicating that the selected value can be used in the candidate item. If the enable property is not set, it is available by default.
    },{
      "value": 1,
      "name": "on",
      "enable": "{open_way}==1", // js expression string or boolean value. Returns true, indicating that the selected value can be used in the candidate item. If the enable property is not set, it is available by default.
    }],
  }]
}

LinkSDKHelper

Initialize LinkSDK, set network request parameters

LinkSDKHelper

Member Function

Description

Version Introduced

boolean isCAVerify()

get CA Verification

2.0.0

int getConnectTimeout()

get Connect Timeout

2.0.0

int getReadTimeout()

get Read Timeout

2.0.0

int getWriteTimeout()

get Write Timeout

2.0.0

LinkSDKHelper addInterceptor(Interceptor interceptor)

add Interceptor

2.0.0

LanguageTypeEnum getLanguageType()

get Language Type

2.0.0

LinkSDKHelper init(String url,Context context)

Initialization

2.0.0

LinkSDKHelper setUrl(String url)

Set URL

2.0.0

LinkSDKHelper setCAVerify(boolean caVerify)

set CA Verification

2.0.0

LinkSDKHelper setConnectTimeout(int connectTimeout)

set Connect Timeout

2.0.0

LinkSDKHelper setReadTimeout(int readTimeout)

set Read Timeout

2.0.0

LinkSDKHelper setWriteTimeout(int writeTimeout)

set Write Timeout

2.0.0

LinkSDKHelper setInterceptorList(List interceptorList)

Batch Add Interceptor

2.0.0

List getInterceptorList()

get Interceptor List

2.0.0

LinkSDKHelper setLanguage(LanguageTypeEnum type)

set Language Type

2.0.0

String getUrl()

Get URL

2.0.0

Description of Member Function

boolean isCAVerify()

Get CA Verification

Parameter

None

Return

Returned Value

Description

Version Introduced

true

All network connections will verify the CA certificate

2.0.0

false

All network connections will not verify the CA certificate

2.0.0

Exception

None

int getConnectTimeout()

Get Connect Timeout

Parameter

None

Return

Connect Timeout (millisecond precision)

Exception

None

int getReadTimeout()

Get Read Timeout

Parameter

None

Return

Read Timeout (millisecond precision)

Exception

None

int getWriteTimeout()

Get Write Timeout

Parameter

None

Return

Write Timeout (millisecond precision)

Exception

No

LinkSDKHelper addInterceptor(Interceptor interceptor)

Add Interceptor

Parameter

Parameter Name

Type

Description

Note

Version Introduced

interceptor

Interceptor

Interceptor

okhttp Interceptor

2.0.0

Return

Current Object

Exception

None

LanguageTypeEnum getLanguageType()

Get Language Type

Parameter

None

Return

LanguageTypeEnum

Exception

None

LinkSDKHelper init(String url,Context context)

Initialize

Parameter

Parameter Name

Type

Description

Note

Version Introduced

url

String

server address

None

2.0.0

context

Context

Context

None

2.0.0

Return

Current Object

Exception

None

LinkSDKHelper setUrl(String url)

Set URL

Parameter

Parameter Name

Type

Description

Note

Version Introduced

url

String

server address

None

2.0.0

Return

Current Object

Exception

None

LinkSDKHelper setCAVerify(boolean caVerify)

set CA Verification

Parameter

Parameter Name

Type

Description

Note

Version Introduced

caVerify

boolean

set CA Verification

None

2.0.0

Return

Current Object

Exception

None

LinkSDKHelper setConnectTimeout(int connectTimeout)

Set Connect Timeout

Parameter

Parameter Name

Type

Description

Note

Version Introduced

connectTimeout

int

Connect Timeout

millisecond precision

2.0.0

Return

Current Object

Exception

None

LinkSDKHelper setReadTimeout(int readTimeout)

Set read timeout

Parameter

Parameter Name

Type

Description

Note

Version Introduced

readTimeout

int

read Timeout

millisecond precision

2.0.0

Return

Current Object

Exception

None

LinkSDKHelper setWriteTimeout(int writeTimeout)

Set Write timeout

Parameter

Parameter Name

Type

Description

Note

Version Introduced

writeTimeout

int

write Timeout

millisecond precision

2.0.0

Return

Current Object

Exception

None

LinkSDKHelper setInterceptorList(List interceptorList)

BatchAdd interceptors

Parameter

Parameter Name

Type

Description

Note

Version Introduced

interceptorList

List

Interceptor List

Okhttp Interceptor

2.0.0

Return

Current Object

Exception

None

List getInterceptorList()

Get Interceptor List

Parameter

None

Return

Interceptor List

Exception

None

LinkSDKHelper setLanguage(LanguageTypeEnum type)

Set Language Type

Parameter

Parameter Name

Type

Description

Note

Version Introduced

type

LanguageTypeEnum

Language Type

None

2.0.0

Return

Current Object

Exception

None

String getUrl()

Get URL

Parameter

None

Return

Server Address

Exception

None

Feature Management

Face feature library management

Description of Class

FeatureManagerProxy

Member Function

Description

Version Introduced

int delete(int userId)

Delete face feature of user id

2.0.0

byte[] getFeature( Bitmap avatar)

Get face feature of the image

2.0.0

int insert(int userId, byte[] feature)

Insert feature library

2.0.0

Description of Member Function

int delete(int userId)

Delete face feature

Parameter

Parameter Name

Type

Description

Note

Version Introduced

userId

int

Face feature ID

None

2.0.0

Return

Return 0 if delete operation is successful, otherwise return -1 if invalid parameters -260 if face feature library is empty -261 if can't find

Exception

None

byte[] getFeature(Bitmap avatar)

Get face feature of the image

Parameter

Parameter Name

Type

Description

Note

Version Introduced

avatar

Bitmap

Clear image of the face for a single person

None

2.0.0

Return

Return face feature byte array

Exception

None

int insert(int userId, byte[] feature)

Insert feature library

Parameter

Parameter Name

Type

Description

Note

Version Introduced

userId

int

Face feature ID

None

2.0.0

feature

byte[]

Face feature byte array

None

2.0.0

Return

Return 0 if the insert operation is successful, otherwise return -1 if invalid parameters -259 if face feature fails to add into libary -262 if can't get UUID

Exception

None

QR code

Identify the content of the QR code

Description of functional types

QRCodeDecoderProxy

Member Function

Description

Version Introduced

String decodeQRCode(byte[] nv21, int w, int h)

QR code Identification

2.0.0

String decodeQRCode(Bitmap bitmap)

QR code Identification

2.0.0

Description of Member Function

String decodeQRCode(byte[] nv21, int w, int h)

Parse the QR code

Parameter

Parameter Name

Type

Description

Note

Version Introduced

nv21

byte[]

Preview frame data

None

2.0.0

w

int

Preview width

None

2.0.0

h

int

Preview height

None

2.0.0

Return

The parsed QR code string

Exception

None

String decodeQRCode(Bitmap bitmap)

Parse the QR code

Parameter

Parameter Name

Type

Description

Note

Version Introduced

bitmap

Bitmap

Image Data

None

2.0.0

Return

The parsed QR code string

Exception

None

Senselink connection

Version

Revision Date

Revision Content

v1.1.0

7/16/2020

First Draft

v1.2.1

2020/11/10

Add an introduction to the usage of personnel data synchronization

v2.1.0

2021/04/30

Second version

An introduction of Link API

Link API is a series of interface methods for cloud capability encapsulation of SenseLink platform (For JCV Senselink Cloud, please refer to https://docs.japancv.co.jp/senselink/ (Japanese only)). There are two major types of interface methods, one is encapsulation for the platform RESTful interface, and the other is encapsulation for the platform’s Mqtt message push mechanism. Users can use the cloud capability provided by the platform just like calling common Java methods.

Use of Link API

The Link API mainly provides two core types, namely, HttpApiClient and MqttApiClient, and by using the methods provided by these two types, direct communication with the SenseLink platform can be achieved. The brief introduction is as follows:

  • HttpApiClient: For encapsulation of platform RESTful API, use Http protocol for communication, both are synchronized methods and need to be used in the worker thread;

  • MqttApiClient: For encapsulation of the platform message push mechanism, use Mqtt protocol for communication, and receive platform message push by establishing a long connection and subscribing to the message Topic.

For the detailed definition of the RESTful API interface and Mqtt Topic involved in the interface method, please refer to the "Thunder SDK API Document".

Initialization of Link API

Link API provides a unified initialization entry, you need to set the Url of the server, the read and write timeout of the request, the language type returned by the interface, etc. The specific use is as follows:

// Initialize   
LinkSDKHelper.getInstance().init(“https://link.japancv.co.jp/sl/”, this)
         .setConnectTimeout(10 * 1000)
         .setReadTimeout(30 * 1000)
         .setWriteTimeout(10 * 1000)
         .setLanguage(LinkSDKHelper.LanguageTypeEnum.ZH)  // Set the language of return information from the server
         .addInterceptor(new ResponseInterceptor())  // Set interceptors
         .setDebug(true);

After initialization, specific methods can be called to perform specific services.

RESTful API encapsulation method

Each RESTful API interface encapsulates the corresponding Java method execution. Specific entities class was encapsulated by both the parameter passing value required by the request and the result data of the request. For example, when executing the v2/record request to upload the identification record

    // Parameter entity class
    RecordParameter recordParameter = new RecordParameter();
    recordParameter.setUserId(2547);
    recordParameter.setMode(2);
    recordParameter.setSignTime((int) (System.currentTimeMillis() / 1000));
    recordParameter.setType(1);
    recordParameter.setInTime(0);
    recordParameter.setEntryMode(1);
    Bitmap bitmap = BitmapFactory.decodeStream(mAppContext.getAssets().open("test.jpg"));
    recordParameter.setUsername("testUserName");
    // Error occurs when uploading incorrect base64 string
    recordParameter.setSignBgAvatar(Base64Utils.bitmapToBase64(bitmap));
    recordParameter.setSignAvatar(Base64Utils.bitmapToBase64(bitmap));
    recordParameter.setDocPhoto(Base64Utils.bitmapToBase64(bitmap));
    recordParameter.setIcNumber("235113");
    recordParameter.setIdNumber("460003199809086744");

    // Call the encapsulated method to execute the specific request. Result refers to the unified wrapper class for the result of the request
    Result<RecordResult> recordResultResult = HttpApiClient.uploadRecord(recordParameter);
    if(recordResultResult.isSuccess()){
        // Get the request result data and process it, RecordResult refers to the entity class of the request result data
            RecordResult body = recordResultResult.getBody(RecordResult.class);
        // todo: the execution of specific operations
  } else {
          // Request exception. Please see the API documentation for details
  }
}

Multiple parameters can be passed in directly to the API interface with relatively simple parameters for execution, specified as below:

  • Device login operation

// Request parameters
// Synchronize method calls, which need to be executed in the work thread
Result<LoginResult> loginResult = HttpApiClient.login(
                                  "account", "password", "SPS", AppUtils.getAndroidId(ContextUtils.getContext()));
  • Get detailed user information based on the user ID

int userId = 5;
Result result = HttpApiClient.getUserInfo(userId);

For more details on "RESTful API interface definition" and "correspondence between API and methods", please refer to the Thunder SDK API Document .

Mqtt push mechanism encapsulation method

Each Mqtt message push Topic encapsulates the corresponding Java method. Topic subscribed messages are received by registering callbacks, specified as below

  • Establish a Mqtt long connection with the server, shown as below:

    MqttApiClient.connectMqtt(new IMqttActionListener() {
    
         @Override
         public void onSuccess(IMqttToken iMqttToken) {
           // Connection successful
         }
    
         @Override
         public void onFailure(IMqttToken iMqttToken, Throwable throwable) {
           // Connection failed
         }
    
       }, new IConnectionLost() {
    
         @Override
         public void onConnectionLost(Throwable cause) {
                  // Connection lost
         }
    });
  • Subscribe to the personnel group change of the device

    // Subscribe to the personnel group change
    MqttApiClient.registerGroupChangeListener(new MessageCallback() {

       @Override
       public void success(MqttMessage msg) {

                 // json data is the body of the push message.
                  String json = new String(msg.getPayload());
              // Delete the device in the background and push an empty string without processing.
            if (TextUtils.isEmpty(json)) {
                    return;
            }

            // Get the data. Group class is the entity class corresponding to the message data.
            Pair<List<Group>, Boolean> pushGroupList = 
                                          DataConverter.convertJsonToGroupList(json);
            // Process data according to specific business
         }

       @Override
       public void error(int code, String msg, Throwable throwable) {
                         // Subscription exceptions / Message push exceptions
       }
    });
  • Unsubscribe to the personnel group change of the device

    MqttApiClient.unRegisterGroupChangeListener();

For more details on "Mqtt Topic definition" and "correspondence between topic subscribe and methods", please refer to the Thunder SDK API Document.

Introduction of key use processes

Link API provides easy communication with Senselink platform, however, certain process steps need to be followed while using some functions, in other words, both the use of RESTful API interface and the subscriptions to MQTT topics follow a sequence. Below mainly describes the main functional flow steps from the perspective of the sequence of use.

Login and registration steps

Login and registration operations are required to use the functions of SenseLink platform, so that device can be included into the platform for unified management. A brief communication process is stated as follows:

The main steps are described below:

(1) Device login: requestHttpApiClient.getRsa() interface to obtain a public key from the platform first, then use the public key to encrypt the cleartext password, and then request HttpApiClient.login() interface for login operation. The two steps are completed by using the HttpApiClient.login () method, which only needs to pass in the account number, encrypted password, device type and device DUID as method parameters.

  • token: all interface requests need to use token, which is valid for 7 days. After expiration, 403 error will be returned, in this case, you need to log in again to obtain it;

  • newDeviceKey: If it is true, it means that the current device has not been included in the unified management of the platform, in this case, device registration operation needs to be performed.

(2) Device registration: the HttpApiClient.register() interface should be requested first for registration, and then the HttpApiClient.bindDefaultGroup() interface should be requested to bind the device and personnel group after successful registration (for subsequent personnel data distribution management). The two steps are completed by applying HttpApiClient.register () method, and parameters such as device name, device location, entrance and exit direction of access control need to be passed in.

  • device ldid: the unique identification code of the device on the platform, which is used to distinguish device;

  • companyId: the company id corresponding to the device, and each company has several personnel groups.

Synchronization strategy of object model

Object model related functions are only supported in SenseLink 2.3.0 and above versions. You need to determine the version number of the server before using these functions. On the premise that the server supports these functions, object model can be synchronized without unexpected exceptions. This operation should be placed before the configuration synchronization, the flow chart is shown in the figure below.

(1) Get the version number of the currently connected server by calling HttpApiClient.getServerVersion() to determine whether or not object model related functions are supported by the server. If the version number of the server is greater than or equal to 2.3.0, these functions are supported and you can continue the subsequent operations, otherwise skip directly to step (5);

(2) Calculate the MD5 of the local object model, and call HttpApiClient.checkTslExist() as an input parameter to get the flag zone bit and check whether the local object model exists in the cloud at the same time. When flag==1, it means that the object model already exists and does not need to be uploaded. Otherwise, call HttpApiClient.uploadTsl() to upload the object model;

(3) Call HttpApiClient.checkTslLanguageExist( language ) (zh: Simplified Chinese, zh-tw: Traditional Chinese, en: English) Check whether there is a corresponding language package in the cloud, and get the zone bit and MD5 of the cloud language package. When flag==1 and the MD5 of the cloud language package is consistent with the MD5 of the local language package, it means that the language package already exists and does not need to be uploaded. Otherwise, call HttpApiClient.uploadTslLanguage() to upload the language package;

(4) If there are multiple language packages, repeat step (3);

(5) Perform related operations for configuration synchronization.

Device configuration synchronization strategy

There are two ways to set device configuration parameters: set through the UI interface and set and issue via SenseLink cloud. The brief communication is shown in the figure below:

(1) After the user modifies the configuration through the setting page, the system setting module will upload the modified configuration parameters to the background, and finally broadcast the configuration change;

(2) When the configuration is modified in the background, it will send a configuration change push through MQTT. After receiving the notification, the system setting module will obtain the latest server configuration through HTTP, update the device configuration parameters, and finally broadcast the configuration change;

(3) When the device configuration is reset in the background, it will send a restore default configuration push through MQTT. The system setting module will reset all configurations after receiving the notification, upload the reset configuration to the background, and finally broadcast the configuration change.

Personnel data synchronization strategy

Personnel data synchronization means that the device side obtains the company's corresponding personnel data from the platform side, the data mainly includes the basic information of the personnel and the face photo library required for recognition. The brief communication process of data synchronization is as follows:

(1) After the device logs in successfully and establishes a long Mqtt connection with Mqtt Broker, you need to actively subscribe to the "Device Personnel Group Change Topic". After subscribing, you can immediately receive the message push and obtain all the personnel group information belonging to the device (the key field is the id of the personnel group). You can unsubscribe to the Topic after receiving the data;

(2) With all the personnel group ids obtained in (1), continue to subscribe to "Single personnel group under all personnel data Topic", after subscribing, all personnel information of the personnel group can be obtained (key fields are user_id and image_url). You can unsubscribe to the Topic after receiving the personnel information of all groups

(3) With the user_id and image_url obtained in (2), detailed personnel information and avatars can be obtained through the RESTFul interface. This step needs to be repeated to obtain all the personnel data;

(4) After initial acquisition of personnel data, it is necessary to subscribe to the "Topic of personnel data change under the single person group". After the subscription, the personnel increment list and the change type will be returned immediately, then you need to process the data correspondingly according to the change type.

Thermal imaging system

Used in traffic scenes, support Thermal imaging system preview and get the data recall, manage its the lifecycle, monitor its status, and auto co

Description of functional types

TemperatureCameraFactory

Get different instances for Thermal imaging system

Member Function

Description

Version introduced

ITemperatureCamera getTemperatureCamera(CameraType type)

Get instances for Thermal imaging system

2.0.0

Description of Member Function

ITemperatureCamera getTemperatureCamera(CameraType type)

Get Thermal imaging system

Parameter

Parameter Name

Type

Description

Note

Version introduced

type

CameraType

Thermal imaging system Type

None

2.0.0

Return

ITemperatureCamera

Current Type

Exception

None

ITemperatureCamera

Operate Thermal imaging system

Member Function

Description

Version introduced

boolean matrixTemperature(float[] y16Frame, int y16W, int y16H, float distance, int x, int y, int w, int h, float[] tempArray)

Batch Conversion of Temperature

2.0.0

float getCentigradeFromTemperatureData(float temperatureData)

Calculate the Actual Temperature from the Temperature Data

2.0.0

float getCameraBodyTemperature()

get Camera Body Temperature

2.0.0

void addTemperaturePreviewDataCallback

(ITemperaturePreviewDataCallback callback)

add Thermal imaging system Preview Data Callback

2.0.0

void initCamera(Context context)

Initialize the Thermal imaging system

2.0.0

void releaseCamera()

release Thermal imaging system

2.0.0

void removeTemperaturePreviewDataCallback

(ITemperaturePreviewDataCallback callback)

remove Thermal imaging system Preview Data Callback

2.0.0

void startPreview(TextureView textureView)

start Thermal imaging system Preview

2.0.0

void stopPreview()

stop Thermal imaging system Preview

2.0.0

void setConfig(TemperatureCameraConfig config)

Configure Thermal imaging system

2.0.0

void setAutoShutterEnable(boolean enable)

set Auto Shutter Enable

2.0.0

void shutter()

Shutter

2.0.0

Description of Member Function

boolean matrixTemperature(float[] y16Frame, int y16W, int y16H, float distance, int x, int y, int w, int h, float[] tempArray)

Batch Conversion of Temperature

Parameter

Parameter Name

Type

Description

Note

Version Introduced

y16Frame

float[]

Original Temperature Chart

None

2.0.0

y16W

int

Original Temperature Chart Width

None

2.0.0

y16H

int

Original Temperature Chart Height

None

2.0.0

distance

float

Real Temperature Measurement Distance

None

2.0.0

x

int

the Starting x Coordinate to be Converted

None

2.0.0

y

int

the Starting y Coordinate to be Converted

None

2.0.0

w

int

Width to be Converted

None

2.0.0

h

int

Height to be Converted

None

2.0.0

tempArray

float[]

Converted Temperature Array, size is w*h

None

2.0.0

Return

Returned Value

Description

Version Introduced

true

Converted

2.0.0

false

Not Convered

2.0.0

Exception

None

float getCentigradeFromTemperatureData(float temperatureData)

Get Centigrade from Temperature Data

Parameter

Parameter Name

Type

Description

Note

Version Introduced

temperatureData

float

Temperature Data on Each Pixel, Such as Energy Value

None

2.0.0

Return

Centigrade Value

Exception

None

float getCameraBodyTemperature()

Get Camera Body Temperature

Parameter

None

Return

Camera Body Temperature

Exception

None

void addTemperaturePreviewDataCallback(ITemperaturePreviewDataCallback callback)

Add Thermal imaging system Preview Data Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

ITemperaturePreviewDataCallback

Preview Data Callback

None

2.0.0

Return

None

Exception

None

void initCamera(Context context)

Initialize Thermal imaging system

Parameter

Parameter Name

Type

Description

Note

Version Introduced

context

Context

Context

None

2.0.0

Return

None

Exception

None

void releaseCamera()

Release Thermal imaging system

Parameter

None

Return

None

Exception

None

void removeTemperaturePreviewDataCallback(ITemperaturePreviewDataCallback callback)

Remove Temperature Preview Data Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

ITemperaturePreviewDataCallback

Temperature Preview Data Callback

None

2.0.0

Return

None

Exception

None

void startPreview(TextureView textureView)

Start Preview

Parameter

Parameter Name

Type

Description

Note

Version Introduced

textureView

TextureView

Android System Native (Used for Data Processing)

None

2.0.0

Return

None

Exception

None

void stopPreview()

Stop Preview

Parameter

None

Return

None

Exception

None

void setConfig(TemperatureCameraConfig config)

Thermal imaging system Configuration

Parameter

Parameter Name

Type

Description

Note

Version Introduced

config

TemperatureCameraConfig

Thermal imaging system Configuration

None

2.0.0

Return

None

Exception

None

void setAutoShutterEnable(boolean enable)

Set Auto Shutter Enable

Parameter

Parameter Name

Type

Description

Note

Version Introduced

enable

boolean

Set Auto Shutter Enable

None

2.0.0

Return

None

Exception

None

void shutter()

Open Shutter

Parameter

None

Return

None

Exception

None

Description of Entities

ITemperaturePreviewDataCallback

Preview Data Callback

Description of Method

void onTemperaturePreviewData(Bitmap temperatureBitmap, float[] temperatureValue, int width, int height)

Temperature Preview Data Callback: Thermal imaging system outputs the image orientation as the same as its phisical orientation. For example, the human face will output with the vertical orientation.

Parameter

Parameter Name

Type

Description

Note

Version Introduced

temperatureBitmap

Bitmap

Temperature rgb Picture

None

2.0.0

temperatureValue

float[]

Temperature Data

None

2.0.0

width

int

Temperature Data Width

None

2.0.0

height

int

Temperature Data Height

None

2.0.0

TemperatureCameraConfig

Thermal imaging system Configuration

Description of Properties

Member

Type

Description

Note

Version Introduced

environmentTemperature

float

Environment Temperature

None

2.0.0

distance

float

Temperature Measurement Distance

None

2.0.0

transmittance

float

Atmospheric Transmissivity

None

2.0.0

emissity

float

Emissivity

None

2.0.0

CameraType

Thermal imaging system Type(Enumeration Type)

Description of Properties

Member

Description

Note

Version Introduced

IRAY

IRAY

None

2.0.0

GUIDE120

GUIDE120

None

2.0.0

GUIDE256

GUIDE256

None

2.0.0

Camera

An instance of quick access to the camera is provided, an interface for previewing data is obtained, method of managing the life cycle of the camera is encapsulated, and the monitoring of the camera.

Description of functional types

CameraManager

The main methods of operating the camera

Member Function

Description

Version Introduced

CameraManager removePreviewCallbackWithBuffer(PreviewCallback callback)

remove preview data callback

2.0.0

CameraManager addPreviewCallbackWithBuffer(PreviewCallback callback)

add preview data callback

2.0.0

CameraManager getInstance(int cameraId)

get camera instance

2.0.0

CameraManager setDisplayOrientation(int degree)

set preview degree

2.0.0

CameraManager setPreviewTexture(SurfaceTexture texture)

set preview texture

2.0.0

List getSupportedPreviewSizes()

get the preview size supported by the camera

2.0.0

void initParameters(int width, int height, int degree, SurfaceTexture surfaceTexture)

Camera Initialization

2.0.0

void openCamera(Context context)

open camera

2.0.0

void releaseCamera()

release camera

2.0.0

void startPreview()

start preview

2.0.0

void stopPreview()

stop preview

2.0.0

Description of Member Function

CameraManager addPreviewCallbackWithBuffer(PreviewCallback callback)

Add preview data callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

PreviewCallback

Preview Data Callback

None

2.0.0

Return

Current Object

Exception

None

CameraManager removePreviewCallbackWithBuffer(PreviewCallback callback)

Remove Preview Data Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

PreviewCallback

Preview Data Callback

None

2.0.0

Return

Current Object

Exception

None

CameraManager getInstance(int cameraId)

Get camera instance

Parameter

Parameter Name

Type

Description

Note

Version Introduced

cameraId

int

Camera Index

None

2.0.0

Return

Current Object

Exception

None

CameraManager setDisplayOrientation(int degree)

Set Preview Degree, 0/90/180/270 selectable

Parameter

Parameter Name

Type

Description

Note

Version Introduced

degree

int

Degree, 0/90/180/270 selectable

None

2.0.0

Return

Current Object

Exception

None

CameraManager setPreviewTexture(SurfaceTexture texture)

Set Preview Texture

Parameter

Parameter Name

Type

Description

Note

Version Introduced

texture

SurfaceTexture

Preview Texture

None

2.0.0

Return

Current Object

Exception

None

List getSupportedPreviewSizes()

Get the List of Supported Preview Sizes

Parameter

None

Return

Returned Value

Description

Version introduced

List

List of Supported Preview Sizes

2.0.0

Exception

None

void initParameters(int width, int height, int degree, SurfaceTexture surfaceTexture)

Camera Initialization

Parameter

Parameter Name

Type

Description

Note

Version Introduced

width

int

Preview Width

None

2.0.0

height

int

Preview Height

None

2.0.0

degree

int

Preview Degree: 0,90,180,270

None

2.0.0

surfaceTexture

SurfaceTexture

Preview Texture

None

2.0.0

Return

None

Exception

None

void openCamera(Context context)

Open Camera

Parameter

Parameter Name

Type

Description

Note

Version Introduced

context

Context

Context

None

2.0.0

Return

None

Exception

None

void releaseCamera()

Release Camera

Parameter

None

Return

None

Exception

None

void startPreview()

Start Camera Preview

Parameter

None

Return

None

Exception

None

void stopPreview()

Stop Camera Preview

Parameter

None

Return

None

Exception

None

Description of Entities

None

Description of functional types

RgbAndIrCameraManager

The main methods to operate the camera in order to output video stream (combined RGB and IR).

Member Function

Description

Version Introduced

void removePreviewCallbackWithBuffer(IRgbAndIrPreviewCallback callback)

remove preview data callback

2.1.0

void addPreviewCallbackWithBuffer(IRgbAndIrPreviewCallback callback)

add preview data callback

2.1.0

RgbAndIrCameraManager getInstance()

get camera instance

2.1.0

List getSupportedPreviewSizes(CameraType cameraType)

get the preview size supported by the camera

2.1.0

void initParameters(int width, int height, int degree , SurfaceTexture irSurfaceTexture, SurfaceTexture rgbSurfaceTexture, CameraType cameraType)

Camera Initialization

2.1.0

void openCamera(Context context,CameraType cameraType)

open camera

2.1.0

void releaseCamera(CameraType cameraType)

release camera

2.1.0

void startPreview(CameraType cameraType)

start preview

2.1.0

void stopPreview(CameraType cameraType)

stop Preview

2.1.0

void resetPreviewSize(ScaleManager.Size size,CameraType cameraType)

reset the preview size supported by the camera

2.1.0

Description of Member Function

void addPreviewCallbackWithBuffer(IRgbAndIrPreviewCallback callback)

Add preview data callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

IRgbAndIrPreviewCallback

Preview Data Callback

None

2.1.0

Return

None

Exception

None

void removePreviewCallbackWithBuffer(IRgbAndIrPreviewCallback callback)

Remove preview data callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

IRgbAndIrPreviewCallback

Preview Data Callback

None

2.1.0

Return

None

Exception

None

RgbAndIrCameraManager getInstance()

Get camera instance

Parameter

None

Return

Current object

Exception

None

List getSupportedPreviewSizes(CameraType cameraType)

Get the preview size supported by the camera

Parameter

Parameter Name

Type

Description

Note

Version Introduced

cameraType

CameraType

Camera Type

None

2.1.0

Return

Return Value

Description

Version Introduced

List

Preview size list

2.1.0

Exception

None

void initParameters(int width, int height, int degree,SurfaceTexture irSurfaceTexture, SurfaceTexture rgbSurfaceTexture, CameraType cameraType)

Camera Initialization

Parameter

Parameter Name

Type

Description

Note

Version Introduced

width

int

preview width

None

2.1.0

height

int

preview height

None

2.1.0

degree

int

preview degree: 0,90,180,270

None

2.1.0

irSurfaceTexture

SurfaceTexture

IR surface

None

2.1.0

rgbSurfaceTexture

SurfaceTexture

RGB surface

None

2.1.0

cameraType

CameraType

camera type

None

2.1.0

Return

None

Exception

None

void openCamera(Context context,CameraType cameraType)

Open camera

Parameter

Parameter Name

Type

Description

Note

Version Introduced

context

Context

context

None

2.1.0

cameraType

CameraType

camera type

None

2.1.0

Return

None

Exception

None

void releaseCamera(CameraType cameraType)

Release camera

Parameter

Parameter Name

Type

Description

Note

Version Introduced

cameraType

CameraType

camera type

None

2.1.0

Return

None

Exception

None

void startPreview(CameraType cameraType)

Start camera preview

Parameter

Parameter Name

Type

Description

Note

Version Introduced

cameraType

CameraType

camera type

None

2.1.0

Return

None

Exception

None

void stopPreview(CameraType cameraType)

Stop camera preview

Parameter

Parameter Name

Type

Description

Note

Version Introduced

cameraType

CameraType

camera type

None

2.1.0

Return

None

Exception

None

void resetPreviewSize(ScaleManager.Size size,CameraType cameraType)

reset the preview size supported by the camera

Parameter

Parameter Name

Type

Description

Note

Version Introduced

size

ScaleManager.Size

preview size

None

2.1.0

cameraType

CameraType

camera type

None

2.1.0

Return

None

Exception

None

Description of Entities

CameraType

Parameter Description

Member

Description

Note

Version Introduced

RGB

1 rgb camera

None

2.1.0

IR

2 ir camera

None

2.1.0

RGB_IR

3 rgb and ir camera

None

2.1.0

Development manual

Version

Revision Date

Revision Content

v1.0.2

4/07/2020

Add types of devices to which the SDK is adapted

v1.0.3

5/12/2020

Add an introduction to door access function

v1.2.0

10/14/2020

Add an introduction to face temperature measurement function

v2.0.0

02/05/2021

Add an introduction to camera call process and thermal camera call process, improve the description of face temperature measurement related interfaces

v2.0.0

04/10/2021

Revise the description of support device

v2.1.0

04/30/2021

Revise the typos

Change the package name

Add the algorithm version of temperature detection in devices

Thunder SDK Development Manual

Thunder SDK [hereinafter referred to as "SDK"] is an Android SDK based on AI face algorithm and its derived functions, and takes the intelligent hardware device [hereinafter referred to as the "hardware device"] as the running carrier. It can be used for rapid development of liveness detection, 1:N face identification, 1:1 Face Verification, face temperature measurement, mask detection, access control and other functions.

This document is intended to describe the integration steps of the SDK and how to use the key functions, mainly for development engineers.

SDK Business Capabilities Introduction

This SDK is used for offline identification, capturing faces through device cameras for face identification, and its general flow is shown in the figure below

Based on this generic process, it may be 1 vs 1 or 1 vs N in face matching, so the process is subdivided into 1:1 matching and 1:N identification. Both are used in different scenarios, and 1:1 is not the case where N is set to 1 in 1:N, as defined below.

Call Camera

Quickly access the camera and get the preview callback data, encapsulate methods to manage the camera lifecycle, and support monitoring of the camera status.

Call Thermal imaging system

  • The characteristics of abstract Thermal imaging system used in traffic scenes, support Thermal imaging system preview and get the data callback, manage its lifecycle, monitor its status, and auto connection after hot plug.

  • The Thermal imaging system models supported are Arrow, Guide 120 and Guide 256.

1:1 Face Verification

  • The “1:1 Face Matching" is a process of proving "you are you", which means that you already have someone's identity information to determine whether the person's face information in the camera view matches the existing identity information.

  • The “1:1 Face Matching" is an authentication operation, which is often used in scenarios requiring identity verification, such as real-name authentication in mobile carrier shop, bank, and authentication scenarios in stations, airports, hotels, and Internet cafes.

1:N Face Identification

The “1:N Face Identification” refers to registering the set of face images to be recognized into the local face feature library, and comparing them with the set of face features in the face feature library when the camera acquires the face information to derive the identification result.

  • The “1:N Face Identification” is often used in scenarios that require multi-person identification, such as access control and attendance check-in for communities, buildings, schools, etc.

Mask Detection

The “Mask Detection” refers to the rapid detection of whether a person is wearing a mask by analyzing the face information captured by the camera, which is used in scenarios where masks are required, such as hospitals, manufacturing plants, and construction sites with large amounts of dust.

Server 1:N Identification

In the general process mentioned above, face matching can be performed either locally or remotely (via Http network requests). In the remote execution, the user needs to implement the comparison logic by himself, and the user can consider to achieve this function under the premise of the existing face identification backend server.

Door Access Function

The “Door Access Function" refers to the control function of the SDK for door access devices. Different hardware devices have different ranges of support for door access devices. To facilitate the description of the correspondence, the following concepts are defined:

  • "Door Access Device" - as a collective term for all devices including hardware accessories included in the hardware device of SenseTime and peripheral devices that can be connected and used by the hardware expansion interface.

    • Hardware Accessories: including screen backlight, IR fill light,light sensor, distance sensor, buzzer,local relays, loudspeakers, force removal and alarm button;

    • Peripheral Devices: door open buttons, fire signals, door magnets, door bells, alarms, Wiegand card readers, network relays, Wiegand door open controllers, etc.

  • “Door Access Function” - mainly refers to the use of "Door Access Device", such as opening the door with local relays, opening the door with Wiegand controller, turning off screen fill lights, controlling the doorbell ringing, and sensing the distance of human body with distance sensor.

SDK's support for the "Door Access Function" of different hardware devices varies, as follows (the following table is described only from the perspective of SDK (not hardware) adaptation:

Device Model

Open Button

Fire Signal

Door Sensor

Doorbell

Alarm

Wiegand Reader

Wiegand Controller

Local Relay

Network Relay

Buzzer

Infrared Human Sensor

Distance Sensor

Light Sensor

IR Fill Light

RGB Fill Light

Screen Backlight

Speaker

Tamper Alarm Button

NFC Reader

SensePass

✓

✓

✓

✓

✓

✓

✓

✓

✓

✓

×

✓

✓

✓

×

✓

×

✓

×

SenseThunderE-mini

✓

✓

✓

✓

✓

✓

✓

✓

✓

✓

×

✓

✓

✓

×

✓

×

✓

×

SenseThunderE

✓

✓

✓

✓

✓

✓

✓

✓

✓

×

×

✓

✓

✓

×

✓

✓

✓

×

SenseThunderAir

✓

✓

✓

✓

✓

✓

✓

✓

✓

×

×

✓

✓

✓

×

✓

✓

✓

×

For the purpose of description, this document is defined as follows:

  • Pass Access Control Function: refers to the access control function used by the remaining devices in the Pass and Thunder series (the device models above).

Please pay attention to the following distinction between different devices when the use of the access control function is described.

QR Code Identification

The "QR Code Identification" refers to the function of parsing the content of QR code, which is used in the scenario of QR code identification. There are two codec libraries ZXing and ZBar built into the SDK, which can be selected by yourself when used.

Face Temperature Measurement

The "Face Temperature Measurement" means that through the face identification function and temperature measurement module, the face and thermodynamic diagram data are processed by the algorithm to get the final face temperature. Currently, the temperature measurement modules supported are Arrow module, Guide 120 module, and Guide 256 module. It should be noted that the final face temperature value may deviate depending on the ambient temperature, module model, and usage strategy.

Introduction to Devices Suitable for SDK

Device Model

Device Category

Platform

Android Version

Camera Type

SensePass

Pass Series

RK3399-arm64-v8a

Android 7.1

RGB Face + IR

SenseThunderE

Thunder Series

RK3399-arm64-v8a

Android 7.1

RGB Face + IR + Thermal

SenseThunerE-Mini

Thunder Series

RK3399-arm64-v8a

Android 7.1

RGB Face + IR + Thermal

SenseThunderAir

Thunder Series

RK3399-arm64-v8a

Android 7.1

RGB Face + IR + Thermal

Introduction to Face Camera Imaging

For the purpose of illustrating camera imaging, the following definition is made.

  • Horizontal Imaging: means that the width of the camera imaging picture is greater than the height.

  • Vertical Imaging: means that the width of the camera imaging image is less than the height.

  • Imaging Mirroring :refers to the camera image in which the real moving direction of the object is opposite to the direction in which the picture is presented. If a person walks to the left, he or she goes to the right in the preview screen.

  • Face Orientation: refers to the direction that the face points to in the camera image, as shown below from left to right UP, DOWN, LEFT, RIGHT, in that order.

The following table indicates the imaging characteristics of the face camera corresponding to the specific device model.

Device model

Imaging direction

Face orientation

Imaging mirroring

SensePass

Vertical Imaging

LEFT

No

SenseThunderE

Vertical Imaging

LEFT

No

SenseThunderE-Mini

Vertical Imaging

LEFT

No

SenseThunderAir

Vertical Imaging

LEFT

No

Access Instructions

The SDK is provided as a.zip package file, which includes the.aar package,.so file, algorithm model file, sample project and development documentation. The SDK requires the following environment:

Environment item

Description

device

SensePass, SenseThunderE, SenseThunderE-Mini, SenseThunderAir

Android Version

Compatible with Android 7.1+

SDK activation

you need to apply for authorized .lic certificate so that your application can run in the intelligent hardware

IDE Development

Android Studio 3.5.3 and above

Start Integration

  1. Copy the .aar file to the project libs folder, as shown in the figure below.

  1. Select the corresponding model file in the "model file" folder of the zip package according to the device type, as shown in the figure below.

Device type

Corresponding model

Pass series

.model file in the root of the model folder + all files in the pass_ext folder

Thunder series

.model file in the root of the model folder + all files in the pass_ext folder

Copy the corresponding model file in the zip package to the actual project assets/model folder.

  1. Select the corresponding so library in the "so library" folder of the package according to the device type, as shown in the table below

Device type

Corresponding so

Pass series

Pass-series-rk3399-general(arm64-v8a only)

Thunder series

Pass-series-rk3399-general(arm64-v8a only)

and copy the so in the folder to the /src/main/jniLibs folder.

And the final folder structure should be like this:

  1. Add the following configuration to the build.gradle file

android {
     ...
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8
     }
}
dependencies {
    implementation files('libs/Thunder-android-vx.x.x.aar')
    // Third-party libraries that SDK needs
    implementation 'com.alibaba:fastjson:1.2.70'
    implementation 'com.facebook.conceal:conceal:2.0.1@aar'
    implementation 'com.google.zxing:core:3.3.3'
    implementation 'com.github.open-android:pinyin4j:2.5.0'
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.okhttp3:okhttp:4.8.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.8.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.liulishuo.okdownload:okdownload:1.0.7'
    implementation 'com.liulishuo.okdownload:okhttp:1.0.7'
    implementation 'com.liulishuo.okdownload:sqlite:1.0.7'
}
  1. Add the following permission declaration in AndroidManifest.xml file

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.NFC" />
  1. Copy the .lic certificate to the assets folder (there is a debug certificate in Sample, which is for testing purposes only, and a separate application is required for the official production environment certificate), as shown in the following sample image.

Sample Project

The Sample project can be opened in Android Studio. Copy aar, model, so and other files to the corresponding folder according to the documentation, and run debugging with pass series and thunder series of hardware devices. The Sample project mainly demonstrates 1:N identification, 1:1 matching, mask detection, access control and other functions.

SDK usage

In this section, the use of key api and processes in the SDK will be mainly described.

SDK initialization

Before using the SDK, please make sure that the aar, model, so and .lic files are properly stored and configured. Once the files are ready, the initialization can be performed as follows:

// SDK initialization
WuKong.init(this);

Authorization can be made after successful initialization:

// Specify the model used by the SDK. Here, take initialization on SensePass devices as an example. For more information, please see the Sample code.
model.mMode = SDKMode.PASS;
model.mAlignmentModel = "model/M_Align_occlusion_106_1.20.0.model";
model.mSmallDetectModel = "model/M_Detect_Hunter_LargeFaceSelfie_Gray_11.2.0.model";
model.mVerifyModel = "model/M_Verify_Mobilenetv2Pruned_BGR_Surveillance_4.13.0_v2_weak.model";
model.mDoubleHackModel = "model/pass_ext/M_Liveness_Antispoofing_Binocular_3.28.0.model";
model.mVerifyFinanceModel = "model/M_Verify_Mobilenetv2Pruned_BGR_Surveillance_4.13.0_v2_weak.model";
model.mAttributeModel = "model/M_Attribute_MTNet_2.1.1.model";

// The name of the license file
String licenseName = "sensepass.lic";
String productName = null;

WuKong.auth(licenseName, productName, model, new IAuthCallback() {
            @Override
            public void onSuccess() {
                // Authorization successful
            }

            @Override
            public void onFail(int code, String errMsg) {
                // Authorization failed
            }
        });

In general, there is no need to perform a release operation before the application exits after successful SDK authorization. Specifically, when it is necessary to restart the application, the SDK resources can be released at the end of the application, as follows:

// Release SDK resources
WuKong.release();

Call Camera

The CameraTextureView and CameraManager classes in the SDK make it easy to manage the camera life cycle and related preview operations. The following is an example of using a face camera (RGB) to introduce the use of the camera. CameraTextureView can be used in the layout file as follows (full screen preview).

<thunder.camera.view.CameraTextureView
        android:id="@+id/camera_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:scalableType="centerCrop" />

Then initialize the camera (Please check the following code for detail. 1280*720 preview resolution is highly recommended), as follows,

CameraTextureView mCameraView = findViewById(R.id.camera_view);
Camera.PreviewCallback mRgbCallback = new Camera.PreviewCallback() {
        @Override
        public void onPreviewFrame(byte[] data, Camera camera) {
            // Preview data callback, which can be passed to the Identify Manager
            // IdentifyManager.getInstance().handleRgbData(data);
        }
};

// Take setting up a face camera as an example
CameraManager faceCameraManager = CameraManager.getInstance(CameraUtils.getFaceCameraIndex());
// Add preview data callback
faceCameraManager.addPreviewCallbackWithBuffer(mRgbCallback);
// Open Camera
faceCameraManager.openCamera(getApplicationContext());
// Set preview-related parameters, such as preview width and height, and face orientation.
faceCameraManager.initParameters(1280, 720, 0, mCameraView.getSurfaceTexture());

Control Camera Lifecycle, as follows:

// Start Preview
faceCameraManager.startPreview();

// Stop Preview
faceCameraManager.stopPreview();

// Release Camera
faceCameraManager.releaseCamera();
faceCameraManager.setPreviewTexture(null);
faceCameraManager.removePreviewCallbackWithBuffer(mRgbCallback);
faceCameraManager.setCameraLifecycleCallback(null);
faceCameraManager.setCameraStatusCallback(null);
faceCameraManager.setCameraExceptionHandler(null);
faceCameraManager.setCameraDataUpdateCallback(null);

Call Thermal imaging system

Before calling the relevant interface of the thermal camera, get the instance of the thermal camera first. TemperatureCameraFactory is provided in the SDK to obtain different instances of the Thermal imaging system, shown as follows:

// Get Thermal imaging system Type
CameraType cameraType = TemperatureCameraUtils.getCameraType();
// Get the instance of the corresponding Thermal imaging system by camera type
ITemperatureCamera temperatureCamera = TemperatureCameraFactory.getTemperatureCamera(cameraType);

Initialize the Thermal imaging system configuration

Initialize Thermal imaging system
temperatureCamera.initCamera(context);
// Set the relevant parameters of the Thermal imaging system (needs to be executed after initialization)
temperatureCamera.setConfig(config);
// Set whether the shutter is enabled automatically. It is true by default (Enabling the shutter improves the accuracy of temperature measurement, but shortens the service life of the device)
temperatureCamera.setAutoShutterEnable(true);

Add Thermodynamic Diagram and Callback of Temperature Data

ITemperaturePreviewDataCallback dataCallback = new ITemperaturePreviewDataCallback() {

            @Override
            public void onTemperaturePreviewData(Bitmap temperatureBitmap, float[] temperatureValue, int width, int height) {
                    // Thermodynamic Diagram and Callback of Temperature Data
            }
        };
// Add Data Callback
temperatureCamera.addTemperaturePreviewDataCallback(dataCallback);
// Remove the callback when the data are not in use
temperatureCamera.removeTemperaturePreviewDataCallback(dataCallback);
// It is worth noting that the temperature data does not refer to Celsius degrees, which can be obtained from the temperature data by the following method
temperatureCamera.getCentigradeFromTemperatureData(temperatureValue);
// Alternatively, it can be converted by batch
temperatureCamera.matrixTemperature(temperatureValue,width,height,distance,x,y,w,h,tempArray);

Get the partial status of the Thermal imaging system

// Get Body Temperature of Thermal imaging system
temperatureCamera.getCameraBodyTemperature();

Manage the lifecycle of the Thermal imaging system

// Start Preview of Thermal imaging system
temperatureCamera.startPreview(textureView);
// Stop Preview of Thermal imaging system
temperatureCamera.stopPreview();
// Release Camera Resources of Thermal imaging system
temperatureCamera.releaseCamera();

In addition, the SDK provides a number of methods to operate the Thermal imaging system, shown as below:

// Enable Shutter (Enabling the shutter improves the accuracy of temperature measurement, but shortens the service life of the device)
temperatureCamera.shutter();

1:N Face Identification Flow

The business process of face identification contains several steps such as Camera management, face feature library creation, liveness detection, face comparison, and result processing, which involves many details of SDK usage. The following article introduces the details of SDK usage, taking the process of "1:N identification" as an example.

Create Face Feature Library

The "1:N identification" requires a face feature library as the "database" for face feature retrieval, so the face feature library needs to be built before the process starts. The SDK has FeatureManagerProxy for feature library creation, which is briefly used as follows.

// Frontal Clear Single Photo
Bitmap avatar = BitmapFactory.decode(R.id.avatar);
int userId = 123;

if (avatar != null) {
      // Get Features of the Face in the Picture
      byte[] feature = FeatureManagerProxy.getInstance().getFeature(avatar);
      // Insert Feature Library (native memory). Data persistence requires processing by upper business.
      int result = FeatureManagerProxy.getInstance().insert(userId, feature);
      if (result == 0) {
            Log.d(TAG, "Face Feature Inserted Successfully");
      }
}

// Delete Person Characteristics
int result = FeatureManagerProxy.getInstance().delete(userId);
if (result == 0) {
      Log.d(TAG, "Face Feature Deleted Successfully");
}

N face features (a maximum of 5W features) can be inserted in the feature library. After the construction is completed, the Identify Manager automatically obtains the inserted facial feature data of 'FeatureManagerProxy' during the identification process for personnel identification.

Start Camera Preview

Please check Call Camera section for detail to turn on the RGB camera. If liveness detection is enabled, you also need to turn on the IR camera again and modify the preview data callback to pass the preview data into the Identify Manager, as follows:

Camera.PreviewCallback mRgbCallback = new Camera.PreviewCallback() {
        @Override
        public void onPreviewFrame(byte[] data, Camera camera) {
            // Transfer RGB Preview Data Callback to the Identify Manager
            IdentifyManager.getInstance().handleRgbData(data);
        }
};
Camera.PreviewCallback mIrCallback = new Camera.PreviewCallback() {
        @Override
        public void onPreviewFrame(byte[] data, Camera camera) {
            // Transfer IR Preview Data Callback to the Identify Manager
            IdentifyManager.getInstance().handleIrData(data);
        }
};

Start the Identify Manager

The Identify Manager has built-in "1:N", "1:1" and "server 1:N" identification processes, and you can switch the internal identification logic by switching the Identify Manager mode. The Identify Manager modes are as follows.

  • VerifyModeEnum.MODE_1_N: 1:N identification mode, corresponding to 1:N identification process.

  • VerifyModeEnum.MODE_1_1: 1:1 comparison mode, corresponding to 1:1 comparison process.

  • VerifyModeEnum.MODE_SERVER_1_N: server 1:N identification mode, corresponding to the server 1:N identification process;

Before use, set the configuration as follows:

 // Please configure the image related settings according to the device hardware environment
ImageConfig imageConfig = new ImageConfig.Builder()
          .previewW(1280)
          .previewH(720)
          .faceOrientation(FaceOrientation.UP)
          .pixelFormat(MidPixelFormat.NV21)
          .build();


// Initialize
IdentifyManager.getInstance().init(imageConfig,identifyCallback);

// Set Identification Mode of the Identify Manager
IdentifyManager.getInstance().setVerifyMode(VerifyModeEnum.MODE_1_N);
// Set Result Callback
IdentifyManager.getInstance().setIdentifyCallback(identifyCallback);

After the initial setup, the Identify Manager can be turned on/off to control identification, as follows

// Enable Identification
IdentifyManager.getInstance().start();

// Stop Identification
IdentifyManager.getInstance().stop();

// Release the Identify Manager
IdentifyManager.getInstance().release();

The identification process can control the details through the parameters, and the Identify Manager parameters can be configured individually according to the specific business, as follows. (In the code annotation below, if there are notes for a series different from the pass and thunder series, please skip them as appropriate.)

IdentifyConfig identifyConfig = IdentifyManager.getInstance().getIdentifyConfig();
IdentifyConfig.hasLiveness = true; // Enable liveness detection
identifyConfig.isSingleLiveness = DeviceInfoUtils.isSenseIDProduct();   // For monocular liveness detection, this item should be enabled only for ID series devices
identifyConfig.isSenseGateConfig = DeviceInfoUtils.isSenseGateProduct();  // Turn this on only if the device used is SenseGate series
identifyConfig.isContinueVerify = true; // IdentifyConfig.isContinueVerify = true; / / Whether to recognize continuously. If enabled, it will be recognized continuously (the face needs to be in the camera field of view). It is used together with the continueVerifyIntervalTime parameter.
identifyConfig.continueVerifyIntervalTime = 3000L;  // Interval for continuous identification of the same face, which takes effect when isContinueVerify is set to true
identifyConfig.hasTemperatureDetection = false;
identifyConfig.isServerVerify = false;
IdentifyManager.getInstance().setIdentifyConfig(identifyConfig);

// The modifications are shown here - In 1:N matching, the matching threshold is changed to 0.83f and the liveness filtering threshold is 0.95f (if exceeded, it is non-liveness), with a minimum identification of 100 pixels of the face
ThresholdConfig thresholdConfig = IdentifyManager.getInstance().getThresholdConfig();
thresholdConfig.verifyScore = 0.83f;
thresholdConfig.livenessScore = 0.95f;
thresholdConfig.faceMinWidth = 100;
thresholdConfig.verifyAreaRect = new RectF(0, 0, mPreviewHeight, mPreviewWidth);
IdentifyManager.getInstance().setThresholdConfig(thresholdConfig);

Process Identification Result

The Identify Manager transmits the identification result to the upper business by the way of interface callback, and the upper business only needs to process the result in the callback interface, shown as follows:

IIdentifyResultCallback identifyCallback = new IIdentifyResultCallback() {

    @Override
    public void onDrawFaces(@Nullable List<FaceInfo> list) {
        // Face Detection Callback, which can be used to draw a face calibration frame.
        // Please note that the callbakc occurs when identification is paused, which means that faces are still being tracked in the process, but just not recognized
    }

    @Override
    public void onClearScreen() {
        // Clear Screen Callback. Clear the screen with this callback when there appears no face in the field of view
    }

Please note that the callbakc o
    public void onUnknown(float faceW) {
                // If the face is too large or too small to determine whether it is liveness or not, notice is given with this method
    }

    @Override
    public void onIdentifyResult(List<FrameIdentifyResult> frameIdentifyResults) {
                // Identify Result Callback
    }
};

// Set Result Callback
IdentifyManager.getInstance().setIdentifyCallback(identifyCallback);

When the result callback is not required, set null as follows:

// Remove Identify Callback
IdentifyManager.getInstance().setIdentifyCallback(null);

At this point, the process of "1:N identification" has been preliminarily built.

1:1 Face Verification Process

In the above description, the Identify Manager in the "1:N identification" process uses the mode VerifyModeEnum.MODE_1_N, which is the "1:N identification" mode. In the face "1:1 matching" process, the Identify Manager needs to be switched to "1:1 matching" mode, as follows:

// Initialization of the Identify Manager is the same as that of 1:N
// When the Identify Manager is switched from 1:N to 1:1, it is necessary to set the single identification feature first, and then switch the mode

Bitmap singleTarget = BitmapFactory.decodeResource(getResource(), R.mipmap.face);
boolean setupResult = IdentifyManager.getInstance().setIdentifyTarget(singleTarget);
// Set Identification Mode of the Identify Manager. Before setting it, make sure that the individual identification feature is set successfully.
if (setupResult) {
    IdentifyManager.getInstance().setVerifyMode(VerifyModeEnum.MODE_1_1);
}

Server 1:N Identification

When the identification step is executed on the remote server, you need to modify the configuration of the Identify Manager to enable the server identification based on 1:N identification, and then use the IServerVerifyAction class to implement the identification logic. The specific use is as follows:

// 1. Enable Server Verify Mode 
IdentifyManager.getInstance().setVerifyMode(VerifyModeEnum.MODE_SERVER_1_N);

// 2. Implement Server Verify Action
IServerVerifyAction serverVerify = new IServerVerifyAction() {
        @Override
        public <T extends FaceSearchResult> T verify(@NonNull byte[] cameraData, byte[] feature, @Nullable FaceInfo rgbFace,int width, int height) {

              // Upload Data via http Request and Get Identification Result (note to set a reasonable request timeout).
            // ..code

            // Build Face Search Result and Return It, as shown in the following example
            FaceSearchResult result = new FaceSearchResult();
            result.score = 0.93f;
            result.userID = 12345;

            return (T) result;
        }
};

// 3. Set Server Verify Action
IdentifyManager.getInstance().setServerVerifyAction(serverVerify);

Mask Detection

Based on the identification of "1:N", "1:1" and "server 1:N", the corresponding mask detection results can be obtained from the identification results by configuring to open the mask detection. If the mask detection function is not enabled, the default mask detection result is true, enabled as follows:

// Open Wear Mask Identify
IdentifyConfig identifyConfig = IdentifyManager.getInstance().getIdentifyConfig();
identifyConfig.isOpenWearMaskIdentify = true;
IdentifyManager.getInstance().setIdentifyConfig(identifyConfig);

// Get Face Identify Result Through Identify Result Callback Interface
IIdentifyResultCallback identifyCallback = new IIdentifyResultCallback() {

    @Override
    public void onDrawFaces(@Nullable List<FaceInfo> list) {
        // Face Detection Callback, which can be used to draw a face calibration frame.
        // Please note that this callback still occurs when identification is paused, which means that faces are still being tracked in the process, but just not recognized
    }

    @Override
    public void onClearScreen() {
        // Clear Screen Callback. Clear the screen with this callback when there appears no face in the field of view
    }

    @Override
    public void onUnknown(float faceW) {
                // If the face is too large or too small to determine whether it is liveness or not, notice is given with this method
    }

    @Override
    public void onIdentifyResult(List<FrameIdentifyResult> frameIdentifyResults) {
                // Identify Result Callback
      for (int i = 0; i < frameIdentifyResults.size(); i++) {
            FrameIdentifyResult frameIdentifyResult = frameIdentifyResults.get(i);
            List<FaceIdentifyResult> faceIdentifyResults = frameIdentifyResult.faceIdentifyResults;
            for (int j = 0; j < faceIdentifyResults.size(); j++) {
                FaceIdentifyResult faceIdentifyResult = faceIdentifyResults.get(j);
                  // Get Face Identify Result
                  boolean mask = faceIdentifyResult.isMask();
            }
        }
    }
};

// Set Result Callback
IdentifyManager.getInstance().setIdentifyCallback(identifyCallback);

Face Temperature Measurement

Based on the identification of "1:N", "1:1" and "server 1:N", the temperature measurement configuration item of the Identify Manager needs to be enabled before the face temperature measurement function is used, as shown below

IdentifyConfig identifyConfig = IdentifyManager.getInstance().getIdentifyConfig();
identifyConfig.hasTemperatureDetection = true;    // Enable Temperature Detection
IdentifyManager.getInstance().setIdentifyConfig(identifyConfig);

It should be especially noted that the Identify Manager needs temperature data to work properly after the temperature measurement function is turned on, and no identification will be made before the temperature data is obtained, but face tracking will be carried out normally. In addition, when the temperature measurement function is turned on, it is recommended to set the rectangle for face recognition and a stricter angle of the front face to try to identify the face in the center of the field of view, so as to increase the accuracy of face identification and temperature measurement, as follows

ThresholdConfig thresholdConfig = IdentifyManager.getInstance().getThresholdConfig();
thresholdConfig.faceMinWidth = 200; // In the temperature measurement, it needs to be closer, and the width of the face needs to be set larger.
thresholdConfig.pitch = 20;   // In the temperature measurement, the requirements are more stringent, and face facing forward helps to measure the temperature more accurately
thresholdConfig.roll = 20;
thresholdConfig.yaw = 20;
thresholdConfig.verifyAreaRect = new RectF(125, 400, 565, 835); // Take the SensePass device as an example       
IdentifyManager.getInstance().setThresholdConfig(thresholdConfig);

The temperature measurement function requires a temperature measurement module (Thermal imaging system), which can be initialized by obtaining the corresponding Thermal imaging system object through the TemperatureCameraFactory class. Note that the Thermal imaging system takes several seconds to initialize, as follows

// Get Camera Type
CameraType type = TemperatureCameraUtils.getCameraType();
// Create Thermal imaging system Object
ITemperatureCamera mTemperatureCamera = TemperatureCameraFactory.getTemperatureCamera(type);
// Initialize
mTemperatureCamera.initCamera(this);

After the temperature data are obtained, the temperature value needs to be calibrated by the temperature measurement algorithm, which needs to be initialized manually, as follows

// Initialize Temperature Comparison Algorithm (for calibration temperature)
TemperConvertCallback temperConvertCallback = new TemperConvertCallback() {

            private float[] tempArray;

            @Override
            public float temperConvertCentigrade(float temper) {

                return TemperatureCameraFactory.getTemperatureCamera(type).getCentigradeFromTemperatureData(temper);
            }

            @Override
            public float[] getTempMatrix(float[] y16Frame, int y16W, int y16H, float distance, int x, int y, int w, int h) {

                int size = w * h;
                if (tempArray == null || tempArray.length != size) {
                    tempArray = new float[size];
                }
                TemperatureCameraFactory.getTemperatureCamera(type).matrixTemperature(y16Frame, y16W, y16H, distance, x, y, w, h,                                         temperConvertCallback = tempArray);
                return tempArray;
            }
        };
// Note: different devices have different versions of the algorithm
// Currently, Thunder-E supports:TempMeasureVersion.TempMeasure_1_2_0、TempMeasureVersion.TempMeasure_1_5_0、TempMeasureVersion.TempMeasure_1_6_0、TempMeasureVersion.TempMeasure_1_7_0
// Thunder Air supports:TempMeasureVersion.TempMeasure_1_7_0、TempMeasureVersion.TempMeasure_1_8_0
// Thunder mini supports:TempMeasureVersion.TempMeasure_1_5_0、TempMeasureVersion.TempMeasure_1_11_0、TempMeasureVersion.TempMeasure_1_10_0、TempMeasureVersion.TempMeasure_1_3_0
// For details, please refer to the implementation in TemperatureMeasureVersionUtils.getTempMeasureVersionByDevice()
TempMeasureVersion algorithmVersion = TemperatureMeasureVersionUtils.getTempMeasureVersionByDevice();
int ret = TemperatureActionProxy.init(algorithmVersio, temperConvertCallbackn);
if(ret == 0) {
        Log.d(TAG, "Temperature Measurement Algorithm Initialized Successfully");
}

Set Temperature Sdk Action to the Identify Manager,

ITemperatureSdkAction action = new ITemperatureSdkAction() {

            @Override
            public <T extends TrackAndTemperatureResult> List<T> temperCalculateAir(MatchFace[] matchFaces, @Nullable Bitmap temperatureBitmap, float[] temperatureData, int temperatureWidth, int temperatureHeight, FaceOrientation temperatureOrientation) {
                // Ambient temperature of equipment in use 
                // when CameraType is CameraType.GUIDE120 or CameraType.IRAY,Examples code
                   MatchFace matchFace = matchFaces[0];
                    float envTemperature = 25.1f;
                    TemperInfo temperInfo = TemperatureActionProxy.temperCalculateObtainRect(matchFace.rgbFace, temperatureData,
                                                                                     temperatureWidth, temperatureHeight, FaceOrientation.UP.getValue(), envTemperature, 0.1f);
                    TrackAndTemperatureResult trackAndTemperatureResult = new TrackAndTemperatureResult();
                    trackAndTemperatureResult.setFaceInfo(matchFace.rgbFace);
                    trackAndTemperatureResult.setIrFaceInfo(matchFace.irFace);
                    trackAndTemperatureResult.setTemperature(temperInfo.temper);

                    List<T> ts = new ArrayList<>();
                    ts.add((T) trackAndTemperatureResult);
                    return ts;
            }
        };
            }
        };
// Set Temperature Sdk Action
IdentifyManager.getInstance().setTemperatureSdkAction(action);

Get the thermal camera preview data (thermodynamic diagram). Once the temperature data is acquired, it needs to be injected into the Identify Manager in time, as follows

ITemperaturePreviewDataCallback mPreviewDataCallback = 
          new ITemperaturePreviewDataCallback() {

          @Override
      public void onTemperaturePreviewData(
            Bitmap temperatureBitmap, float[] temperatureValue, int width, int height) {

                // temperatureBitmap - thermodynamic diagram, which can be used to draw a temperature bitmap preview
                // temperatureValue - Temperature Data
                // width, height - heat Width and height of Thermodynamic Diagram

                // Inject temperature data into the Identify Manager (if temperature data are not injected after the temperature measurement function is enabled, no recognition will be performed)
                IdentifyManager.getInstance().handleTemperatureData(
                  temperatureBitmap, temperatureValue,width, height, mCameraUseConfig.faceOrientation);
            }
        };

// Set Callback
mTemperatureCamera.addTemperaturePreviewDataCallback(mPreviewDataCallback);

Get personal temperature data from the identification callback results:

// Get Face Identify Result Through Identify Result Callback Interface
IIdentifyResultCallback identifyCallback = new IIdentifyResultCallback() {

    @Override
    public void onDrawFaces(@Nullable List<FaceInfo> list) {
        // Face Detection Callback, which can be used to draw a face calibration frame.
        // It should be noted that this callback still occurs when identification is paused, which means that faces are still being tracked in the process, but just not recognized
    }

    @Override
    public void onClearScreen() {
        // Clear Screen Callback. Clear the screen with this callback when there appears no face in the field of view
    }

    @Override
    public void onUnknown(float faceW) {
                // If the face is too large or too small to determine whether it is liveness or not, notice is given with this method
    }

    @Override
    public void onIdentifyResult(List<FrameIdentifyResult> frameIdentifyResults) {
                // Identify Result Callback
              for (int i = 0; i < frameIdentifyResults.size(); i++) {
            FrameIdentifyResult frameIdentifyResult = frameIdentifyResults.get(i);
            if (frameIdentifyResult == null
                    || frameIdentifyResult.faceIdentifyResults == null
                    || frameIdentifyResult.faceIdentifyResults.size() <= 0) {
                continue;
            }
            List<FaceIdentifyResult> faceIdentifyResults = frameIdentifyResult.faceIdentifyResults;
            for (int j = 0; j < faceIdentifyResults.size(); j++) {
                FaceIdentifyResult faceIdentifyResult = faceIdentifyResults.get(j);
                if (faceIdentifyResult == null || faceIdentifyResult.getIdentifyResultTypeEnum() == null) {
                    continue;
                }
                TrackAndTemperatureResult trackAndTemperatureResult = faceIdentifyResult.getTrackAndTemperatureResult();
                float temperature = 0;
                if (trackAndTemperatureResult != null) {
                    temperature = trackAndTemperatureResult.getTemperature();
                }
                Log.i(TAG, String.format(Locale.getDefault(), "userId-%d temperature is %f",
                                         faceIdentifyResult.getUserId(), temperature));
            }
        }
    }
};

// Set Result Callback
IdentifyManager.getInstance().setIdentifyCallback(identifyCallback);

Use of Pass Access Control

The use of the Pass access control feature requires a global initialization configuration, which is initialized as follows.

// Pass access control function initialization, must be called before use of the access control function
DoorDeviceAccessProxy.init();

final DoorAccessConfig config = new DoorAccessConfig.Builder()
        // Set GPIO B port input type, which can be set to GPIO_IN_NONE by default
        .setGpioInB(DoorAccessConfig.GPIO_IN_NONE)
        // Set GPIO C port input type, which can be set to GPIO_IN_NONE by default
        .setGpioInC(DoorAccessConfig.GPIO_IN_NONE)
        // Set Open Door Time, only for local relays (here set to close after 5 seconds of opening)
        .setOpenDoorTime(5)
        // Set GPIO Output Type
        .setGpioOutA(DoorAccessConfig.GPIO_OUT_NONE)
        // Control RS485 data reading and writing by the Rom itself (Rom support is required. Please set it to false if Rom does not support)
        .setIsSupportRS485GpioAutoControl(true)
        // Set Wiegand Input Protocol Type
        .setWiegandInput(DoorAccessConfig.WIEGAND26_24_BIT)
        // Set Open Door Mode
        .setOpenDoorMode(DoorAccessConfig.OPEN_DOOR_MODE_RELAY)
        .Setthe Serial Port Baud Rate for RS485 Protocol
        .setRS485BaudRate(9600)
        .build();
DoorDeviceAccessProxy.setConfig(config);

The configuration for using the Pass access control function can be dynamically modified by DoorDeviceAccessProxy.setConfig(config).

Key categories of Pass access control function:

  • DoorDeviceAccessProxy: responsible for global initialization, resource release, configuration usage, door opening control.

  • DoorAccessConfig: Categories of Door Access Configuration.

  • PassDoorDeviceAccessProxy: Manage access control functions available to SensePass/SensePassPro devices, such as door chimes, RS485 protocols, alarms, and tamper alarm lights.

Open Door via Local Relay

The "local relay" is a hardware device with its own accessories, used to control the opening of the door and set the door opening time (i.e. open the door for a number of seconds and then close it). The hardware models supporting this function are SensePass, SensePassPro.

The Pass access control function is used as follows:

// Set Open Door Mode to "Local Relay"
DoorAccessConfig mDoorAccessConfig = DoorDeviceAccessProxy.getConfig();
mDoorAccessConfig.setOpenDoorMode(DoorAccessConfig.OPEN_DOOR_MODE_RELAY);
DoorDeviceAccessProxy.setConfig(mDoorAccessConfig);

// This method is a global door opening method, which will automatically execute the door opening action according to the door opening method set in the config
// The IC card number is only used when the input parameter is Wiegand Open Door. Transfer it directly here. “
DoorDeviceAccessProxy.openDoor("");

DoorDeviceAccessProxy.openDoor() automatically acquires the configured door opening method and the delayed closing time, and then automatically executes the door opening action. The user does not need to care about the specific way to open the door, which is automatically controlled by the method. The same is true of door openning with the network relay and the Wiegand controller below.

Specifically, when the delayed closing time needs to be greater than 30 seconds, it is necessary to open the door in the following ways

// Open the door until opDoorTime time before closing the door. The delayed opening time is directly determined by
DoorDeviceAccessProxy.openDoorWithRelay(openDoorTime * 1000);

If the local relay needs to be closed immediately, the following method can be called manually.

DoorDeviceAccessProxy.closeRelayDoor();

Open Door via Network Relay

The "Network Relay" is a peripheral device. The hardware device connects to the network relay through the network, and controls the door opening and delayed closing time by sending door opening commands to the network relay. The hardware models supporting this function are Pass and Thunder series.

The Pass access control function is used as follows:

DoorAccessConfig mDoorAccessConfig = DoorDeviceAccessProxy.getConfig();
// Just fill in the IP, the port has been defaulted to 12345. If it was set during initialization, no need set repeatedly here
mDoorAccessConfig.setRelayIp("192.168.12.11");
// Set Open Door Mode as Network Relay
mDoorAccessConfig.setOpenDoorMode(DoorAccessConfig.OPEN_DOOR_MODE_IP_RELAY);
DoorDeviceAccessProxy.setConfig(mDoorAccessConfig);

// The parameter is the delayed closing time, which can be set freely
DoorDeviceAccessProxy.openDoor("");

Open Door via Wiegand Controller

The "Wiegand Controller" is a peripheral device that connects to the hardware device through an expansion interface and uses the Wiegand protocol for data communication, which can be used to control the door opening. SDK currently supports Wiegand 26, Wiegand 32 and Wiegand 34, and the hardware models that support this function are Pass and Thunder series device.

The maximum card number supported by the standard Wiegand 26 protocol is 8 bits, and the card number data transmission is divided into HID and PID. According to the generation mode of HID and PID, Wiegand 26 is subdivided into two modes, "Wiegand 26 (24bit)" and "Wiegand 26 (8+16bit)”, whose difference is as follows:

  • Wiegand 26 (24bit): For ordinary use mode, the card number is converted to int, divided by 2^16 to take an integer as HID, and the remainder of 2^16 is taken as PID.

  • Wiegand 26 (8+16bit): For special use mode, the first 3 digits of the card number are converted to int as HID, and the last 5 digits are converted to int as PID.

The Pass access control function is used as follows:

  • Open Door via Wiegand 26

String cardNumver = "12345678";
// Open Door via Wiegand 26 (24bit)
DoorDeviceAccessProxy.openDoor(cardNumber);
  • Open Door via Wiegand 32/34

String cardNumver = "1234567890";
DoorDeviceAccessProxy.openDoor(cardNumber);

Wiegand card reading

The "Wiegand card reading" needs to be configured with a Wiegand reader, which is a peripheral device. It connects with the device through the extended interface and uses the Wiegand protocol for data communication to read the IC card number. It supports Wiegand 26 (consistent with the above description), Wiegand 32 and Wiegand 34. The hardware device models supporting this function are Pass and Thunder series device.

The Pass access control function is used as follows:

DoorAccessConfig config = DoorDeviceAccessProxy.getConfig();
// This is set to the Wiegand 26 standard card reader
config.setWiegandInput(DoorAccessConfig.WIEGAND26_24_BIT);
DoorDeviceAccessProxy.setConfig(config);

Once the setup is complete, you can listen to the Wiegand read callback. The code is used as follows.

DoorDeviceAccessProxy.setCardReaderCallback(
            new WiegandReaderDevice.CardReaderCallback() {

    @Override
    public void onRead(String cardNumber) {
        // The card number is read successfully, and the cardNumber is the card number
    }
});

GPIO Input Devices

"GPIO input devices" refer to a class of devices that send GPIO signals to hardware devices through the GPIO port connection, including door opening buttons, fire signals and door magnets. When used, the hardware device serves as the receiver and the "GPIO input device” serves as the sender, and the two communicate through the GPIO input port. The hardware device models that support this feature are Pass and Thunder series device.

Pass access control function supports the use of dual GPIO, divided into B and C. configuration. Before use, set the relevant access control configuration, and its code is as follows:

DoorAccessConfig mDoorAccessConfig = DoorDeviceAccessProxy.getConfig();
// Here it is assumed that the peripheral device is connected to port B to connect to the door button. If you use port C, please set doorAccessConfig.setGpioInC()
mDoorAccessConfig.setGpioInB(DoorAccessConfig.GPIO_IN_DOOR_BUTTON);
DoorDeviceAccessProxy.setConfig(mDoorAccessConfig);

Once the setup is complete, you can listen to the relevant signal input. The code is used as follows.

// When Using Door Button
PassDoorDeviceAccessProxy.setOnClickDoorButtonListener(
                new DoorButtonDevice.DoorButtonOnClickListener() {

        @Override
        public void onClick() {
            // Receive Door Opening Signal
        }
});

// When Using Receive Fire Sign Listener
PassDoorDeviceAccessProxy.setReceiveFireSignListener(
                new FireSignalDevice.ReceiveFireSignListener() {

        @Override
        public void onReceive() {
            // Receive Fire Signal
        }
});

// When using door sensors
PassDoorDeviceAccessProxy.setDoorStateCallback(
                new PassDoorDeviceAccessProxy.DoorMagnetismStateCallback() {

        @Override
        public void onDoorStateChanged(int state) {
            if (state == '0') {
                // Door Magnetism State- Off
            } else {
                // Door Magnetism State- On
            }
        }
});

GPIO Output Devices

"GPIO output devices" refers to peripheral devices connected through GPIO output port for receiving GPIO signals from hardware devices, including doorbell, and alarm. When used, the hardware device serves as the sending end and the "GPIO output type device" serves as the receiving end, and the two communicate through the GPIO output port. The hardware device models that support this feature are Pass and Thunder series.

Before use, set the relevant access control configuration, and its code is as follows:

DoorAccessConfig sgDoorAccessConfig = DoorDeviceAccessProxy.getConfig();
// It is assumed here that the doorbell is used
sgDoorAccessConfig.setGpioOutA(DoorAccessConfig.GPIO_OUT_DOOR_BELL);
DoorDeviceAccessProxy.setConfig(sgDoorAccessConfig);

// When the doorbell rings, the parameter is the time (the actual ringing time may have errors, because the doorbell manufacturer may set the ringing according to the number of times, rather than the specific length of time)
PassDoorDeviceAccessProxy.pressDoorBell(2000);

Specifically, when using the alarm, you need to manually control the alarm and turn off the alarm. The code is used as follows:

// Alarm goes off
PassDoorDeviceAccessProxy.pressAlarmBell();
// Manually turn off the alarm
PassDoorDeviceAccessProxy.releaseAlarmBell();

Light Control

"Lighting Control" mainly controls the lighting accessories of hardware devices, including RGB fill light, IR fill light and screen backlight.

IR Fill Light

The "IR fill light" is part of the IR camera module and is used to enhance the IR image. To increase its lifetime, it can be dynamically controlled to turn off when not in use. The hardware device models that support this feature are Pass and Thunder series.

The code is used as follows:

// Turn on IR fill light
PassDoorDeviceAccessProxy.turnOnIrLight();

// Turn off IR fill light
PassDoorDeviceAccessProxy.turnOffIrLight();

Screen Backlight

The "screen backlight" is an accessory that comes with the hardware device to turn off the screen light when the software application is in a dormant state (such as late at night when the software application is no longer needed), increasing the life of the hardware device and reducing energy consumption. The hardware device models that support this feature are Pass and Thunder series.

The code is used as follows:

// Turn off screen backlight
PassDoorDeviceAccessProxy.closeBackLight();

// Turn on screen backlight
PassDoorDeviceAccessProxy.openBackLight();

RS485 Protocol

The "RS485 protocol" refers to a serial communication protocol standard. The RS485 interface is provided in the hardware device to support its communication in half-duplex mode, Half-duplex data read-only and write-only are controlled automatically by the rom, and the upper business only needs to pay attention to the serial communication. The hardware device models that support this feature are Pass and Thunder series.

Before use, first turn on the RS485 function, and set the baud rate, data buffer, and data transceiver timeout length according to the use scene.The code is used as follows:

// Start rs485, baud rate 9600, read buffer size 32, timeout 3s
PassDoorDeviceAccessProxy..enableRS485(9600, 32, 
            new RS485Device.RS485ReceiveListener() {

            @Override
            public void onReceive(byte[] data, long dataLength) {
                // Received data
            }

        }, 3000, new SerialPortReader.OnReadTimeOutListener() {

            @Override
            public void onTimeout(byte[] data, long dataLength) {
                // Data read timeout
            }
        }
});

To send data, use the following code:

PassDoorDeviceAccessProxy.sendDataByRS485(data);

Tamper alarm button

The "tamper alarm button” is an accessory that comes with the hardware device, located on the back of the device as a raised button. When the button is pressed during normal operation, the button will pop up when the hardware device is removed, and the Rom level will sense it and issue a "tamper alarm" for alerting when the hardware device is removed abnormally.

The Rom level converts the "tamper alarm" into an input event of the "F2 button", i.e. when the "tamper alarm" occurs, the system layer sends the "F2 button" input event. F2 button" input event, so you can listen to the "tamper alarm" by listening to whether the "F2 button" is pressed or not. The code is used as follows:

// Listen to it in the Activity via the onKeyUp() event
public class ForceDisassemblyDemoActivity extends AppCompatActivity {

    // Omit redundant code

    @Override
    public boolean onKeyUp(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_F2) {
            // Listen to tamper alarm
        }
        return super.onKeyUp(keyCode, event);
    }
}

Sensor

"Sensors" refers to the sensors that come with the hardware device, such as light sensors, and distance sensors. For the passage scenario, the role of sensors is as follows:

  • Light sensor: senses light intensity and can set "fill light mode" for applications in low light conditions.

  • Distance sensor: senses the proximity of a person to trigger certain specific operations (e.g. waking up a device in a dormant state when the person is close).

Sensors can be used through the SensorManager class in the Android native SDK, whose code is used as follows:

SensorManager mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
// Use the light sensor. To use a distance sensor, use the parameter Sensor.TYPE_PROXIMITY
Sensor lightSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
if (lightSensor != null) {

    mSensorManager.registerListener(new SensorEventListener() {
        @Override
        public void onSensorChanged(SensorEvent event) {
            // Get the specific value via event.value[0] and do specific processing
        }

        @Override
        public void onAccuracyChanged(Sensor sensor, int accuracy) {

        }
    }, lightSensor, SensorManager.SENSOR_DELAY_NORMAL);

} else {
     // Sensor not available
}

Buzzer

The "buzzer" is an accessory that comes with the hardware device and is mainly used for beeping when an alarm occurs on the hardware device. Currently, only SensePass and SenseThunderE-mini devices support this feature. Using the buzzer requires manual control to turn it on and off, and the code is as follows:

// Turn on Buzzer
PassDoorDeviceAccessProxy.pressBuzzer();

// Turn off Buzzer
PassDoorDeviceAccessProxy.releaseBuzzer();

Application System Signature

The system signature file sensetime.jks is placed in the sample project of the SDK. Using this file as the application signature allows the application to gain system privileges, which allows the application to perform more operations that require high privileges, such as setting system events, and modifying system settings.

To use it, please copy sensetime.jks to the root of the main module of the project, and then add the following configuration to the build.gradle file.

android {

    signingConfigs {
        system {
            keyAlias 'sensetime'
            keyPassword 'sensetime'
            storeFile file('./sensetime.jks')
            storePassword 'sensetime'
        }
    }

    buildTypes {
        debug {
            signingConfig signingConfigs.system
            // ...
        }
        release {
            signingConfig signingConfigs.system
            // ...
        }
    }    
}

And add the system application declaration android:sharedUserId="android.uid.system" to the AndroidManifest.xml file, as follows:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="thunder.wksample"
    android:sharedUserId="android.uid.system">
</manifest>

QR Code Identification

The QR code recognition function can recognize ordinary QR codes normally. When using it, you can select ZXing or ZBar encoding and decoding library. It is recommended to use ZBar, which is more suitable for end-to-side device identification and faster. For more information on how to use it, please see the Sample code. The brief usage is as follows:

QRCodeDecoderProxy qRCodeDecoder = new QRCodeDecoderProxy(new ZBarDecoderImpl());
// previewData is the camera preview frame data
qRCodeDecoder.decodeQRCode(previewData, 1280, 720);

Identify Manager

Support Human Face 1:1 Verification, Local 1:N Identification, Server 1:N Identification and Face Mask Detection.

Description of functional types

IdentifyManager

Entrance for the Identify Manager

Member Function

Description

Version Introduced

boolean setIdentifyTarget(Bitmap avatar)

Set Individual Identification Feature

2.0.0

ImageConfig getImageConfig()

get Image Configuration

2.0.0

IdentifyConfig getIdentifyConfig()

Get Identify Manager Workflow Configuration

2.0.0

ThresholdConfiggetThresholdConfig]()

get Threshold Configuration

2.0.0

void addFaceFilterInterceptor(IFaceFilterInterceptor faceFilterInterceptor)

add Face Filter Interceptor

2.0.0

void handleRgbData(byte[] data)

Handle rgb Image Data

2.0.0

void handleIrData(byte[] data)

Handle ir Image Data

2.0.0

void handleTemperatureData(Bitmap temperatureBitmap,float[] temperatureValue, int width, int height, FaceOrientation temperatureOrientation)

Handle Thermodynamic Diagram and Related Data

2.0.0

void init(ImageConfig imageConfig, IIdentifyResultCallback identifyResultCallback)

Initialize

2.0.0

void pause()

Pause Face Identification

2.0.0

void resume()

Resume Face Identification

2.0.0

void release()

Release Resouce

2.0.0

void removeFaceFilterInterceptor(IFaceFilterInterceptor faceFilterInterceptor)

Remove Face Filter Interceptor

2.0.0

void removeIdentifyTarget()

Remove the Set Individual Identification Feature

2.0.0

void start()

Start Identification

2.0.0

void stop()

Stop Identification

2.0.0

void setIdentifyCallback(IIdentifyResultCallback iIdentifyCallback)

Set Identify Callback

2.0.0

void setVerifyMode(VerifyModeEnum verifyMode)

Set the Verification Mode for the Identification Manager

2.0.0

void setThresholdConfig(ThresholdConfig thresholdConfig)

Set Threshold Configuration

2.0.0

void setIdentifyConfig(IdentifyConfig identifyConfig)

Set Identification Manager Workflow Configuration

2.0.0

void setServerVerifyAction(IServerVerifyAction serverVerifyAction)

Set Server Verification Logic

2.0.0

void setTemperatureSdkAction(ITemperatureSdkAction temperatureSdkAction)

Set Temperature Measurement Sdk Action

2.0.0

Member Function

Description

Version Introduced

boolean setIdentifyTarget(Bitmap avatar)

Set Individual Identification Feature

2.0.0

ImageConfig getImageConfig()

get Image Configuration

2.0.0

IdentifyConfig getIdentifyConfig()

Get Identify Manager Workflow Configuration

2.0.0

ThresholdConfig getThresholdConfig()

get Threshold Configuration

2.0.0

void addFaceFilterInterceptor(IFaceFilterInterceptor faceFilterInterceptor)

add Face Filter Interceptor

2.0.0

void handleRgbData(byte[] data)

Handle rgb Image Data

2.0.0

void handleIrData(byte[] data)

Handle ir Image Data

2.0.0

void handleTemperatureData(Bitmap temperatureBitmap,float[] temperatureValue, int width, int height, FaceOrientation temperatureOrientation)

Handle Thermodynamic Diagram and Related Data

2.0.0

void init(ImageConfig imageConfig, IIdentifyResultCallback identifyResultCallback)

Initialize

2.0.0

void pause()

Pause Face Identification

2.0.0

void resume()

Resume Face Identification

2.0.0

void release()

Release Resouce

2.0.0

void removeFaceFilterInterceptor(IFaceFilterInterceptor faceFilterInterceptor)

Remove Face Filter Interceptor

2.0.0

void removeIdentifyTarget()

Remove the Set Individual Identification Feature

2.0.0

void start()

Start Identification

2.0.0

void stop()

Stop Identification

2.0.0

void setIdentifyCallback(IIdentifyResultCallback iIdentifyCallback)

Set Identify Callback

2.0.0

void setVerifyMode(VerifyModeEnum verifyMode)

Set the Verification Mode for the Identification Manager

2.0.0

void setThresholdConfig(ThresholdConfig thresholdConfig)

Set Threshold Configuration

2.0.0

void setIdentifyConfig(IdentifyConfig identifyConfig)

Set Identification Manager Workflow Configuration

2.0.0

void setServerVerifyAction(IServerVerifyAction serverVerifyAction)

Set Server Verification Logic

2.0.0

void setTemperatureSdkAction(ITemperatureSdkAction temperatureSdkAction)

Set Temperature Measurement Sdk Action

2.0.0

Description of Member Function

boolean setIdentifyTarget(Bitmap avatar)

Set Individual Identification Feature

Parameter

Parameter Name

Type

Description

Note

Version Introduced

avatar

Bitmap

Individual ID Photo

None

2.0.0

Return

Returned Value

Description

Note

Version Introduced

true

Set Success

None

2.0.0

false

Set Fail

None

2.0.0

Exception

None

ImageConfig getImageConfig()

Get Image Configuration

Parameter

None

Return

ImageConfig

Exception

None

IdentifyConfig getIdentifyConfig()

Get Identify Manager Workflow Configuration

Parameter

None

Return

IdentifyConfig

Exception

None

ThresholdConfig getThresholdConfig()

Get Threshold Configuration

Parameter

None

Return

ThresholdConfig

Exception

None

void addFaceFilterInterceptor(IFaceFilterInterceptor faceFilterInterceptor)

Add Face Filter Interceptor

Parameter

Parameter Name

Type

Description

Note

Version Introduced

faceFilterInterceptor

IFaceFilterInterceptor

Face Filter Interceptor

None

2.0.0

Return

None

Exception

None

void handleRgbData(byte[] data)

Handle rgb Data

Parameter

Parameter Name

Type

Description

Note

Version Introduced

data

byte[]

Image Data

None

2.0.0

Return

None

Exception

None

void handleIrData(byte[] data)

Handle irb Data

Parameter

Parameter Name

Type

Description

Note

Version Introduced

data

byte[]

Image Data

None

2.0.0

Return

None

Exception

None

void handleTemperatureData(Bitmap temperatureBitmap,float[] temperatureValue, int width, int height, FaceOrientation temperatureOrientation)

Handle Thermodynamic Diagram and Related Data

Parameter

Parameter Name

Type

Description

Note

Version Introduced

temperatureBitmap

Bitmap

Thermodynamic Diagram

None

2.0.0

temperatureValue

float[]

Temperature Value

None

2.0.0

width

int

Thermodynamic Diagram Width

None

2.0.0

height

int

Thermodynamic Diagram Height

None

2.0.0

temperatureOrientation

FaceOrientation

Face Orientation

None

2.0.0

Return

None

Exception

None

void init(ImageConfig imageConfig, IIdentifyResultCallback identifyResultCallback)

Initialize

Parameter

Type

Parameter Name

Description

Note

Version Introduced

ImageConfig

imageConfig

Image Configuration

None

2.0

IIdentifyResultCallback

identifyResultCallback

Identification Result Callback

None

2.0.0

Return

None

Exception

None

void pause()

Pause Face Identification

Parameter

None

Return

None

Exception

None

void resume()

Resume Face Identification

Parameter

None

Return

None

Exception

None

void release()

Release Resource

Parameter

None

Return

None

Exception

None

void removeFaceFilterInterceptor(IFaceFilterInterceptor faceFilterInterceptor)

Remove Face Filter Interceptor

Parameter

Parameter Name

Type

Description

Note

Version Introduced

faceFilterInterceptor

IFaceFilterInterceptor

Face Filter Interceptor

None

2.0

Return

None

Exception

None

void removeIdentifyTarget()

Remove the Set Individual Identification Feature

Parameter

None

Return

None

Exception

None

void start()

Start Identification

Parameter

None

Return

None

Exception

None

void stop()

Stop Identification

Parameter

None

Return

None

Exception

None

void setIdentifyCallback(IIdentifyResultCallback iIdentifyCallback)

Set Identification Result Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

iIdentifyCallback

IIdentifyResultCallback

Identification Result Callback

None

2.0

Return

None

Exception

None

void setVerifyMode(VerifyModeEnum verifyMode)

Set the Verification Mode for the Identification Manager

Parameter

Parameter Name

Type

Description

Note

Version Introduced

verifyMode

VerifyModeEnum

Verification Mode

None

2.0

Return

None

Exception

None

void setThresholdConfig(ThresholdConfig thresholdConfig)

Set Threshold Configuration

Parameter

Parameter Name

Type

Description

Note

Version Introduced

thresholdConfig

ThresholdConfig

Threshold Configuration

None

2.0

Return

None

Exception

None

void setIdentifyConfig(IdentifyConfig identifyConfig)

Set Identification Manager Workflow Configuration

Parameter

Parameter Name

Type

Description

Note

Version Introduced

identifyConfig

IdentifyConfig

Identification Manager Workflow Configuration

None

2.0

Return

None

Exception

None

void setServerVerifyAction(IServerVerifyAction serverVerifyAction)

Set Server Verification Logic

Parameter

Parameter Name

Type

Description

Note

Version Introduced

serverVerifyAction

IServerVerifyAction

Server Verification Logic

None

2.0

Return

None

Exception

None

void setTemperatureSdkAction(ITemperatureSdkAction temperatureSdkAction)

Set Temperature Measurement Sdk Action

Parameter

Parameter Name

Type

Description

Note

Version Introduced

temperatureSdkAction

ITemperatureSdkAction

Temperature Measurement Sdk Action

None

2.0

Return

None

Exception

None

Description of Entities

ImageConfig

Description of Properties

Member

Type

Description

Note

Version Introduced

int previewW

int

Camera Preview Resolution Width

None

2.0.0

int previewH

int

Camera Preview Resolution Height

None

2.0.0

pixelFormat

MidPixelFormat

Camera Preview Frame Data Format

None

2.0.0

faceOrientation

FaceOrientation

Face Direction in Camera Preview Frame Data

None

2.0.0

MidPixelFormat

Description of Properties

Member

Description

Note

Version Introduced

GRAY8

Y 1

None

2.0.0

YUV420P

YUV 4:2:0

None

2.0.0

NV12

YUV 4:2:0

None

2.0.0

NV21

YUV 4:2:0

None

2.0.0

BGRA8888

BGRA 8:8:8:8

None

2.0.0

BGR888

BGR 8:8:8

None

2.0.0

RGBA8888

RGBA 8:8:8:8

None

2.0.0

RGB888

RGB 8:8:8

None

2.0.0

GRAY16

Special Image Format

Rotation and Conversion to Other Formats are not Provided

2.0.0

RGB565

RGB 5:6:5

None

2.0.0

ABGR8888

ABGR 8:8:8:8

None

2.0.0

FaceOrientation

Description of Properties

Member

Description

Note

Version introduced

UP

Face up

None

2.0.0

LEFT

Face Left

None

2.0.0

DOWN

Face Down

None

2.0.0

RIGHT

Face Right

None

2.0.0

IdentifyConfig

Description of Properties

Member

Type

Description

Note

Version Introduced

debug

boolean

Debug ON/OFF

None

2.0.0

imageConfig

ImageConfig

Identify Frame Information Configuration

None

2.0.0

thresholdConfig

ThresholdConfig

Identify Threshold Configuration

None

2.0.0

hasLiveness

boolean

Liveness ON/OFF

None

2.0.0

isAlwaysLiveness

boolean

Will the Liveness Identification Always be Conducted for the Same trackID

None

2.0.0

isSingleLiveness

boolean

Is it Single Liveness

None

2.0.0

hasTemperatureDetection

boolean

Temperature Detection ON/OFF

None

2.0.0

isMultiTemperatureDetection

boolean

Multi Person Temperature Detection ON/OFF

None

2.0.0

hackNoPassCountThreshold

int

Number of Liveness Identifications Required to Determine Non-liveness

None

2.0.0

strangerCountThreshold

int

Number of Comparisons Required to Determine a Stranger

None

2.0.0

irNoFaceCountThreshold

int

Non-liveness can be Determined After Successive N Frames

None

2.0.0

irAndRgbFaceMinDist

float

Threshold for the minimum distance between RGB camera and IR camera

None

2.0.0

isContinueVerify

boolean

Will the Identification be Continued after the Recognition Result of the Same trackID Comes Out

None

2.0.0

irAndRgbFaceSizeThreshold

float

RGB and IR Face SizeThreshold

None

2.0.0

continueVerifyIntervalTime

long

The Time Interval to Continue the Recognition after the Recognition Result of the Same trackID Comes Out

None

2.0.0

samePersonContinuousRecognitionInterval

long

Continuous Identification Interval of the Same userID()

This parameter is personnel targeted, and is higher than the continueVerifyIntervalTime control

2.0.0

isServerVerify

boolean

is it Server Verification

None

2.0.0

isMultiFaceVerify

boolean

is it Multi Face Verification Senario

None

2.0.0

detectSerialMultiFace

int

An Interval of How Many Frames is Kept for Detection While Tracking

None

2.0.0

isSenseGateConfig

boolean

is it SenseGate Device

SenseGateBD Baseline Distance Calculation is Different from Pass Series

2.0.0

isCheckCameraRotate

boolean

is Camera Rotation Checked

None

2.0.0

isDoVerify

boolean

Face Identification Yes or No

None

2.0.0

isOpenWearMaskIdentify

boolean

Open Wear Mask Identification

None

2.0.0

isInnerEyeTempDetect

boolean

is Inner Eye Temperature Detected

None

2.0.0

unSuccessTimeoutTimeThreshold

int

The timeout period of unsuccessful recognition, that is, only successful recognition will return the result immediately, otherwise it will return the failed result after the timeout

Default-1, means this function is closed

2.0.0

ThresholdConfig

Description of Properties

Member

Type

Description

Note

Version Introduced

verifyAreaRect

RectF

Masked rectangle Area

None

2.0.0

faceMinWidth

int

Recognizable minimum face width

None

2.0.0

faceMaxWidth

int

Recognizable maximum face width

None

2.0.0

alignmentScore

float

Marked Face Alignment Score

None

2.0.0

sharpness

float

Face Ambiguity

None

2.0.0

yaw

float

yaw angle

Profile

2.0.0

pitch

float

pitch angle

Look down and up

2.0.0

roll

float

roll angle

Tilt head

2.0.0

livenessScore

float

Recognition of liveness threshold

None

2.0.0

verifyScore

float

Comparison threshold

None

2.0.0

maskVerifyScore

float

Comparison threshold for wearing a mask

None

2.0.0

IFaceFilterInterceptor

Description of Method

Member Function

Description

Note

Version Introduced

T filterFace(FaceInfo faceInfo, byte[] data, MidPixelFormat midPixelFormat, int width, int height, FaceOrientation faceOrientation)

Face Filter

None

2.0.0

FaceInfo

Description of Properties

Member

Type

Description

Note

Version Introduced

faceRect

Rect

Face Rectangle

None

2.0.0

facePoints

PointF[]

Face Points

None

2.0.0

occlusion

int[]

Face Occlusion

None

2.0.0

id

int

track id

None

2.0.0

detectionScore

float

Detection Score

None

2.0.0

alignmentScore

float

Alignment Score

None

2.0.0

pointsCount

int

Face Points Count

None

2.0.0

yaw

float

yaw angle

None

2.0.0

pitch

float

pitch angle

None

2.0.0

roll

float

roll angle

None

2.0.0

VerifyModeEnum

Description of Properties

Member

Description

Note

Version Introduced

MODE_1_N

1:N Comparison Mode

None

2.0.0

MODE_1_1

1:1 Comparison Mode

None

2.0.0

MODE_SERVER_1_N

Server identification 1:N Mode

None

2.0.0

IIdentifyResultCallback

Description of Method

Member Function

Description

Note

Version Introduced

void onTrackResult(FaceInfo[] faces, byte[] rgbCameraData, byte[] irCameraData)

Callback Track Result

None

2.0.0

void onNoFaceOverTime(byte[] rgbCameraData, byte[] irCameraData)

No Face Callback Detected within the Specified Time

None

2.0.0

void onClearScreen()

No Face Callback

None

2.0.0

void onDrawFaces(List<FaceInfo> faceInfoList)

Callback for drawing faces in the screen

None

2.0.0

void onUnknown(float faceW)

Callback Abnormal Faces

Callback when a Person Stands Far Away and the Liveness Judgment is Inaccurate

void onCameraRotate(FaceOrientation forwardOrientation)

Callback API for camera rotation

None

2.0.0

void onFaceFilterResult(List<FaceFilterResult> faceFilterResults)

Face Filter Callback

None

2.0.0

void onAttributeFilterResult(List<AttributeFilterResult> attributeFilterResults)

Attribute Filter Result

None

2.0.0

void onIdentifyResult(List<FrameIdentifyResult> frameIdentifyResults)

Face Identify Callback

None

2.0.0

void onTrackAndTemperatureResult(List<TrackAndTemperatureResult> results)

Track and Temperature Detection Result

None

2.0.0

FaceFilterResult

Description of Properties

Member

Type

Description

Note

Version Introduced

code

int

Result Code

0-Pass, Filtered if it is not 0. If it is filtered, then the developer should customize it in the interceptor API

2.0.0

interceptorId

int

Interceptor ID

None

2.0.0

faceInfo

FaceInfo

Face Info

None

2.0.0

AttributeFilterResult

Description of Properties

Member

Type

Description

Note

Version Introduced

code

int

Result Code

0-Pass, Filtered if it is not 0, specifically customized by each interceptor

2.0.0

interceptorId

int

Interceptor ID

None

2.0.0

attributeResult

AttributeResult

Attribute Result

None

2.0.0

AttributeResult

Description of Properties

Member

Type

Description

Note

Version Introduced

rgbFace

FaceInfo

Face Info

None

2.0.0

wearMask

boolean

Wear Mask

None

2.0.0

wearEyeGlass

boolean

Wear eye glass or not

None

2.1.0

age

int

Age

None

2.1.0

isMale

boolean

Gender

None

2.1.0

isHasMustache

boolean

Has mustache or not

None

2.1.0

FrameIdentifyResult

Description of Properties

Member

Type

Description

Note

Version Introduced

frameId

int

Frame ID

None

2.0.0

rgbCameraNv21Data

byte[]

RGB frame data corresponding to the recognition result

None

2.0.0

w

int

Frame Width

None

2.0.0

h

int

Frame Height

None

2.0.0

orientation

FaceOrientation

Face Orientation

None

2.0.0

irCameraNv21Data

byte[]

IR frame data corresponding to the recognition result

None

2.0.0

temperatureValue

float[]

Temperature Value

None

2.0.0

temperatureBitmap

Bitmap

temperatureBitmap

None

2.0.0

temperatureWidth

int

Width temperatureBitmap

None

2.0.0

temperatureHeight

int

Height temperatureBitmap

None

2.0.0

temperatureOrientation

FaceOrientation

temperatureBitmap Face Orientation

None

2.0.0

faceIdentifyResults

List<FaceIdentifyResult>

List of Identification Result

None

2.0.0

FaceIdentifyResult

Description of Properties

Member

Type

Description

Note

Version Introduced

faceInfo

FaceInfo

RGB Face Info

None

2.0.0

irFaceInfo

FaceInfo

IR Face Info

None

2.0.0

feature

byte[]

Feature

None

2.0.0

verifyScore

float

Verify Score

None

2.0.0

livenessScore

float

Liveness Score

None

2.0.0

userId

int

User ID

None

2.0.0

trackAndTemperatureResult

TrackAndTemperatureResult

Temperature Result

None

2.0.0

isMask

boolean

Whether a mask is wore or not

None

2.0.0

identifyResultTypeEnum

IdentifyResultTypeEnum

Identification Result

None

2.0.0

faceSearchResult

FaceSearchResult

Search Result

None

2.0.0

AttributeResult

AttributeResult

Face Attribute Result

None

2.1.0

TrackAndTemperatureResult

Description of Properties

Member

Type

Description

Note

Version Introduced

faceInfo

FaceInfo

RGB Face Info

None

2.0.0

irFaceInfo

FaceInfo

IR Face Info

None

2.0.0

temperature

float

Temperature

None

2.0.0

IdentifyResultTypeEnum

Description of Properties

Member

Description

Note

Version Introduced

NON_LIVENESS

NON_LIVENESS

None

2.0.0

LIVENESS

LIVENESS

None

2.0.0

STRANGER

STRANGER

None

2.0.0

VERIFY_SUCCESS

VERIFY_SUCCESS

None

2.0.0

FaceSearchResult

Description of Properties

Member

Type

Description

Note

Version Introduced

userID

int

Index value defined when inserting into the database

None

2.0.0

score

float

The score of the most similar eigenvalue

None

2.0.0

IServerVerifyAction

Description of Method

Member Function

Description

Note

Version Introduced

T verify( byte[] cameraData, byte[] feature,FaceInfo rgbFace, int width, int height)

Face Search Identification

None

2.0.0

ITemperatureSdkAction

Description of Properties

Member Function

Description

Note

Version Introduced

List temperCalculateAir(MatchFace[] matchFaces, Bitmap temperatureBitmap, float[] temperatureData, int temperatureWidth, int temperatureHeight, FaceOrientation temperatureOrientation)

Multi-person temperature measurement algorithm

None

2.0.0

HttpApiClient

HTTP interface implementation

HttpApiClient

Member Function

Description

Version Introduced

byte[] getImage(int type, String imageId)

Get Image Data

2.0.0

ConnectConfigEntity getConnectConfigEntity()

Get Current Connection Configuration

2.0.0

Result alarmReport(AlarmReportParameter reportParameter)

Alarm Report

2.0.0

Result bindDefaultGroup()

bind Default Group

2.0.0

Result checkPasswordUseLoginInterface(String password)

check Password

2.0.0

Result<TslCheckExistResult> checkTslExist(String md5)

check Tsl Exist

2.0.0

Result<TslLanguageCheckExistResult> checkTslLanguageExist(Result checkTslLanguageExist(String lang))(String lang)

check Tsl Language Exist

2.0.0

Result<FaceSearchResult> faceSearch(FaceSearchParameter searchParameter)

Server Identification

2.0.0

Result> getGroupIndexList()

Get Group Index List Bound to the device

2.0.0

Result> getUserIndexList(int groupId)

Get User Index List in a Group

2.0.0

Result> getUserInfoList(UserInfoParameter parameter)

Get User Info List

2.0.0

Result getServiceConfigJson()

Get Server Configuration

2.0.0

Result<DeviceGroups> getAllGroupList()

Get Group List Bound to the Device

2.0.0

Result<DeviceDetailInfo> getDeviceDetailInfo()

Get Device DetaiIed Info

2.0.0

Result<Company> getCompanyInfo()

Get Company Info

2.0.0

Result<UserDetailInfo> getUserInfo(long id)

Get User Detailed Info

2.0.0

Result<GuestDetailInfo> getGuestInfo(long id)

Get Guest Detailed Info

2.0.0

Result<ServerVersion> getServerVersion()

Get Server Version

2.0.0

Result<TimeTable> getPassTimeTable(long timetableId)

Get Pass Time Table

2.0.0

void logout()

logout

2.0.0

Result<QRResult> identifyQRCode(IdentifyQRCodeParameter parameter)

QR Code Identification Interface

2.0.0

Result<LoginResult> login(String account, String password,String identifier, String duid)

Device Login

2.0.0

Result<RegisterResult> register( RegisterParameter registerParameter)

Device Registration

2.0.0

Result reportUserStatus(UserStatusParameter userStatusParameter)

Upload the abnormal status of the user in the local database

2.0.0

Result reportUserStatus(UserSyncStatusParameter userSyncStatusParameter)

Upload the abnormal status of the user in the local database

2.0.0

void refreshConnectConfig(ConnectConfigEntity connectConfig)

refresh Connect Configuration

2.0.0

Result reportDeviceEvent(DeviceReportEventParamer param)

Report Device Status

2.0.0

Result<RecordResult> uploadRecord(RecordParameter recordParameter)

Upload Identification Record

2.0.0

Result uploadDeviceVersionInfo(DeviceVersionInfoParameter deviceInfoParameter)

Upload Device Version Info

2.0.0

Result uploadConfig(String deviceConfigKey, Object config)

Upload Configuration

2.0.0

Result uploadTsl(TslUploadParameter parameter)

upload Tsl

2.0.0

Result uploadTslLanguage(TslLanguageUploadParameter parameter)

upload Tsl Language Package

2.0.0

Description of Member Function

byte[] getImage(int type, String imageId)

Get Image Data

Parameter

Parameter Name

Type

Description

Note

Version Introduced

type

int

Image Type

1-Base Image in Senselink, 2-Recognition Image

2.0.0

imageId

String

Image ID

None

2.0.0

Return

Image Data

Exception

None

ConnectConfigEntity getConnectConfigEntity()

Get Current Connection Configuration

Parameter

None

Return

ConnectConfigEntity

Exception

None

Result alarmReport(AlarmReportParameter reportParameter)

Alarm Report

Parameter

Parameter Name

Type

Description

Note

Version Introduced

reportParameter

AlarmReportParameter

Parameter

None

2.0.0

Return

Result

Exception

None

Result bindDefaultGroup()

Bind Default Group

Parameter

None

Return

Result

Exception

No

Result checkPasswordUseLoginInterface(String password)

Check Password

Parameter

Parameter Name

Type

Description

Note

Version Introduced

password

String

password

None

2.0.0

Return

Result

Exception

None

Result checkTslExist(String md5)

Check Tsl Exist

Parameter

Parameter Name

Type

Description

Note

Version Introduced

md5

String

File md5

None

2.0.0

Return

Result<TslCheckExistResult>

Exception

None

Result checkTslLanguageExist(String lang)

Check Tsl Language Exist

Parameter

Parameter Name

Type

Description

Note

Version Introduced

lang

String

Language

None

2.0.0

Return

Result<TslLanguageCheckExistResult>

Exception

None

Result faceSearch(FaceSearchParameter searchParameter)

Server Identification

Parameter

Parameter Name

Type

Description

Note

Version Introduced

searchParameter

FaceSearchParameter

Parameter

None

2.0.0

Return

Result<FaceSearchResult>

Exception

None

Result> getGroupIndexList()

Get Group Index List Bound to the device

Parameter

None

Return

Result<GroupIndex>

Exception

None

Result> getUserIndexList(int groupId)

Get User Index List in a Group

Parameter

None

Return

Result>

Exception

None

Result> getUserInfoList(UserInfoParameter parameter)

Get User Info List

Parameter

Parameter Name

Type

Description

Note

Version Introduced

parameter

UserInfoParameter

Parameter

None

2.0.0

Return

Result>

Exception

None

Result getServiceConfigJson()

Get Server Configuration

Parameter

None

Return

Result

Exception

None

Result getAllGroupList()

Get Group List Bound to the Device

Parameter

None

Return

Result<DeviceGroups>

Exception

None

Result getDeviceDetailInfo()

Get Device DetaiIed Info

Parameter

None

Return

Result<DeviceDetailInfo>

Exception

None

Result getCompanyInfo()

Get Company Info

Parameter

None

Return

Result<Company>

Exception

No

Result getUserInfo(long id)

Get User Detailed Info

Parameter

Parameter Name

Type

Description

Note

Version Introduced

id

long

User ID

None

2.0.0

Return

Result<UserDetailInfo>

Exception

None

Result getGuestInfo(long id)

Get Guest Detailed Info

Parameter

Parameter Name

Type

Description

Note

Version Introduced

id

long

Guest ID

None

2.0.0

Return

Result<GuestDetailInfo>

Exception

None

Result getServerVersion()

Get Server Version

Parameter

None

Return

Result<ServerVersion>

Exception

None

Result getPassTimeTable(long timetableId)

Get Pass Time Table

Parameter

Parameter Name

Type

Description

Note

Version Introduced

timetableId

long

Pass Time Table ID

None

2.0.0

Return

Result<TimeTable>

Exception

None

void logout()

Log out

Parameter

None

Return

None

Exception

None

Result identifyQRCode(IdentifyQRCodeParameter parameter)

QR Code Identification Interface

Parameter

Parameter Name

Type

Description

Note

Version Introduced

parameter

IdentifyQRCodeParameter

Parameter

None

2.0.0

Return

Result<QRResult>

Exception

None

Result login(String account, String password,String identifier, String duid)

Device Login

Parameter

Parameter Name

Type

Description

Note

Version Introduced

account

String

Device Login Account

None

2.0.0

password

String

Device Login Password

None

2.0.0

identifier

String

Device Identifier

None

2.0.0

duid

String

Device sn

None

2.0.0

Return

Result<LoginResult>

Exception

None

Result register( RegisterParameter registerParameter)

Device Registration

Parameter

Parameter Name

Type

Description

Note

Version Introduced

registerParameter

RegisterParameter

Parameter

None

2.0.0

Return

Result<RegisterResult>

Exception

None

Result reportUserStatus(UserStatusParameter userStatusParameter)

Upload the abnormal status of the user in the local database

Parameter

Parameter Name

Type

Description

Note

Version Introduced

userStatusParameter

UserStatusParameter

Parameter

None

2.0.0

Return

Result

Exception

None

Result reportUserStatus(UserSyncStatusParameter userSyncStatusParameter)

Upload the abnormal status of the user in the local database

Parameter

Parameter Name

Type

Description

Note

Version Introduced

userSyncStatusParameter

UserSyncStatusParameter

Parameter

None

2.0.0

Return

Result

Exception

None

void refreshConnectConfig(ConnectConfigEntity connectConfig)

Refresh Connect Configuration

Parameter

Parameter Name

Type

Description

Note

Version Introduced

connectConfig

ConnectConfigEntity

Configuration

None

2.0.0

Return

None

Exception

None

Result reportDeviceEvent(DeviceReportEventParamer param)

Report Device Event

Parameter

Parameter Name

Type

Description

Note

Version Introduced

param

DeviceReportEventParamer

Parameter

None

2.0.0

Return

Result

Exception

None

Result uploadRecord(RecordParameter recordParameter)

Upload Identification Record

Parameter

Parameter Name

Type

Description

Note

Version Introduced

recordParameter

RecordParameter

Parameter

None

2.0.0

Return

Result<RecordResult>

Exception

None

Result uploadDeviceVersionInfo(DeviceVersionInfoParameter deviceInfoParameter)

Upload Device Version Info

Parameter

Parameter Name

Type

Description

Note

Version Introduced

deviceInfoParameter

DeviceVersionInfoParameter

Parameter

None

2.0.0

Return

Result

Exception

None

Result uploadConfig(String deviceConfigKey, Object config)

Upload Configuration

Parameter

Parameter Name

Type

Description

Note

Version Introduced

deviceConfigKey

String

Device config key

None

2.0.0

config

Object

config Configuration

None

2.0.0

Return

Result

Exception

None

Result uploadTsl(TslUploadParameter parameter)

Upload Tsl

Parameter

Parameter Name

Type

Description

Note

Version Introduced

parameter

TslUploadParameter

Parameter

None

2.0.0

Return

Result

Exception

None

Result uploadTslLanguage(TslLanguageUploadParameter parameter)

Upload Tsl Language Package

Parameter

Parameter Name

Type

Description

Note

Version Introduced

parameter

TslLanguageUploadParameter

Parameter

None

2.0.0

Return

Result

Exception

None

Door Access

Door Access Device Controling Pass and Thunder series devices

Description of functional types

DoorDeviceAccessProxy

Control the overall initialization, configuration, and resource release operations of communication devices such as GPIO ports and serial ports of the control device, and perform specific door opening operations.

Member Function

Description

Version Introduced

DoorAccessConfig getConfig()

Get Door Access Configuration

2.0.0

DoorAccessDevice getDevice(int deviceType)

Get Device

2.0.0

void changeOpenDoorDevice(int mode)

Change Open Door Mode

2.0.0

void closeRelayDoor()

Close Relay Door

2.0.0

void init()

Initialization

2.0.0

void init(String uartName)

Initialization

2.0.0

void openDoor(String cardNumber)

Open Door

2.0.0

void release()

Release Resouce

2.0.0

void setConfig(DoorAccessConfig config)

set Door Access Configuration

2.0.0

void setCardReaderCallback

(WiegandReaderDevice.CardReaderCallback cardReaderCallback)

set Wiegand Card Reader Callback

2.0.0

void setCustomWiegandDataReceivedCallback

(WiegandReaderDevice.OnDataReceivedCallback dataReceivedCallback)

Set Custom Wiegand Data Interface Callback

2.0.0

void setICardNumberAnalysis

(WiegandDoorDevice.ICardNumberAnalysis cardNumberAnalysis)

Set Wiegand Card Number Analysis Mode

2.0.0

Description of Member Function

DoorAccessConfig getConfig()

Get Door Access Configuration

Parameter

None

Return

Returned Value

Description

Note

Version Introduced

DoorAccessConfig

Door Access Configuration Instance

None

2.0.0

Exception

None

DoorAccessDevice getDevice(int deviceType)

Get device reference according to device type

Parameter

Parameter Name

Type

Description

Note

Version Introduced

deviceType

int

Device Type

None

2.0.0

Return

Returned Value

Description

Note

Version Introduced

DoorAccessDevice

Door Access Device

None

2.0.0

Exception

None

void changeOpenDoorDevice(int mode)

Change Open Door Mode

Parameter

Parameter Name

Type

Description

Note

Version Introduced

mode

int

Open Door Mode

DoorAccessConfig Door Access Configuration

2.0.0

Return

None

Exception

None

void closeRelayDoor()

Close Relay Door

Parameter

None

Return

None

Exception

None

void init()

Initialization without serial port number, refer to [void init(String uartName)](#void init(String uartName))

Parameter

None

Return

None

Exception

None

void init(String uartName)

Initialization with serial port number

Parameter

Parameter Name

Type

Description

Note

Version Introduced

uartName

String

Serial port name

None

2.0.0

Return

None

Exception

None

void openDoor(String cardNumber)

Open the door, execute the door opening action according to the set open door mode

Parameter

Parameter Name

Type

Description

Note

Version Introduced

cardNumber

String

IC Card Number

None

2.0.0

Return

No

Exception

No

void release()

Release Resource

Parameter

None

Return

None

Exception

None

void setConfig(DoorAccessConfig config)

Set Door Access Configuration

Parameter

Parameter Name

Type

Description

Note

Version Introduced

config

DoorAccessConfig

Door Access Configuration

None

2.0.0

Return

None

Exception

None

void setCardReaderCallback(WiegandReaderDevice.CardReaderCallback cardReaderCallback)

Set Card Read Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

cardReaderCallback

WiegandReaderDevice.CardReaderCallback

Wiegand Card Reader Callback

None

2.0.0

Return

None

Exception

None

void setCustomWiegandDataReceivedCallback(WiegandReaderDevice.OnDataReceivedCallback dataReceivedCallback)

Set Custom Wiegand Data Interface Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

dataReceivedCallback

WiegandReaderDevice.OnDataReceivedCallback

Wiegand Passthough Data Received Callback

None

2.0.0

Return

No

Exception

No

void setICardNumberAnalysis(WiegandDoorDevice.ICardNumberAnalysis cardNumberAnalysis)

Set Wiegand Card Number String Parsing Method

Parameter

Parameter Name

Type

Description

Note

Version Introduced

cardNumberAnalysis

WiegandDoorDevice.ICardNumberAnalysis

Card Number String Parsing Method

None

2.0.0

Return

No

Exception

No

PassDoorDeviceAccessProxy

Control some door access devices of Pass and Thunder series

Member Function

Description

Version Introduced

void closeBackLight()

Close Back Light

2.0.0

void enableRS485(RS485Device.RS485ReceiveListener listener)

enable RS485

2.0.0

void enableRS485(int baudrate, int readBufferSize, RS485Device.RS485ReceiveListener listener)

enable RS485

2.0.0

void enableRS485(int baudrate, int readBufferSize, RS485Device.RS485ReceiveListener listener, int readTimeout, SerialPortReader.OnReadTimeOutListener timeOutListener)

enable RS485

2.0.0

void openBackLight()

Open Back Light

2.0.0

void pressBuzzer()

press Buzzer

2.0.0

void pressDoorBell(int pressDownDuration)

press Door Bell

2.0.0

void pressAlarmBell()

press Alarm Bell

2.0.0

void releaseAlarmBell()

release Alarm Bell

2.0.0

void releaseBuzzer()

release Buzzer

2.0.0

void setDoorStateCallback(DoorMagnetismStateCallback callback)

set Door State Callback

2.0.0

void setOnClickDoorButtonListener

(DoorButtonDevice.DoorButtonOnClickListener listener)

Door Button On Click Listener

2.0.0

void setReceiveFireSignListener

(FireSignalDevice.ReceiveFireSignListener listener)

Fire Sign Listener

2.0.0

void sendDataByRS485(byte[] data)

send Data By RS485

2.0.0

void turnOnIrLight()

turn On IR Light

2.0.0

void turnOffIrLight()

turn Off IR Light

2.0.0

Description of Member Function

void closeBackLight()

Close Back Light

Parameter

None

Return

None

Exception

None

void enableRS485(RS485Device.RS485ReceiveListener listener)

Enable RS485

Parameter

Parameter Name

Type

Description

Note

Version Introduced

listener

RS485Device.RS485ReceiveListener

Data Receive Callback

None

2.0.0

Return

None

Exception

None

void enableRS485(int baudrate, int readBufferSize, RS485Device.RS485ReceiveListener listener)

Enable RS485

Parameter

Parameter Name

Type

Description

Note

Version Introduced

baudrate

int

baudrate

None

2.0.0

readBufferSize

int

The length of the data to be read

None

2.0.0

listener

RS485Device.RS485ReceiveListener

Data Receive Callback

None

2.0.0

Return

None

Exception

None

void enableRS485(int baudrate, int readBufferSize, RS485Device.RS485ReceiveListener listener, int readTimeout, SerialPortReader.OnReadTimeOutListener timeOutListener)

Enable RS485

Parameter

Parameter Name

Type

Description

Note

Version Introduced

baudrate

int

baudrate

None

2.0.0

readBufferSize

int

The length of the data to be read

None

2.0.0

listener

RS485Device.RS485ReceiveListener

Data Receive Callback

None

2.0.0

readTimeout

int

Data read timeout period

None

2.0.0

timeOutListener

SerialPortReader.OnReadTimeOutListener

Data read timeout callback

None

2.0.0

Return

None

Exception

None

void openBackLight()

Open Back Light

Parameter

None

Return

None

Exception

None

void pressBuzzer()

press Buzzer (Only support SensePass and SenseThunderE-mini)

Parameter

None

Return

None

Exception

None

void pressDoorBell(int pressDownDuration)

press Door Bell

Parameter

Parameter Name

Type

Description

Note

Version Introduced

pressDownDuration

int

press Down Duration, unit millisecond

None

2.0.0

Return

None

Exception

None

void pressAlarmBell()

Press Alarm Bell to Turn the Alarm On

Parameter

None

Return

None

Exception

None

void releaseAlarmBell()

Release Alarm Bell

Parameter

None

Return

None

Exception

None

void releaseBuzzer()

Buzzer Off (Only supports SensePass020)

Parameter

None

Return

None

Exception

None

void setDoorStateCallback(DoorMagnetismStateCallback callback)

Set Door State Callback, Door Open/Close Status Listener

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

DoorMagnetismStateCallback

State Callback

None

2.0.0

Return

None

Exception

None

void setOnClickDoorButtonListener(DoorButtonDevice.DoorButtonOnClickListener listener)

Door Button On Click Listener

Parameter

Parameter Name

Type

Description

Note

Version Introduced

listener

DoorButtonDevice.DoorButtonOnClickListener

Door Button On Click Listener

None

2.0.0

Return

None

Exception

None

void setReceiveFireSignListener(FireSignalDevice.ReceiveFireSignListener listener)

Receive Fire Sign Listener

Parameter

Parameter Name

Type

Description

Note

Version Introduced

listener

FireSignalDevice.ReceiveFireSignListener

Fire Sign Listener

None

2.0.0

Return

None

Exception

None

void sendDataByRS485(byte[] data)

Send Data By RS485

Parameter

Parameter Name

Type

Description

Note

Version Introduced

data

byte[]

Data to be Sent

None

2.0.0

Return

None

Exception

None

void turnOnIrLight()

Turn on IR Light, Support Pass and Thunder series

Parameter

None

Return

None

Exception

None

void turnOffIrLight()

Turn off IR Light, Support Pass and Thunder series

Parameter

None

Return

None

Exception

None

Description of Entities

DoorAccessConfig

Door Access Configuration

Description of Properties

OPEN_DOOR_MODE

Member

Description

Note

Version Introduced

static final int OPEN_DOOR_MODE_RELAY

Open Local Relay Door,

constant

2.0.0

static final int OPEN_DOOR_MODE_IP_RELAY

network relay

constant

2.0.0

static final int OPEN_DOOR_MODE_WIEGAND26_24_BIT

WIEGAND26(24bit)

constant

2.0.0

static final int OPEN_DOOR_MODE_WIEGAND26_8_16_BIT

WIEGAND26(8 + 16 bit)

constant

2.0.0

static final int OPEN_DOOR_MODE_WIEGAND32

WIEGAND32

constant

2.0.0

static final int OPEN_DOOR_MODE_WIEGAND34

WIEGAND34

Constant

2.0.0

static final int OPEN_DOOR_MODE_CUSTOM

Wiegand Custom (Output)

Constant

2.0.0

Wiegand Input

Member

Description

Note

Version Introduced

static final int WIEGAND26_24_BIT

WIEGAND26(24bit)

Constant

2.0.0

static final int WIEGAND26_8_16_BIT

WIEGAND26(8 + 16bit)

Constant

2.0.0

static final int WIEGAND32

WIEGAND32

Constant

2.0.0

static final int WIEGAND34

WIEGAND34

Constant

2.0.0

static final int WIEGAND_INPUT_CUSTOM

WIEGAND CUSTOM (INPUT)

Constant

2.0.0

GPIO Configuration

Member

Description

Note

Version Introduced

static final int GPIO_IN_NONE

GPIO Input not Configured

Constant

2.0.0

static final int GPIO_IN_DOOR_MAGNETISM

GPIO Input Configuration DOOR MAGNETISM

Constant

2.0.0

static final int GPIO_IN_DOOR_BUTTON

GPIO Input Configuration DOOR BUTTON

Constant

2.0.0

static final int GPIO_IN_FIRE_SIGNAL

GPIO Input Configuration FIRE SIGNAL

Constant

2.0.0

static final int GPIO_OUT_NONE

GPIO Output not configured

Constant

2.0.0

static final int GPIO_OUT_DOOR_BELL

GPIO Output Configuration DOOR BELL

Constant

2.0.0

static final int GPIO_OUT_ALARM

GPIO Output Configuration ALARM

Constant

2.0.0

Settable Properties

Member

Description

Note

Version Introduced

int mOpenDoorTime

Open Door Time

None

2.0.0

int mOpenDoorMode

Open Door Mode

None

2.0.0

int mGpioOut

GPIO Output Port

None

2.0.0

int mGpioInA

GPIO Input A

None

2.0.0

int mGpioInB

GPIO Input B

None

2.0.0

int mWiegandInput

Wiegand Input

None

2.0.0

int mDoorMagnetismTimeout

Door Magnetism Timeout

None

2.0.0

String mRelayIp

Network Relay IP

None

2.0.0

int mRS485BaudRate

RS485 Serial Port Baud Rate

Default 9600

2.0.0

int mRS485BufferSize

RS485 buffer size

Default 64

2.0.0

boolean mIsSupportRS485GpioAutoControl

Support RS485 GPIO Auto Control

None

2.0.0

int mPulseCycle

Pulse Cycle

Default 2400

2.0.0

int mPulseWidth

Pulse Width

Default 380

2.0.0

boolean mReverseCardNumber

Reverse Card Number

None

2.0.0

Description of Method

Member Function

Description

Note

Version Introduced

DoorAccessConfig build()

Build an Instance of DoorAccessConfig

None

2.0.0

DoorAccessDevice

Door Access Device

Description of Method

Member Function

Description

Note

Version Introduced

int getDeviceId()

Return Device ID

None

2.0.0

void setConfig(DoorAccessConfig config)

add Device Configuration

None

2.0.0

void destroyDevice()

Destroy Device

None

2.0.0

boolean isDeviceCreated()

Device Created

None

2.0.0

void createDevice()

Create Device

None

2.0.0

CardReaderCallback

WIEGAND Device Card Reader Callback

Description of Method

Member Function

Description

Note

Version Introduced

void onRead(String cardNumber)

Card Read Successful and Get Card Number

None

2.0.0

OnDataReceivedCallback

Wiegand Passthough Data Received Callback

Description of Method

Member Function

Description

Note

Version Introduced

void onDataReceived(byte[] cardData)

Data Receive Callback

cardData: Customized Wiegand Card Number Data

2.0.0

ICardNumberAnalysis

Analysis of Customized Wiegand Card Number Data

Description of Method

Member Function

Description

Note

Version Introduced

byte[] analysis(String cardDataString)

The card string is parsed into byte[] data

cardDataString card Data String Return the custom Wiegand data corresponding to the card

2.0.0

DoorMagnetismStateCallback

Door Magnetism State Callback

Description of Method

Member Function

Description

Note

Version Introduced

void onDoorStateChanged(int state)

Door Magnetism State Callback

state 0-OFF, 1-ON

2.0.0

ReceiveFireSignListener

Fire Sign Listener

Description of Method

Member Function

Description

Note

Version Introduced

void onReceive()

Fire Sign Listener

None

2.0.0

ReceiveDismantleSignListener

Dismantle Sign Listener

Description of Method

Member Function

Description

Note

Version Introduced

void onReceive()

Dismantle Sign Listener

None

2.0.0

SensorListener

Sensor Data change interface

Description of Method

Member Function

Description

Note

Version Introduced

void onSensorChanged(String value)

Data Change Callback

None

2.0.0

OnSensorChangedListener

Ir Listener

Description of Method

Member Function

Description

Note

Version Introduced

void onInfraredSignalRead()

Ir Callback

None

2.0.0

RS485ReceiveListener

RS485 Data Read Listener

Description of Method

Member Function

Description

Note

Version Introduced

void onReceive(byte[] data,long dataLength)

RS485 Data Read Listener

dataLength: Data Length; data: Data Read

2.0.0

OnReadTimeOutListener

RS485 Data Read Time Out Callback

Description of Method

Member Function

Description

Note

Version Introduced

void onTimeout(byte[] data,long dataLength)

RS485 Data Read Time Out Callback

dataLength: Data Length; data: Data read when timeout

2.0.0

DoorButtonOnClickListener

Door Button On Click Listener

Description of Method

Member Function

Description

Note

Version Introduced

void onClick()

Door Button On Click Callback

None

2.0.0

MqttApiClient

MQTT Interface implementation

MqttApiClient

Member Function

Description

Version introduced

void connectMqtt(IMqttActionListener listener, IConnectionLost connectionLost, boolean useTokenConnect, SocketFactory socketFactory)

Connect MQTT

2.0.0

void disConnectMqtt(IMqttActionListener listener)

Disconnect MQTT

2.0.0

void getUserListInGroup

(int groupId, MessageCallback callback)

Get User List In a Group

2.0.0

void registerGroupChangeListener

(MessageCallback callback)

Register Device and User In Group Change Callback

2.0.0

void registerUserInGroupChangeListener

(int groupId, MessageCallback callback)

Register User In Group Change Callback

2.0.0

void registerWarningAction(MessageCallback callback)

Register Warning Action Change Callback

2.0.0

void registerAccessStrategy

(MessageCallback callback)

Register Access Strategy Change Callback

2.0.0

void registerUpgrade

(MessageCallback callback)

Register APP and ROM Update Callback

2.0.0

void registerDeviceStatus

(MessageCallback callback)

Register Device Status Change Callback

2.0.0

void registerDeviceConfig(MessageCallback callback)

Register Device Configuration Change Callback

2.0.0

void registerDeviceNotify(MessageCallback callback)

Register Device Server End Notification Push Callback

2.0.0

void registerKeepDoorOpenOrCloseSchedule

(MessageCallback callback)

Register Device Keep Door Open Or Close Schedule Push Callback

2.0.0

void unRegisterGroupChangeListener()

Unregister Device and User In Group Change Callback

2.0.0

void unegisterUserInGroupChangeListener(int groupId)

Unregister User In Group Change Callback

2.0.0

void unegisterGetUserListInGroup(int groupId)

Unregister User List of a Group

2.0.0

void unRegisterWarningAction()

Unregister Warning Action Change Callback

2.0.0

void unRegisterAccessStrategy()

Unregister Access Strategy Change Callback

2.0.0

void unRegisterUpgrade()

Unregister APP and ROM Update Callback

2.0.0

void unRegisterDeviceStatus()

Unregister Device Status Change Callback

2.0.0

void unRegisterDeviceConfig()

Unregister Device Configuration Change Callback

2.0.0

void unRegisterDeviceNotify()

Unregister Device Server End Notification Push Callback

2.0.0

void unRegisterKeepDoorOpenOrCloseSchedule()

Unregister Device Keep Door Open Or Close Schedule Push Callback

2.0.0

Description of Member Function

void connectMqtt(IMqttActionListener listener, IConnectionLost connectionLost, boolean useTokenConnect, SocketFactory socketFactory)

Connect MQTT

Parameter

Parameter Name

Type

Description

Note

Version Introduced

listener

IMqttActionListener

Callback

None

2.0.0

connectionLost

IConnectionLost

Connection Lost Callback

None

2.0.0

useTokenConnect

boolean

Use Token Connect

None

2.0.0

socketFactory

SocketFactory

The verification method used to build https

certificate not verified by default

2.0.0

Return

None

Exception

None

void disConnectMqtt(IMqttActionListener listener)

Disconnect MQTT

Parameter

Parameter Name

Type

Description

Note

Version Introduced

listener

IMqttActionListener

Callback

None

2.0.0

Return

None

Exception

None

void getUserListInGroup(int groupId, MessageCallback callback)

Get User List In a Group

Parameter

Parameter Name

Type

Description

Note

Version Introduced

groupId

int

Group ID

None

2.0.0

callback

MessageCallback

Callback

None

2.0.0

Return

None

Exception

None

void registerGroupChangeListener(MessageCallback callback)

Register Device and User In Group Change Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

MessageCallback

Callback

None

2.0.0

Return

None

Exception

None

void registerUserInGroupChangeListener(int groupId, MessageCallback callback)

Register User In Group Change Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

groupId

int

Group ID

None

2.0.0

callback

MessageCallback

Callback

None

2.0.0

Return

None

Exception

None

void registerWarningAction(MessageCallback callback)

Register Warning Action Change Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

MessageCallback

Callback

None

2.0.0

Return

None

Exception

None

void registerAccessStrategy(MessageCallback callback)

Register Access Strategy Change Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

MessageCallback

Callback

None

2.0.0

Return

None

Exception

None

void registerUpgrade(MessageCallback callback)

Register APP and ROM Update Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

MessageCallback

Callback

None

2.0.0

Return

None

Exception

None

void registerDeviceStatus(MessageCallback callback)

Register Device Status Change Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

MessageCallback

Callback

None

2.0.0

Return

None

Exception

None

void registerDeviceConfig(MessageCallback callback)

Register Device Configuration Change Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

MessageCallback

Callback

None

2.0.0

Return

None

Exception

None

void registerDeviceNotify(MessageCallback callback)

Register Device Server End Notification Push Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

MessageCallback

Callback

None

2.0.0

Return

None

Exception

None

void registerKeepDoorOpenOrCloseSchedule(MessageCallback callback)

Register Device Keep Door Open Or Close Schedule Push Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

callback

MessageCallback

Callback

None

2.0.0

Return

None

Exception

None

void unRegisterGroupChangeListener()

Unregister Device and User In Group Change Callback

Parameter

None

Return

None

Exception

None

void unegisterUserInGroupChangeListener(int groupId)

Unregister User In Group Change Callback

Parameter

Parameter Name

Type

Description

Note

Version Introduced

groupId

int

Group ID

None

2.0.0

Return

None

Exception

None

void unegisterGetUserListInGroup(int groupId)

Unregister User List of a Group

Parameter

Parameter Name

Type

Description

Note

Version Introduced

groupId

int

Group ID

None

2.0.0

Return

No

Exception

No

void unRegisterWarningAction()

Unregister Warning Action Change Callback

Parameter

None

Return

None

Exception

None

void unRegisterAccessStrategy()

Unregister Access Strategy Change Callback

Parameter

None

Return

None

Exception

None

void unRegisterUpgrade()

Unregister APP and ROM Update Callback

Parameter

No

Return

No

Exception

No

void unRegisterDeviceStatus()

Unregister Device Status Change Callback

Parameter

None

Return

None

Exception

None

void unRegisterDeviceConfig()

Unregister Device Configuration Change Callback

Parameter

None

Return

None

Exception

None

void unRegisterDeviceNotify()

Unregister Device Server End Notification Push Callback

Parameter

None

Return

None

Exception

None

void unRegisterKeepDoorOpenOrCloseSchedule()

Unregister Device Keep Door Open Or Close Schedule Push Callback

Parameter

None

Return

None

Exception

None

Description of Entities

LanguageTypeEnum

Description of Properties

Member

Description

Note

Version Introduced

ZH

Simplified Chinese

None

2.0.0

ZH_TW

Traditional Chinese

None

2.0.0

EN

English

None

2.0.0

JP

Japanese

None

2.0.0

KO

Korean

None

2.0.0

ConnectConfigEntity

Description of Properties

Member

Type

Description

Note

Version Introduced

account

String

Account

None

2.0.0

password

String

Password

None

2.0.0

identifier

String

Device Identifier

None

2.0.0

duid

String

Device SN

None

2.0.0

token

String

Device Token

None

2.0.0

ldid

String

Device Background Identification Number

None

2.0.0

companyId

int

Company ID

None

2.0.0

isNewDevice

boolean

Is New Device

None

2.0.0

Result

Description of Properties

Member

Type

Description

Note

Version Introduced

code

int

Status Code

None

2.0.0

data

T

Data

None

2.0.0

message

String

message

None

2.0.0

desc

String

Description

None

2.0.0

originData

String

Origin Data

None

2.0.0

rawData

byte[]

Binary Data

None

2.0.0

Description of Method

Member Function

Description

Note

Version Introduced

boolean isSuccess()

Request Success

true-success, false-fail

2.0.0

AlarmReportParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

is it necessary

traceId

String

Alarm Serial Number

None

2.0.0

Y

alarmPhoto

String

Alarm Photo

None

2.0.0

N

code

int

Alarm Code

10001 stands for disassembly alarm, 10002 stands for forced door open alarm, 10003 stands for door magnetism overtime alarm, 10004 is password attack alarm, 10005 is Bluetooth power shortage, 10006 indicates thermal imager connection exception, 20001 shows camera contamination, 20002 means a non-liveness attack, 20003 is fire alarm and 40001 stands for feature extraction failure

2.0.0

If the parameter "status" is 1, then the parameter "code" is necessary, otherwise it is optional

description

String

Alarm Description

None

2.0.0

N

eventTime

Long

Event Time

millisecond precision

2.0.0

Y

status

int

Alarm Report Event

1 means there is an alarm, 2 means alarm clearance failed, 3 means alarm clearance successful

2.0.0

Y

rectangle

List<VerticesItem>

rectangle coordinate

The first is the upper left corner coordinates, the second is the lower right corner coordinates

2.0.0

N

userId

long

User ID

None

2.0.0

N

VerticesItem

Description of Properties

Member

Type

Description

Note

Version Introduced

is it necessary

x

int

x Coordinate

None

2.0.0

Y

y

int

y Coordinate

None

2.0.0

Y

GuestDetailInfo

Description of Properties

Member

Type

Description

Note

Version Introduced

id

long

Guest id

None

2.0.0

avatar

String

Compare Avatar

None

2.0.0

showAvatar

String

Show Avatar

None

2.0.0

name

String

Name

None

2.0.0

groups

List<GroupsItem>

Group

None

2.0.0

mobile

String

Contact Info

None

2.0.0

guestCompany

String

Guest Company

None

2.0.0

birthday

String

Birthday

None

2.0.0

position

String

Position

None

2.0.0

idNumber

String

ID Number

None

2.0.0

icNumber

String

ic Card Number

None

2.0.0

mail

String

Mail

None

2.0.0

guestPurpose

String

Guest Purpose

None

2.0.0

receptionUserId

long

reception User id

None

2.0.0

receptionUserName

String

reception User Name

None

2.0.0

dateTimeFrom

String

Effective Time From

None

2.0.0

dateTimeTo

String

Effective Time To

None

2.0.0

level

int

level

None

2.0.0

remark

String

Note

None

2.0.0

GroupsItem

Description of Properties

Member

Type

Description

Note

Version Introduced

id

int

Group ID

None

2.0.0

name

String

Group Name

None

2.0.0

type

int

Group Type

1:User Group, 2: Guest Group, 5: deny list Group

2.0.0

personCount

int

person Count

None

2.0.0

TslCheckExistResult

Description of Properties

Member

Type

Description

Note

Version Introduced

flag

int

Flag

0 Not Exist, 1 Exist

2.0.0

TslLanguageCheckExistResult

Description of Properties

Member

Type

Description

Note

Version Introduced

flag

int

Flag

0 Not Exist, 1 Exist

2.0.0

md5

String

File md5

None

2.0.0

FaceSearchResult

Description of Properties

Member

Type

Description

Note

Version Introduced

searchResult

List<SearchResultItem>

Search Result

None

2.0.0

gateCtrl

boolean

Door Open

None

2.0.0

timestamp

long

Timestamp uploaded when requested by the client

None

2.0.0

passRuleType

int

Pass Rule Type

0: Local Pass Rule 1: Server Pass Rule

2.0.0

sign

String

md5, check note for detail

The md5 Value of {timestamp}-{ldid}-{gateCtrl}-{passRuleType}

2.0.0

SearchResultItem

Description of Properties

Member

Type

Description

Note

Version Introduced

faceCutImage

Content

Face Cut Image

None

2.0.0

score

float

Verify Score

None

2.0.0

userId

int

User ID

None

2.0.0

userCardId

String

User Door Access Card ID

None

2.0.0

userImage

Content

User Library Image

None

2.0.0

trackId

int

id for Face Tracking

None

2.0.0

userName

String

User Name

None

2.0.0

displayMsg

String

display Msg

None

2.0.0

displayColor

String

display Color

None

2.0.0

verifyCode

int

Verification Code

1: Unactivated, 2: activated, 3: Unauthorized 4: Match failed, 5: Not within the passable time range

2.0.0

type

int

Type

None

2.0.0

idNumber

String

id Number

None

2.0.0

sign

String

md5

the md5 Value of {verifyCode}-{timestamp}-{ldid}-{userId}

2.0.0

extra

String

Extra String

None

2.0.0

Content

Description of Properties

Member

Type

Description

Note

Version Introduced

data

String

Original Image Data

Choose it or url

2.0.0

format

String

Image Type

IMAGE_UNKNOWN, IMAGE_JPEG, IMAGE_PNG, IMAGE_BMP, IMAGE_TIFF, IMAGE_GIF

2.0.0

url

String

Image url

choose it or data

2.0.0

FaceSearchParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

Is it necessary

targetImages

ImagesItem

Capture several groups of small pictures

small picture is not required if a full picture is uploaded

2.0.0

N

extraInfo

String

Extra String

None

2.0.0

N

receiveTime

long

receive Timestamp

millisecond class

2.0.0

N

fullImage

Content

full picture

full picture is not required if a caputured small picture is uploaded

2.0.0

Y

captureTime

long

Capture Timestamp

millisecond class

2.0.0

N

cameraInfo

CameraInfo

Camera Common Info

None

2.0.0

N

timestamp

long

Timestamp

millisecond class

2.0.0

N

ImagesItem

Description of Properties

Member

Type

Description

Note

Version Introduced

detectionMode

String

detection Mode

DETECT_MODE_AUTO: Automatically select the detection frame according to TargetAnnotation.rectangle and the size of the captured image.DETECT_MODE_BOUNDING_ONLY: Only use TargetAnnotation.rectangle.Rectangle must be passed in, otherwise it is an invalid target.DETECT_MODE_FORCE_DETECTION: Mandatory use of detection model for detection

2.0.0

targetInfo

TargetInfo

general capture target information structure

None

2.0.0

content

Content

Image Content

None

2.0.0

imageType

int

Image Type

1: rgb Image, 2: ir Image

2.0.0

mask

int

Wear Mask

0 Not pass in, 1 No,2 Yes

2.0.0

bodyTemperature

float

body Temperature

None

2.0.0

TargetInfo

Description of Properties

Member

Type

Description

Note

Version Introduced

trackId

int

Track id

None

2.0.0

angle

Angle

Face Angle Info

None

2.0.0

rectangle

Rectangle

Rectangle

None

2.0.0

landmarks

List<LandmarksItem>

Object key point coordinate

None

2.0.0

quality

float

Target detection quality

[0.0, 1.0]

2.0.0

Angle

Description of Properties

Member

Type

Description

Note

Version Introduced

roll

int

Face roll angle

None

2.0.0

pitch

int

Face pitch angle

None

2.0.0

yaw

int

Face yaw angle

None

2.0.0

Rectangle

Description of Properties

Member

Type

Description

Note

Version Introduced

vertices

List<VerticesItem>

Target rectangular area

coordinates of the upper left corner, coordinates of the lower right corner

2.0.0

VerticesItem

Description of Properties

Member

Type

Description

Note

Version Introduced

x

int

x Coordinate

None

2.0.0

y

int

y Coordinate

None

2.0.0

LandmarksItem

Description of Properties

Member

Type

Description

Note

Version Introduced

x

int

x Coordinate

None

2.0.0

y

int

y Coordinate

None

2.0.0

CameraInfo

Description of Properties

Member

Type

Description

Note

Version Introduced

placeName

String

Name of the place where the camera is located

None

2.0.0

deviceId

String

Camera Hardware id

None

2.0.0

tollgateId

String

id of the toll gate where the camera is located

None

2.0.0

tollgateName

String

Name of the toll gate where the camera is located

None

2.0.0

cameraId

String

Camera id

None

2.0.0

deviceType

String

Camera HardwareType

None

2.0.0

placeCode

String

code of the place where the camera is located

None

2.0.0

GroupIndex

Description of Properties

Member

Type

Description

Note

Version Introduced

updatedAt

long

Update Timestamp

None

2.0.0

groupId

int

Group ID

None

2.0.0

groupName

String

Group Name

None

2.0.0

createdAt

long

Created Timestamp

None

2.0.0

UserIndex

Description of Properties

Member

Type

Description

Note

Version Introduced

userUpdatedAt

long

User Update Time

None

2.0.0

userId

int

User ID

None

2.0.0

UserInfoResult

Description of Properties

Member

Type

Description

Note

Version Introduced

birthday

String

Birthday

None

2.0.0

modelVersion

String

Model Version

None

2.0.0

mail

String

Mail

None

2.0.0

gender

int

Gender

0-Unknown, 1-Female, 2-Male

userName

String

User Name

None

2.0.0

phoneSuffix

String

Mobile Number Suffix

None

2.0.0

createdAt

long

Create Timestamp

None

2.0.0

remark

String

Remark

None

2.0.0

addChannel

int

add Channel

1: web; 2: senseid; 3: QR Code; 4: openapi 5: SenseHi App Self-modification 6: batch tool

type

int

User Type

1:User 2:Guest 3 deny list

avatarShow

String

Art Photo ID

None

2.0.0

dateTimeTo

long

End Timestamp

None

2.0.0

guestCompany

String

Guest Company

None

2.0.0

guestLevel

String

Guest Level

None

2.0.0

feature

String

Face Feature

None

2.0.0

updatedAt

long

Update Timestamp

None

2.0.0

jobNumber

String

Job Number

None

2.0.0

icNumber

String

IC Card Number

None

2.0.0

dateTimeFrom

long

Start Timestamp

None

2.0.0

entryTime

long

Entry Time

None

2.0.0

idNumber

String

ID Number

None

2.0.0

companyId

int

User Company ID

None

2.0.0

departmentId

int

User Department ID

None

2.0.0

departmentName

String

Department Name

None

2.0.0

areaCode

String

Area Code

None

2.0.0

mobile

String

Mobile Number

None

2.0.0

permission

int

Access permission

0-Permitted, 1-Not Permitted

2.0.0

receptionUserId

int

User id for Guest Reception

None

2.0.0

avatar

String

Avatar ID

None

2.0.0

countryCode

String

Country Code

None

2.0.0

staffType

int

Staff Type

1-Staff, 2Intern

2.0.0

userId

int

User ID

None

2.0.0

guestPurpose

String

guest Purpose

None

2.0.0

location

String

Location

None

2.0.0

position

String

Position

None

2.0.0

placeCode

String

Place Code

None

2.0.0

prompt

String

Personalized Prompt

None

2.0.0

UserInfoParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

userIds

List

User id Arrays

Up to 20,000 arrays at a time

2.0.0

modelVersion

String

Model Version

None

2.0.0

DeviceGroups

Description of Properties

Member

Type

Description

Note

Version Introduced

id

String

Device ID

None

2.0.0

userGroups

List<GroupsItem>

User Group

None

2.0.0

guestGroups

List<GroupsItem>

Guest Group

None

2.0.0

denyListGroup

List<GroupsItem>

deny list group

None

2.0.0

DeviceDetailInfo

Description of Properties

Member

Type

Description

Note

Version Introduced

deviceTypeMaxOnline

DeviceTypeMaxOnline

Device Type Max Online

None

2.0.0

ldid

String

Device LDID

None

2.0.0

typeName

String

Device Type Name

None

2.0.0

userGroup

List<GroupsItem>

User Group

None

2.0.0

guestGroup

List<GroupsItem>

Guest Group

None

2.0.0

typeId

int

Device TypeID

None

2.0.0

name

String

Device Name

None

2.0.0

description

String

Device Description Info

None

2.0.0

location

String

Device Location

None

2.0.0

id

int

Device ID

None

2.0.0

state

int

Device State

1 - Online, 0-Offline

2.0.0

direction

int

Device In and Out Direction

0-Default, 1-In, 2-Out

2.0.0

DeviceTypeMaxOnline

Description of Properties

Member

Type

Description

Note

Version Introduced

companyId

int

Device Company ID

None

2.0.0

serviceConfig

List<ServiceConfigItem>

Server Configuration

None

2.0.0

typeId

int

Device Type ID

None

2.0.0

maxOnlineNum

int

Device Max Online Number

None

2.0.0

ServiceConfigItem

Description of Properties

Member

Type

Description

Note

Version Introduced

name

String

Device Name

None

2.0.0

options

List<Options>

Customized Options

None

2.0.0

id

String

Device ID

None

2.0.0

Options

Description of Properties

Member

Type

Description

Note

Version Introduced

text

String

Text String

None

2.0.0

value

String

Corresponding Content

None

2.0.0

Company

Description of Properties

Member

Type

Description

Note

Version Introduced

guestGroupId

int

Guest Group ID

None

2.0.0

validFrom

String

Valid From

None

2.0.0

createBy

String

Creator ID

None

2.0.0

background

String

Background

None

2.0.0

contact

String

Contact

None

2.0.0

validTo

String

Valid To

None

2.0.0

name

String

Company Name

None

2.0.0

updateAt

String

Update Time

None

2.0.0

logo

String

Company logo

None

2.0.0

id

int

Company ID

None

2.0.0

createAt

String

Create Time

None

2.0.0

welcome

String

Welcome Message

None

2.0.0

introduction

String

Company Introduction

None

2.0.0

userGroupId

int

User Group ID

None

2.0.0

RsaResult

Description of Properties

Member

Type

Description

Note

Version Introduced

empoent

String

e1

None

2.0.0

module

String

Product of prime numbers

None

2.0.0

rsaId

String

Key ID

None

2.0.0

UserDetailInfo

Description of Properties

Member

Type

Description

Note

Version Introduced

birthday

String

Birthday

None

2.0.0

icNumber

String

IC Care Number

None

2.0.0

entryTime

String

Entry Time

None

2.0.0

idNumber

String

ID Number

None

2.0.0

mail

String

Mail

None

2.0.0

areaCode

String

Area Code

None

2.0.0

phoneSuffix

String

Mobile Number Suffix

None

2.0.0

mobile

String

Mobile Number

None

2.0.0

groups

List<GroupsItem>

Group Info

None

2.0.0

remark

String

Remark

None

2.0.0

avatar

String

Avatar ID

None

2.0.0

avatarShow

String

Art Photo ID

None

2.0.0

countryCode

String

Country Code

None

2.0.0

name

String

User Name

None

2.0.0

location

String

Location

None

2.0.0

departmentRoute

List<DeptItem>

Department

None

2.0.0

id

long

User ID

None

2.0.0

position

String

Position

None

2.0.0

jobNumber

String

job Number

None

2.0.0

placeCode

String

Place Code

None

2.0.0

department

int

Department ID

None

2.0.0

prompt

String

Personalized Prompt

None

2.0.0

DeptItem

Description of Properties

Member

Type

Description

Note

Version Introduced

name

String

Department Name

None

2.0.0

id

int

Department ID

None

2.0.0

type

int

Department Type

None

2.0.0

ServerVersion

Description of Properties

Member

Type

Description

Note

Version Introduced

date

String

Date

for example 20190815

2.0.0

edition

String

Edition

for example 1.11.0.2

2.0.0

provider

String

Provider

ST-BI, ST-JCV

2.0.0

product

String

Product Name

SenseLink, SenseLink GE

2.0.0

coreEdition

String

core Edition

None

2.0.0

appEdition

String

Show app Edition

None

2.0.0

TimeTable

Description of Properties

Member

Type

Description

Note

Version Introduced

id

long

Access Strategy ID

None

2.0.0

ruleId

long

Rule ID

None

2.0.0

name

String

Pass Time Table Name

None

2.0.0

groupId

int

Pass Group ID

None

2.0.0

monday

String

Monday 24h Access Strategy

None

2.0.0

mondayPeriod

String

Monday Pass Time Period

None

2.0.0

tuesday

String

Tuesday 24h Access Strategy

None

2.0.0

tuesdayPeriod

String

Tuesday Pass Time Period

None

2.0.0

wednesday

String

Wednesday 24h Access Strategy

None

2.0.0

wednesdayPeriod

String

Wednesday Pass Time Period

None

2.0.0

thursday

String

Thursday 24h Access Strategy

None

2.0.0

thursdayPeriod

String

Thursday Pass Time Period

None

2.0.0

friday

String

Friday 24h Access Strategy

None

2.0.0

fridayPeriod

String

Friday Pass Time Period

None

2.0.0

saturday

String

Saturday 24h Access Strategy

None

2.0.0

saturdayPeriod

String

Saturday Pass Time Period

None

2.0.0

sunday

String

Sunday 24h Access Strategy

None

2.0.0

sundayPeriod

String

Sunday Pass Time Period

None

2.0.0

holiday

String

Holiday 24h Access Strategy

None

2.0.0

holidayPeriod

String

Holiday Pass Time Period

None

2.0.0

startTimestamp

long

Start Timestamp

millisecond precision

2.0.0

endTimestamp

long

End Timestamp

millisecond precision

2.0.0

specialDayList

List<SpecialDay>

Special Date

None

2.0.0

SpecialDay

Description of Properties

Member

Type

Description

Note

Version Introduced

id

long

Special Date Id

None

2.0.0

date

String

Date

None

2.0.0

remark

String

Note

None

2.0.0

QRResult

Description of Properties

Member

Type

Description

Note

Version Introduced

entryTimeLeft

int

Number of Passes Remaining

None

2.0.0

entryHint

String

Entry Hint

None

2.0.0

idNumber

String

ID Number

None

2.0.0

userId

int

User ID

None

2.0.0

userImage

Content

User Library Image

None

2.0.0

userCardId

String

User Door Access Card ID

None

2.0.0

userName

String

User Name

None

2.0.0

entryStatus

int

Status code

1-Pass; 2-QR code illegal; 3-QR code decryption failed; 4-QR code content error; 5-QR code invalid; 6-QR code is not within the validity period; 7-QR code has no passes; 8-The user corresponding to the QR code is invalid

2.0.0

sign

String

md5

The md5 Value of {entryStatus}-{timestamp}-{ldid}-{userId}-{passRuleType}

2.0.0

type

int

User Type

1:Staff; 2:Guest;3:Stranger; 4:Non-liveness; 5-denyList

2.0.0

timestamp

long

Timestamp Uploaded by the Client

None

2.0.0

passRuleType

int

Pass Rule Type

None

2.0.0

IdentifyQRCodeParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

Is it necessary

content

String

QR Code Content

None

2.0.0

Y

timestamp

long

Timestamp

None

2.0.0

Y

LoginResult

Description of Properties

Member

Type

Description

Note

Version Introduced

defaultUserGroupId

int

default User Group ID

None

2.0.0

role

int

Role

None

2.0.0

companyId

int

Company ID

None

2.0.0

defaultGuestGroupId

int

default User Group ID

None

2.0.0

threshold

int

Face Detection Threshold

None

2.0.0

newDeviceKey

boolean

New Device

None

2.0.0

token

String

Token

None

2.0.0

deviceTypeMaxOnline

DeviceTypeMaxOnline

Maximum online device information

None

2.0.0

accountId

int

Account ID

None

2.0.0

name

String

Name

None

2.0.0

userRspVO

UserRspVO

User Info

None

2.0.0

company

Company

Company Info

None

2.0.0

lang

String

Language

None

2.0.0

device

Device

Device Info

None

2.0.0

account

String

Account Name

None

2.0.0

UserRspVO

Description of Properties

Member

Type

Description

Note

Version Introduced

birthday

String

Birthday

None

2.0.0

icNumber

String

IC Number

None

2.0.0

entryTime

String

entry Time

None

2.0.0

idNumber

String

ID Number

None

2.0.0

mail

String

Mail

None

2.0.0

areaCode

String

Place Code

None

2.0.0

phoneSuffix

String

Mobile Number Suffix

None

2.0.0

mobile

String

Mobile Number

None

2.0.0

groups

List<GroupsItem>

User Group ID

None

2.0.0

remark

String

Note

None

2.0.0

avatar

String

Avatar ID

None

2.0.0

avatarShow

String

Art Photo ID

None

2.0.0

countryCode

String

Country Code

None

2.0.0

name

String

Name

None

2.0.0

departmentRoute

List<DepartmentRouteItem>

Department

None

2.0.0

location

String

Location

None

2.0.0

id

Integer

User ID

None

2.0.0

jobNumber

String

Job Number

None

2.0.0

placeCode

String

Area Code

None

2.0.0

position

String

Position

None

2.0.0

department

Integer

Department ID

None

2.0.0

DepartmentRouteItem

Description of Properties

Member

Type

Description

Note

Version Introduced

name

String

Department Name

None

2.0.0

id

int

Department ID

None

2.0.0

type

int

Department Type

None

2.0.0

Device

Description of Properties

Member

Type

Description

Note

Version Introduced

ldid

String

Device UDID

None

2.0.0

companyId

int

Device Compay ID

None

2.0.0

typeId

int

Device Type

None

2.0.0

name

String

Device Name

None

2.0.0

updateAt

String

Update Time

None

2.0.0

description

String

Description

None

2.0.0

location

String

Device Location

None

2.0.0

id

int

Device ID

None

2.0.0

softwareVersion

String

Device Software Version

None

2.0.0

createAt

String

Create Time

None

2.0.0

direction

int

Device In and Out Direction

None

2.0.0

info

String

Info

None

2.0.0

MisrecognitionRecordParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

recordId

String

identification record id

None

2.0.0

type

int

Misrecognition Type

1 Other person, 2 Stranger, 3 Non-liveness, 4 Stranger Break, 5 Non-liveness Break

2.0.0

content

String

Remark

None

2.0.0

RegisterResult

Description of Properties

Member

Type

Description

Note

Version Introduced

ldid

String

Device LDID

None

2.0.0

companyId

int

Device Compay ID

None

2.0.0

typeId

int

Device TypeID

None

2.0.0

name

String

Device Name

None

2.0.0

updateAt

String

Update Time

None

2.0.0

description

String

Device Description

None

2.0.0

location

String

Device Location

None

2.0.0

id

int

Device ID

None

2.0.0

softwareVersion

String

Device Software Version

None

2.0.0

createAt

String

Create Time

None

2.0.0

direction

int

Device In and Out Direction

None

2.0.0

info

String

Device Info

None

2.0.0

RegisterParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

Is it necessary

name

String

Device Name

None

2.0.0

Y

direction

int

Device Direction

0-Default, 1-In, 2-Out

2.0.0

Y

location

String

Device Location Description

None

2.0.0

N

description

String

Device Description

None

2.0.0

N

softwareVersion

String

Software Version

None

2.0.0

N

info

String

Other Info

None

2.0.0

N

UserStatusParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

exceptionList

List<ExceptionListItem>

Exception List

None

2.0.0

verifyModelVersion

String

Verify Model Version

None

2.0.0

totalUserCount

int

Total User Count

None

2.0.0

ExceptionListItem

Description of Properties

Member

Type

Description

Note

Version Introduced

code

int

Status Code

None

2.0.0

userId

int

User ID

None

2.0.0

UserSyncStatusParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

Is it necessary

statusList

List<UserStatusListItem>

User Status List

None

2.0.0

Y

verifyModelVersion

String

Verify Model Version

None

2.0.0

Y

totalUserCount

int

Total User Count

None

2.0.0

Y

action

int

Type

0-Upload the Status of All Device Users, 1-Upload the Status of Abnormal Device Users

2.0.0

Y

UserStatusListItem

Description of Properties

Member

Type

Description

Note

Version Introduced

status

int

Status Code

1-Synchronizing, 2-Features Normal, 3-Image download failed, 4-Image parsing failed, 5-Feature extraction failed

2.0.0

userIds

int[]

User ID Arrays

None

2.0.0

DeviceReportEventParamer

Description of Properties

Member

Type

Description

Note

Version Introduced

Is it necessary

type

int

Event Type

1-Door Magnetism Event; 2-Bluetooth power; 3-Thermal Imager Status

2.0.0

Y

content

BaseDeviceReportEventContent

content corresponding to the event

1: DoorMagnetismReportEventContent, 2: BluetoothReportEventContent, 3: ThermalImagerReportEventContent

2.0.0

Y

DoorMagnetismReportEventContent

Description of Properties

Member

Type

Description

Note

Version Introduced

Is it necessary

status

int

Event Status

1-ON, 2-OFF, 3-No

2.0.0

Y

timestamp

long

Event Time

millisecond precision

2.0.0

Y

BluetoothReportEventContent

Description of Properties

Member

Type

Description

Note

Version Introduced

Is it necessary

power

int

Power Remained

0-100

2.0.0

Y

ThermalImagerReportEventContent

Description of Properties

Member

Type

Description

Note

Version Introduced

Is it necessary

status

int

Event Status

0-Unknown, 1-Connected, 2-Unconnected

2.0.0

Y

RecordResult

Description of Properties

Member

Type

Description

Note

Version Introduced

recordId

String

RecordID

None

2.0.0

RecordParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

Is it necessary

userId

int

User ID

None

2.0.0

N

username

String

User Name

None

2.0.0

N

signAvatar

String

Facial Image

None

2.0.0

N

signBgAvatar

String

Background Image

None

2.0.0

N

signTime

long

Clock Time

None

2.0.0

Y

type

int

Personnel Type

1:Staff; 2:Guest; 3: Stranger; 4: Non Liveness; 999: Others

2.0.0

Y

abnormalType

int

Abnormal Record Type

0-No; 10001-Person and ID mismatch;10002-Person and Card mismatch;10003-Person and Code mismatch;20001-The guest is not within the validity period; 20002-Not within the passable time range; 30001-Invalid id card; 30002-Invalid IC Card; 30003-Invalid QR Code

2.0.0

N

idNumber

String

ID Number

None

2.0.0

N

icNumber

String

work card

None

2.0.0

N

idInfo

String

other information of ID card

Json String

2.0.0

N

inTime

int

Whether uploaded timely

Yes: 1; No: 0

2.0.0

Y

mode

int

Device Mode

1: Swipe Face or Card; 2: Swipe Face+Card; 3: Swipe Face or ID Card; 4: Swipe Face+ID Card; 5: Swipe Face+ID Card for Appointment; 6: Swipe Face or QR Code; 7: Swipe Face and QR Code; 8: Bluetooth; 9: Face; 10: Face or QR Code or Swipe Card

2.0.0

Y

rectangle

List<VerticesItem>

rectangle

Coordinates of the upper left corner, coordinates of the lower right corner

2.0.0

N

entryMode

int

Entry Mode

1: Swipe Face; 2: QR Code; 3: Swipe Card; 4: Swipe Face+Card; 5: Swipe ID Card; 6: Swipe Face+ID Card; 7: Swipe Face+ID Card for Appointment; 8: Swipe Face and QR Code; 9: Bluetooth

2.0.0

N

pushOption

int

Push Record

1, Yes, 0 No

2.0.0

N

wearMaskType

int

Mask Status

0: No Status (Mask Identification not activated) 1: Without Mask 2: With Mask

2.0.0

N

verifyScore

float

Verify Score

None

2.0.0

N

docPhoto

String

ID card photo

None

2.0.0

N

heatAvatar

String

thermodynamic diagram

None

2.0.0

N

bodyTemperature

float

Body Temperatur

None

2.0.0

N

remark

String

Note

None

2.0.0

N

DeviceVersionInfoParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

Is it necessary

apkVersionName

String

apk Version Name

None

2.0.0

Y

romHardwareVersion

String

ROM Hardware Version

None

2.0.0

Y

apkVersionCode

String

apk Version Code

None

2.0.0

Y

packageName

String

package Name

None

2.0.0

Y

model

String

Model

None

2.0.0

Y

serialNumber

String

Device serial Number

None

2.0.0

Y

romSoftwareVersion

String

ROM Software Version

None

2.0.0

Y

manufacturer

String

manufacturer

None

2.0.0

Y

IdentifyDataParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

images

List<ImagesItem>

Data

None

2.0.0

depth

Depth

Depth Data

None

2.0.0

userId

int

User ID

None

2.0.0

recordId

int

Recordid

None

2.0.0

type

int

Data Type

1-In the Library, 2-Stranger, 3-Liveness, 4-Non-liveness

2.0.0

Depth

Description of Properties

Member

Type

Description

Note

Version Introduced

data

String

Depth Data Content

None

2.0.0

width

int

Depth Data Width

None

2.0.0

height

int

Depth Data Height

None

2.0.0

TslUploadParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

Is it necessary

content

String

Tsl json String

None

2.0.0

Y

TslLanguageUploadParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

Is it necessary

content

String

Language Package Content

None

2.0.0

Y

lang

String

Language

en,zh,zh-tw

2.0.0

Y

MessageParameter

Description of Properties

Member

Type

Description

Note

Version Introduced

mobile

String

Mobile Number

None

2.0.0

areaCode

String

Area Code

None

2.0.0

event

MessageEventEnum

Event

None

2.0.0

captcha

String

authentication code

None

2.0.0

MessageEventEnum

Description of Properties

Member

Description

Note

Version Introduced

LOGIN

Login

None

2.0.0

CHANGE_INFO

Change Info

None

2.0.0

VALIDATE

Validate

None

2.0.0

IConnectionLost

Description of Method

Member Function

Description

Note

Version Introduced

void onConnectionLost(Throwable cause)

Callback on Connection Lost

None

2.0.0

MessageCallback

Description of Method

Member Function

Description

Note

Version Introduced

void success(MqttMessage msg)

Callback on Receiving Message

None

2.0.0

void error(int code, String msg, Throwable throwable)

Callback on Failure

None

2.0.0