• Revision Log

          Version (Software Ver.-Reference Ver.)ChangelogDate
          2.6.1Modified: 3.2 Create personnel rule (added two rule methods) Section 6 Serial Ports API Overview Added: 3.4 Fingerprint interface API overview 7.3 RS485 serial port API example 7.4 Fill lamp API example 7.5 Card reader API example 7.6 Fingerprint API development overview 7.7 Proximity sensor (p-sensor) API example2019-10-30
          2.6.2Remastered the system architecture in Overview2021-06-23

          Device Software Version Updates/Compatibility Notes

          Version 2.6 of this document is released together with device software version 2.6.0.13. This also marks the initial release.

          1. Overview

          FaceSec Facial Recognition Terminals development platforms are Android-based, and with provided SDKs, third-party developers can easil develop new functionality for these devices. The development platform provides support for a number of features, including facial recognition process flows, personnel management, rule management, identification record management, setting management, etc.

          The image below represents the device’s system architecture, on which subsequent platform systems are designed.

          image-20230614135412327

          Fig 1.1 FaceSec Facial Recognition Terminals Development Platform System Architecture

           

          2. SDK Integration Guide

          2.1 Development Environment & Compilation Overview

          Development environment and compilation: Use Android Studio (version 3.0 or above recommended). For project compilation: JDK7 or above, Android SDK 24 or above are required.

          2.2 SDK File Import Overview

          1. Before using the SDK, it is necessary to add the SDK and the dependent libraries to the corresponding directories in the development application. Using the following sample code as an illustration, these library files should be imported with the corresponding directories.

          2. Before deploying the SDK, the following libraries should be added to the the application’s dependencies:

          LibraryDescriptionExample path
          app-common.aarPersonnel/rule related interfaces encapsulation and facial capture view componentsdkexample/app/libs
          com.beeboxes.sdk.jarSDK packagesdkexample/app/ compileonlylibs
          faceviewlibrary.aarDependency packages, user-importablesdkexample/app/libs
          opnext-domain.jarEntity class definitions, user-importablesdkexample/app/libs
          support-lib.aarDevice and Cloud Platform exchange interface definitionssdkexample/app/libs
          1. the following SDK example, the following classes are usable in third-party development:

          TypeDescription
          MainActivityMain interface class
          AddPersonActivityAdd Personnel class
          GetPersonActivityGet/Delete Personnel Class
          TestRuleActivityAdd/Delete Personnel Rule Class
          ODSLActivityODSL Setting Class

           

          3. Personnel Management & Rule Management API Overview

          These endpoints facilitate CRUD operations on personnel, performing operations on personnel through ID/UUID; Retrieving rules, updating personnel rules; CRUD operation on recognition parameters, etc.

          Personnel Management API Table

          Common Personnel Management API 
          Add Personnelpublic static int addPerson(Context context, AppPersonInfo person, String photoPath)
          Update Personnelpublic static int updatePerson(Context context, AppPersonInfo person, String photoPath)
          Retrieve Personnel via UUID, with featurepublic static AppPersonInfo getPersonByUuid(Context context, String uuid)
          Retrieve Personnel via UUID, without feature datapublic static AppPersonInfo getPersonByUuidWithoutFeature(Context context, String uuid)
          Delete personnel via UUIDpublic static boolean deletePersonByUuid(Context context, String uuid)
          Delete all Personnelpublic static boolean deleteAllPerson(Context context)
          Search Personnel via UUID, regex and namepublic static List searchPerson(Context context, String uuid, String name, int offset)
          Retrieve Personnel listpublic static List getPersonList(Context context, int offset)
          Extract facial features from imagepublic static ImageExtractResult imageExtract(Context context, String photoPath)
          Authorized Personnel API 
          Add Authorized Personnelpublic static int addDoubleCheckPerson(Context context, AppPersonInfo person)
          Update Authorized Personnelpublic static int updateDoubleCheckPerson(Context context, AppPersonInfo person)
          Retrieve Authorized Personnel via UUIDpublic static AppPersonInfo getDoubleCheckPersonByUuid(Context context, String uuid)
          Delete Authorized Personnel via UUIDpublic static boolean deleteDoubleCheckPersonByUuid(Context context, String uuid)
          Delete all Authorized Personnelpublic static boolean deleteAllDoubleCheckPerson(Context context)
          Search Authorized List via ID no.public static List searchDoubleCheckPersonByIdCard(Context context, String idCard)
          Administrator Management API 
          Add Administratorpublic boolean addAdministrator(Administrator administrator)
          Delete Administratorpublic boolean deleteAdminByUuid(String uuid)
          Update Administratorpublic boolean updateAdmin(Administrator admin)
          Retrieve Administrator via UUIDpublic Administrator getAdminByUuid(String uuid)
          Retrieve all Administratorspublic List getAdministratorList()
          Retrieve Administrator countpublic long getAdminCount()
          Delete all Administratorspublic void deleteAllAdmin()

          3.1 Common Personnel Management API

          The main entities covered under personnel management include:

          The following introduces the relevant APIs for the various personnel types.

          3.1.1 Common Personnel Management API

          All interfaces of this module exist as static methods, which can be called directly using the class name. The calling method is: AppPersonManager.xxx (xxx is the specific interface).

          The following is a description of the Adding Personnel interface. For the use of other methods, please refer to Adding Personnel and sample code.

          Add Personnel

          Interfacepublic static int addPerson(Context context, AppPersonInfo person, String photoPath)
          ParametersContext context: Context AppPersonInfo person: Personnel’s details String photoPath: Personnel image path
          Return ValueRefer to 3.4.1 Error Code Definitions
          DescriptionTo call the Add Personnel interface, you need to first instantiate an AppPersonInfo object, and fill the object with the relevant data (Image, name, ID, personnel rule ID and personnel type are required. Please refer to section 3.2 for Personnel Rules). Define an image retrieval path. Missing photos will result in errors when adding personnel. Note: Personnel without rule assignments will not have access permissions. To avoid creating data discrepancies, if the personnel rules are deleted through the API, the personnel corresponding to the rules will also be deleted.

          Sample code:

          Update Personnel

          Interfacepublic static int updatePerson(Context context, AppPersonInfo person, String photoPath)
          ParametersContext context:Context
          AppPersonInfo person: Personnel details
          String photoPath: Personnel image path
          Return ValueRefer to 3.4.1 Error Code Definitions
          DescriptionphotoPath If blank, the image is considered a replacement and will have its feature values re-extracted.

          Retrieve Personnel with feature

          Interfacepublic static AppPersonInfo getPersonByUuid(Context context, String uuid)
          ParametersContext context: Context
          String uuid: Personnel no.
          Return ValueReturn personnel details with feature values
          DescriptionThe feature value data is 2KB. If you are editing personnel details, you may call this interface. If only used for display, you can call the getPersonByUuidWithoutFeature interface.

          Retrieve Personnel without feature

          Interfacepublic static AppPersonInfo getPersonByUuidWithoutFeature(Context context, String uuid)
          ParametersContext context: Context
          String uuid: Personnel no.
          Return ValueReturn personnel details without feature values
          DescriptionIf a large volume of personnel details needs to be extracted and efficiency is a consideration, this interface can be used.

          Delete Personnel

          Interfacepublic static boolean deletePersonByUuid(Context context, String uuid)
          ParametersContext context: Context
          String uuid: Personnel no.
          Return ValueReturns deletion result. If true, deletion was executed successfully. If false, deletion failed.
          DescriptionDelete Personnel via UUID

          Delete All Personnel

          Interfacepublic static boolean deleteAllPerson(Context context)
          ParametersContext context: Context
          Return ValueReturns deletion result of all personnel. If true, deletion was executed successfully. If false, deletion failed.
          DescriptionDelete all personnel details and images

          Personnel Search Result

          Interfacepublic static List searchPerson(Context context, String uuid, String name, int offset)
          ParametersContext context: Context
          String uuid: Personnel no., required
          String name: Personnel name, required
          int offset: Pagination, with each page returning 50 items. Offset starts from 0 and is called cyclically.
          Return ValueReturns a list of personnel information. If it returns null, or Return Valuelist.size == 0, it means that there are no more results.
          DescriptionTwo query methods: UUID, which uses a whole word match, name, which uses a regex search. Using both query methods will produce results with an OR relationship.

          Retrieve Personnel List

          Interfacepublic static List getPersonList(Context context, int offset)
          ParametersContext context: Context
          int offset: Pagination, with each page returning 50 items. Offset starts from 0 and is called cyclically.
          Return ValueReturns a list of all personnel information. If it returns null, or Return Valuelist.size == 0, it means that there are no more results.
          DescriptionRetrieves a list of all Personnel details

          Extract Facial Features from Image

          Interfacepublic static ImageExtractResult imageExtract(Context context, String photoPath)
          ParametersContext context: Context String photoPath: Personnel image path
          Return ValueIncludes the extracted features and the final image after extraction
          DescriptionNone

          3.1.2 Authorized Personnel Management API

          The authorization personnel management API is similar to the common personnel management interfaces. Refer to the common personnel management API.

          The authorized personnel management interface is used during 1:1 comparison. After the comparison is successful, the ID number will need to be rechecked if it has been registered in the device comparison scenario.

          Add Authorized Personnel

          Interfacepublic static int addDoubleCheckPerson(Context context, AppPersonInfo person)
          ParametersContext context: Context
          AppPersonInfo person: Personnel details
          Return ValueRefer to 3.4.1 Error Code Definitions
          DescriptionNone

          Update Authorized Personnel

          Interfacepublic static int updateDoubleCheckPerson(Context context, AppPersonInfo person)
          ParametersContext context: Context
          AppPersonInfo person: Personnel details
          Return ValueRefer to 3.4.1 Error Code Definitions
          DescriptionNone

          Retrieve Authorized Personnel

          Interfacepublic static AppPersonInfo getDoubleCheckPersonByUuid(Context context, String uuid)
          ParametersContext context: Context
          String uuid: Personnel no.
          Return ValueRetrieve authorized personnel details
          DescriptionRetrieve authorized personnel via UUID

          Delete Authorizations

          Interfacepublic static boolean deleteDoubleCheckPersonByUuid(Context context, String uuid)
          ParametersContext context: Context
          String uuid: Personnel no.
          Return ValueReturns deletion result. If true, deletion was executed successfully. If false, deletion failed.
          DescriptionDelete authorized personnel via UUID

          Delete All Authorized Personnel

          Interfacepublic static boolean deleteAllDoubleCheckPerson(Context context)
          ParametersContext context: Context
          Return ValueReturns deletion result. If true, deletion was executed successfully. If false, deletion failed.
          DescriptionNone

          Search Authorized Personnel via ID no.

          Interfacepublic static List searchDoubleCheckPersonByIdCard(Context context, String idCard)
          ParametersContext context: Context
          idCard: ID no.
          Return ValueReturn a list of authorized personnel
          DescriptionIf multiple personnel are bound to the same ID, multiple personnel will be returned in the list. Under most scenarios, only one personnel’s detail will be returned.

          3.1.3 Administrator Management API

          When using the administrator management API, the PersonManager object needs to be instantiated first before methods can be called.

          The instantiation is as follows:

          The initialization of the PersonManager instance object requires the getFaceManager method of FaceRecognizerManager.PERSON_SERVICE as the parameter of FaceRecognizerManager.

          The instantiation sample code is as follows, for specific use, please refer to the ExampleApplication class in the sample code:

          The following is a description of the Adding Administrator interface. For the use of other methods, please refer to Adding Administrator and sample code.

           

          Add Administrator

          Interfacepublic boolean addAdministrator(Administrator administrator)
          Parametersadministrator: Administrator details
          Return ValueTrue signifies successful addition, false signifies addition failed.
          DescriptionTo call this interface, you need to instantiate an Administrator object.

          The sample code is as follows, mPersonService being an instance of PersonManager:

          Delete Administrator

          Interfacepublic boolean deleteAdminByUuid(String uuid)
          Parametersuuid: Personnel ID
          Return ValueTrue signifies successful deletion. False signifies deletion failed.
          DescriptionDelete the administrator via UUID

          Edit Administrator

          Interfacepublic boolean updateAdmin(Administrator admin)
          Parametersadmin: Administrator details
          Return ValueTrue signifies successful edit. False signifies editing failed.
          DescriptionUpdate administrator details via UUID

          Retrieve Administrator

          Interfacepublic Administrator getAdminByUuid(String uuid)
          Parametersuuid: Personnel ID
          Return ValueReturns administrator details
          DescriptionRetrieves administrator details via UUID

          Retrieve All Administrators

          Interfacepublic List getAdministratorList()
          ParametersNone
          Return ValueReturns a list of all administrators
          DescriptionNone

          Get Administrator Count

          Interfacepublic long getAdminCount()
          ParametersNone
          Return ValueReturns the number of administrators
          DescriptionNone

          Delete All Administrators

          Interfacepublic void deleteAllAdmin()
          ParametersNone
          Return ValueNone
          DescriptionNone

           

          3.2 Personnel Rule Management API

          All interfaces of this module exist as static methods, which can be called directly by the class name. The calling method is: AppPersonRuleManager.xxx (xxx is the specific interface).

          Personnel Rule Management API Overview

          Personnel Rule Management API 
          Retrieve all Personnel Rulespublic static List getRules(Context context)
          Retrieve Personnel Rules Matching Search Criteriapublic static List getRules(Context context, String selection, String[] selectionArgs, pageSize, int offset)
          Check if Personnel Rule Existspublic static boolean isRuleExists(Context context, String ruleId)
          Edit Personnel Rulepublic static void updateRule(Context context, AppPersonRule appPersonRule)
          Create Personnel Rule Time Periodpublic static TimeRule buildTimeRule(String title, TimeRule.Type dayType, Range<Range.Day> dayRange,TimeRule.DayType weeKType, Set weekDays, Range<Range.Time> timeRange, Action action)
          Create Personnel Rulepublic static boolean addRule(Context context , String name, String description, String prompt,List<Rule.AccessType> typeList, List timeRuleList, boolean isShowed)
          Create or Edit Personnel Rulepublic static AppPersonRule addOrUpdate (Context context, final AppPersonRule rule)

          The following only gives sample codes for the interface of creating personnel rules. For the use of other interfaces, please refer to Creating Personnel Rules interface and sample code.

          Retrieve all Personnel Rules

          Interfacepublic static List getRules(Context context)
          ParametersContext context: Context
          Return ValueReturns List containing all personnel rules, AppPersonRule is the data structure of personnel rules.
          DescriptionNone

          Retrieve Personnel Rules Matching Search Criteria

          Interfacepublic static List getRules(Context context, String selection, String[] selectionArgs, int pageSize, int offset)
          ParametersContext context: Context
          String selection: ContentProvider selection parameter
          String[] selectionArgs: ContentProvider selectionArgs parameter
          int pageSize: Pagination parameters, with the number displayed on each page. 0 signifies no pagination.
          int offset: Offset parameter, indicating which page
          Return ValueReturns a List personnel rules, AppPersonRule is the data structure of personnel rules.
          DescriptionThe selection and selectionArgs (same as ContentProvider parameters) in the parameters are the search conditions. The user can construct the search query according to the database field matching rules. The following is the database field description: RULE_ID: String type, the personnel rule ID is stored in AppPersonRule.ruleId. VALID_TILL: Long type, signifying rule validity period. If the value is null, it means that the rule has no expiry date. If the rule is designated as periodic (such as weekly repetition), the time stamp will be calculated according to the specific rule time period. Stored in AppPersonRule.validTill. OBJ: Rule details, stored in AppPersonRule.obj.

          Check if Personnel Rule Exists

          Interfacepublic static boolean isRuleExists(Context context, String ruleId)
          ParametersContext contex: Context String ruleId: Rule ID
          Return ValueTrue signifies the rule exists, false indicates rule is not found.
          DescriptionNone

          Update Personnel Rule

          Interfacepublic static void updateRule(Context context, AppPersonRule appPersonRule)
          ParametersContext contex: Context AppPersonRule appPersonRule: Personnel rule details to be updated
          Return ValueNone
          DescriptionNone

          Create Personnel Rule Time Period

          Interfacepublic static TimeRule buildTimeRule(String title, TimeRule.Type dayType, Range<Range.Day> dayRange,TimeRule.DayType weeKType, Set weekDays, Range<Range.Time> timeRange, Action action)
          ParametersString title: Rule name
          TimeRule.Type dayType: Validity date type
          CYCLE Permanent
          TIMING Periodic If this parameter is set as TIMING, setting of the Range<Range.Day> dayRange parameter indicates the validity date range
          Range<Range.Day> dayRange: When the type is TIMING, this parameter is used to indicate the date range of the validity period
          TimeRule.DayType weeKType: Signifies the validity days
          EVERYDAY Full week
          WEEKDAY Monday to Friday
          CUSTOM User-defined validity period. The Set customDays parameter must be set to indicate the applicable days
          Set weekDays: When weeKType is CUSTOM, the user must define the valid days
          Sunday 1
          Monday 2
          Tuesday 3
          Wednesday 4
          Thursday 5
          Friday 6
          Saturday 7
          Range<Range.Time> timeRange: Validity Period
          Action action: Rule action
          ALLOW Allow access
          DENY Deny access
          Note: For time rules, users need to ensure that they are valid. For example, the end time of a periodic rule needs to be later than the start time. If a rule is invalid, the rule will never take effect. Users need to manually handle any invalid time rules.
          Return ValueTime rule object
          DescriptionThe personnel rule time rule consists of the following elements: Rule name Rule validity date: It can be permanent or a user-defined date range Rule effective week: Indicates within the validity date range, which day of the week will the rule take effect Rule effective time: Indicates the time period of the day, within the effective week of the rule, will the rule take effect Way of Access: Indicates whether the rule allows or prohibits access within the effective time range

          Create Personnel Rule

          Interfacepublic static boolean addRule(Context context , String name, String description, String prompt,List<Rule.AccessType> typeList, List timeRuleList, boolean isShowed)
          ParametersString name: Rule name
          String description: Rule description
          String prompt: Prompt details (currently not in use)
          List<Rule.AccessType> typeList: Access method. Can be selected individually, or FACE can be combined with other options.
          FACE Face
          FACE_AND_ID Face + ID
          FACE_AND_PASSPORT Face + Password
          FACE_AND_GUARD Face + Door Card
          FACE_AND_IC Face + IC Card
          FACE_AND_PASSWORD Face + Password
          IC IC Card
          FINGERPRINT Fingerprint
          List timeRuleLis: Personnel Rule time period
          Users will need to ensure that the incoming timeRuleList is valid, otherwise anomalies may occur during rule assessment and cause erroneous results in allowing/denying personnel access
          boolean isShowed: Whether to display in the list of personnel rules in Settings
          Return ValueTrue signifies personnel rule update succeeded. Failed signifies update failed.
          DescriptionFor expired personnel rules, devices in cloud service mode will automatically clean up the rules and personnel corresponding to the rules. Single-host mode does not support automatic cleanup, and users will need to clear expired rules and personnel associations manually.

          Sample code:

           

          Create or Edit Personnel Rule

          Interfacepublic static AppPersonRule addOrUpdate (Context context, final AppPersonRule rule)
          ParametersContext contex: Context
          final AppPersonRule rule:Create or edit personnel rule entity
          Return ValueAppPersonRule If saving fails, the return value is null. If the save succeeds, the successfully saved AppPersonRule is returned. The returned AppPersonRule may differ from the provided parameter AppPersonRule. For example, AppPersonRule. validTill may be recalculated.
          DescriptionSimilar to the use of updateRule, the return value AppPersonRule is added to be used in certain specific usage scenarios to get the rule ID immediately after inserting the personnel rule to facilitate subsequent operations. Note: If AppPersonRule.ruleId is empty, it will signify the creation of a new personnel rule. If it is not empty, it signifies an existing rule being updated.

          3.3 Recognition Parameters API

          All interfaces of this module exist as static methods, which can be called directly using the class name. The calling method is: AppGroupManager.xxx (xxx is the specific interface).

          Recognition Parameters API Overview

          Recognition Parameters API 
          Add Recognition Parameter Library via Namepublic static int addGroup(String name)
          Delete Recognition Parameter Library via Namepublic static void delGroup(String name)
          Retrieve Recognition Parameter Library ID by Namepublic static String getGroupIdByName(String name)
          Check if Recognition Parameter Library Exists by IDpublic static boolean isGroupExistsById(String groupId)
          Check if Recognition Parameter Library Exists by Namepublic static boolean isGroupExistsByName(String groupName)
          Get Recognition Parameter Library Countpublic static int getGroupCount()

          Add Recognition Parameter Library via Name

          Interfacepublic static int addGroup(String name)
          ParametersString name: New parameter library name
          Return ValueRefer to 3.4.2 Error Code Definitions.
          DescriptionCreate a recognition threshold library by name. Other recognition parameters are the same as the default recognition parameter library.

          Delete Recognition Parameter Library via Name

          Interfacepublic static void delGroup(String name)
          ParametersString name: Parameter library name
          Return ValueNone
          DescriptionNone

          Retrieve Recognition Parameter Library ID by Name

          Interfacepublic static String getGroupIdByName(String name)
          ParametersString name: Parameter library name
          Return ValueRecognition parameter library ID
          DescriptionNone

          Check if Recognition Parameter Library Exists by ID

          Interfacepublic static boolean isGroupExistsById(String groupId)
          ParametersString groupId: Recognition parameter library ID
          Return Valuetrue: The library exists. false: The library was not found
          DescriptionNone

          Check if Recognition Parameter Library Exists by Name

          Interfacepublic static boolean isGroupExistsByName(String groupName)
          ParametersString groupName: Recognition parameter library name
          Return Valuetrue: The library exists. false: The library was not found
          DescriptionNone

          Get Recognition Parameter Library Count

          Interfacepublic static int getGroupCount()
          ParametersNone
          Return ValueReturn recognition parameter library count
          DescriptionNone

          3.4 Fingerprint Interface API

          SDK version 2.6 supports 1:N fingerprints comparison. Currently, fingerprint information for a maximum of 5000 people can be stored, with a maximum of 2 fingerprints per person.

          When calling the fingerprint interface, users should also call the personnel management interface. When adding personnel, the fingerprint adding interface should be called at the same time. When deleting personnel information, the fingerprint delete interface should be called at the same time to ensure the synchronization of personnel and fingerprint information.

          The newly-added SDK fingerprint-related interfaces are encapsulated in com.beeboxes.device.DeviceManager. Users can obtain DeviceManager instances through DeviceManager.getInstance(), and then call the fingerprint-related interfaces.

          Fingerprint Interface API Overview

          Fingerprint Interface API 
          Add Fingerprintpublic void addFinger(Finger finger)
          Update Fingerprintpublic void updateFinger(Finger finger)
          Delete Fingerprintpublic void deleteFingerByUuid(String uuid)
          Delete All Fingerprintspublic void deleteAllFinger()
          Retrieve Fingerprintpublic Finger getFingerByUuid(String uuid)
          Get Fingerprint Countpublic int getFingerCount()
          Register Data Listenerpublic void registerDataAvailableListener(Input type, IDataAvailableListener listener);
          Unregister Data Listenerpublic void DeviceManager.unregisterDataAvailableListener( IDataAvailableListener listener);

          Add Fingerprint

          Interfacepublic void addFinger(Finger finger)
          ParametersFinger finger: Fingerprint details, including personnel number, and up to five fingerprint details. However, only up to two fingerprints are currently supported.
          Return ValueNone
          DescriptionNone

          Update Fingerprint

          Interfacepublic void updateFinger(Finger finger)
          ParametersFinger finger: Fingerprint details, including personnel number, and up to five fingerprint details. However, only up to two fingerprints are currently supported.
          Return ValueNone
          DescriptionNone

          Delete Fingerprint

          Interfacepublic void deleteFingerByUuid(String uuid)
          ParametersString uuid: Personnel no. to delete the fingerprints from
          Return ValueNone
          DescriptionNone

          Delete All Fingerprints

          Interfacepublic void deleteAllFinger()
          ParametersNone
          Return ValueNone
          DescriptionNone

          Retrieve Fingerprint

          Interfacepublic Finger getFingerByUuid(String uuid)
          ParametersString uuid:The Personnel ID to retrieve fingerprints from.
          Return ValueReturns the fingerprint details, including personnel number, and up to five fingerprint details. However, only up to two fingerprints are currently supported.
          DescriptionNone

          Get Fingerprint Count

          Interfacepublic int getFingerCount()
          ParametersNone
          Return ValueReturns count of currently stored fingerprints
          DescriptionNone

          Register Data Listener

          Interfacepublic void registerDataAvailableListener(Input type, IDataAvailableListener listener);
          ParametersInput type: The monitoring device type, if it is fingerprint monitoring, the type should be Device.Input.FINGERPRINT IDataAvailableListener listener: monitor listener instance, when fingerprint information is reported, call the callback function in IDataAvailableListener
          Return ValueNone
          DescriptionUsers can use the data monitoring interface to enter fingerprints information and synchronize it with the fingerprint add/update interface, to implement a full fingerprint registration function.

          Unregister Data Listener

          Interfacepublic void DeviceManager.unregisterDataAvailableListener( IDataAvailableListener listener);
          ParametersIDataAvailableListener listener:Existing listener object
          Return ValueNone
          DescriptionNone

          Add fingerprint sample code: Users can use the data monitoring interface to enter fingerprints information and synchronize it with the fingerprint add/update interface, to implement a full fingerprint registration function.

           

          3.5 Error Code Definitions

          3.5.1 Add Personnel Error Response Details

          3.5.2 Add Recognition Parameter Library Error Response Details

          4.Settings Management API

          Settings management is about providing unified configuration information reading and configuration for the entire platform. Supports the import and export of setting management files in single-host mode, and the platform to send down and upload configuration information.

          Settings Management API is pictured below:

          image-20230614150447541

          Figure 3.1 Settings Management API

          Settings Management API Overview

          Settings Management API 
          Set Attributepublic void set(String key, String value)
          Get Attributepublic String get(String key)
          public String getString(String key, String def)
          public boolean getBoolean(String key, boolean def)
          public int getInt(String key, int def)
          public long getLong(String key, long def)
          Remove Attributepublic void remove(String key)
          Register Callback Endpointpublic void registerCallback(Callback callback)

          The operations for attribute configuration is as follows.

          4.1 Set Attribute

          Interfacepublic void set(String key, String value)
          ParametersString key: Keyword to set the corresponding attribute.
          String value: The value to set the attribute as.
          Return ValueNone
          DescriptionIf the attribute type is defined as Boolean, the value should be set to ‘true’ or ‘false’. Avoid using ‘1’ or ‘0’, Sample call: SettingsManager.getInstance().set(“testkey”, “value”);

          4.2 Get Attribute

          Interfacepublic String get(String key)
          ParametersString key: Keyword to get the corresponding attribute
          Return ValueReturns a variable of type String
          DescriptionGet the attribute value in type String. When the return value cannot be parsed, or an error occurs, it returns null.
          Sample callString test = SettingsManager.getInstance().get(“testkey”);

          Interfacepublic String getString(String key, String def)
          ParametersString key: Keyword to get the corresponding attribute
          long def: Default value
          Return ValueGet the attribute value in type String. When the return value cannot be parsed, or an error occurs, it returns null.
          DescriptionGet the attribute value in type String.
          Sample callString test = SettingsManager.getInstance().getString(“testkey”, “defaultValue”);

          Interfacepublic boolean getBoolean(String key, boolean def)
          ParametersString key: Keyword to get the corresponding attribute
          long def: Default value
          Return ValueGet the attribute value in type Boolean. When the return value cannot be parsed, or an error occurs, it returns null.
          DescriptionGet the attribute value in type Boolean.

          Interfacepublic int getInt(String key, int def)
          ParametersString key: Keyword to get the corresponding attribute
          long def: Default value
          Return ValueGet the attribute value in type int. When the return value cannot be parsed, or an error occurs, it returns null.
          DescriptionGet the attribute value in type int.

          Interfacepublic long getLong(String key, long def)
          ParametersString key: Keyword to get the corresponding attribute
          long def: Default value
          Return ValueGet the attribute value in type long. When the return value cannot be parsed, or an error occurs, it returns null.
          DescriptionGet the attribute value in type Long.

          4.3 Remove Attribute

          Interfacepublic void remove(String key)
          ParametersString key : Keyword to remove the corresponding attribute
          Return ValueNone
          DescriptionDelete the value with attribute with the corresponding key.

          4.4 Register Callback Endpoint

          Interfacepublic void registerCallback(Callback callback)
          ParametersCallback callback: Callback entity
          Return ValueNone
          DescriptionThe device needs to implement the Callback interface class and pass it to the SDK class through registerCallback to track attribute changes.

           

          5. Access Record API

          The access records fields are as below:

          Among them, Id is a self-incrementing database field, which can be sorted to get the latest identification record, recorduploadflag is the cloud service mode upload flag bit, the obj field is the JSON data that stores the identification record, and the corresponding entity class is located in the opnext-domain of FaceSec AccessRecord class in the package. You can use fastJson or Gson parsing methods to obtain identification record information. The recorded information includes information such as the person's name, gender, and comparison photos.

          An interface is provided for the querying and deletion of FaceSec’s access records through ContentProvider.

          The authority and Uri required for obtaining are defined as follows:

          5.1 Retrieve All Access Records

          InterfaceCursor cursor = getContentResolver().query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder);
          Parametersuri: The query identification record uri must be the predefined RECORD_CONTENT_URI
          Return Valuecursor type
          DescriptionA standard content provider query interface is implemented for access records. uri must be a predefined RECORD_CONTENT_URI, and the remaining four parmeters must be the same as the standard Android content provider quert interface.

          6. Interface Class API

          6.1 Serial Port API Interface

          The third-party developers can use the serial ports to connect their own peripherals, and call the serial API interface to implement the serial port applications.

          6.1.1 Serial Port Development Checklist

          Android devices will need to import the SDK package (com.beeboxes.sdk.jar) to the compileonlylibs directory.

          The serial port class is initialized as follows:

          6.1.2 Serial Port API List

          The serial port interface is as follows:

          6.2 Serial Port API Secondary Wrapper Interface

          The third-party developers can transmit user data to PC via serial API, such as Access Record, Log, etc. In order to make development on Android and PC compatible, the Demo of PC is applied the same API design as that on Android.

          6.2.1 Serial Port Development Checklist

          Write permissions to external media storage are required:

          6.2.2 Serial Port API Interface

          Serial Port

          System Log

          Enable system logging

          Two data transmission interfaces are provided

          Synchronous transmission:

          Asynchronous transmission:

          File transfer interface

          Note: This interface only provides asynchronous transmission interface

          Register data listener

           

          Register file receiver listener

           

          6.2.3 Instructions for using serial port API on Android

          Create serial port class

           

          Register data listener. When a client sends data, it will call back to the user through this interface

           

          Register file receiver listener. When a file is received,the user will be notified of its progress and completion through this interface

          Enable transfer mode. This command must be executed before a data transfer can be executed

           

          Stop transfer, when the port is no longer in use

          6.2.4 Instructions for using serial port API on PC

          Import the serial SDK library SerialTransport.jar on the PC to the libs directory

          Create a serial port management class: SerialManager is used to manage the serial port

          Register data listener. When a client sends data, it will call back to the user through this interface

           

          Register file receiver listener. When a file is received,the user will be notified of its progress and completion through this interface

           

          Enable transfer mode. This command must be executed before a data transfer can be executed

          Stop transfer, when the port is no longer in use

           

          7. Device Management API Overview

          7.1 Door Control API

          7.1.1 Dry Contact Door Control API

          Control a door through dry contact by setting the DoorCmdInfo class and setting the door parameter DoorCmd.

          Functions 
          public int setCmd (DoorCmd cmd)DoorCmdInfo class member functions
          cmdDoorCmd value OPEN- Open door. After the specified interval in SignalTime, the door will be closed automatically. CLOSE- Close door. ALWAYS_OPEN- Unlock door and deactivate auto-lock. A CLOSE command must be issued to lock the door.

          Functions 
          public int setSignalTime(int time)Wiegand class member functions
          timeOPEN- Door opening interval, units in us.
          Functions 
          public int sendCmd(Device.Output type, Object obj)DeviceManager class member functions
          typeDevice.Output defined device type
          objObject command to send

          Interface call sample:

          Description:setCmd can also call the door unlock command DoorCmdInfo.DoorCmd.ALWAYS_OPEN。

          7.1.2 Wiegand Door Control API

          There are a number of Wiegand protocols, which need to be updated for deployment. Set the parameters of the corresponding protocol, corresponding to the WgConfig class. For specific parameters, please refer to the following class description.

           

          The Type value is the different protocol types of Wiegand. For different type values, you need to set the corresponding mAllBits, mDataBits and other parameters.

          Functions 
          public void setType(Type type)Set Wiegand protocol type
          public void setAllBits(int allBits)Set the total number of data bits
          public void setDataBits(int dataBits)Set the number of valid data bits
          public void setOCheckBits(int OCheckBits)Set odd parity digits
          public void setECheckBits(int ECheckBits)Set even parity digits
          public void setPulseWidth(int pulseWidth)Set pulse width
          public void setPulseInterval(int pulseInterval)Set pulse interval

          Functions 
          public int sendCardId(WgConfig.Type type, String cardId)Wiegand class member functions
          typeWgConfig.Type Defined Wiegand type
          cardIdcardId Data to be sent

          Interface call example:

          Parameters: Wiegand wgNumber, user data, defined by the user.

          Description:Wiegand parameter configuration can be set through the system configuration menu.

          7.2 Wiegand Parameters Description

          Only access control devices have Wiegand related configuration, and the Wiegand parameter configuration can be opened in the menu Basic -> Advanced -> Access Control Signal. Wiegand parameters can be configured with general Wiegand types, or custom types, defining pulse interval width, total number of bits, number of data bits, and parity.

          image-20230614162831025

          Interface call example:

          Parameter: wgConfig, the parameter definition of Wiegand output, see the table below.

          WgConfigWiegand class
          mTypeWiegand type,WG_none,WG_26,WG_34,WG_36,WG_64,WG_Custom
          mAllBitsAll data bit length
          mDataBitsValid bits
          bCheckIs parity checks required
          mOCheckBitsOdd parity digit
          mECheckBitsEven parity digit
          mPulseWidthPulse width
          mPulseIntervalPulse interval

          7.3 RS485 Port API

          RS485 serial port API is an ordinary serial port that is automatically converted by hardware, and the software interfaces are consistent, so software development can use [6.1 Serial API Basic Interface].

          7.4 Fill Light API

          7.4.1 Visible Light Lamp API

          Visible light has three colors: red, green, and white. Among them, only white can be adjusted for brightness, red and green are not adjustable and can only be turned on and off.

          FunctionsSupplementLight class
          public int setBrightness(int brightness)Set the brightness of the white light. Only effective for white.
          public int setLightColor(int color)Turn on the color light, the white light turns on the brightness set last time, and the other red and green lights are turned on according to the default brightness. Color can take the enum value of LightColor.

           

          Interface call example:

          Parameters: brightness, the brightness value is defined by the user, the range is 0-255.

          7.4.2 Infrared Lamp API

          Infrared lamp. Brightness is adjustable.

          FunctionsSupplementLight class
          public int setNirLight(int brightness)Set the brightness of the infrared light. Only effective for the infrared light.

          Interface call example:

          Parameters: brightness - the brightness value is defined by the user, the range is 0-255.

          7.5 Card Reader API

          Calling the card reading interface. IDCARD provided as an example:

           

          Parameter: The IDCARD class data returned by the device can be converted into the BBoxIDCard class to obtain various information of the ID card. The class information is shown in the table below.

          Description: The card reader module mainly uses the registered listener, and the App only needs to process the required data in the callback. This scheme is common to other Input and Output devices.

          The following are some class descriptions of card readers.

          BBoxIDCardID Card class
          mNameName
          mSexGender
          mNationNationality
          mBirthdayBirthdate
          mAddressAddress
          mCardNoCard no.
          mDepartmentIssuing agency
          mValidDateStartValidity period start date
          mValidDateEndExpiry date
          mIssueTimesData read timestamp
          mFPFingerprint data
          photoImage

          M1CardIC card/M1 card class
          mUidCard no.
          mAtqaATQA code
          mSakSAK code

          7.6 Fingerprint Reader API Development

          An example of calling the interface of the fingerprint module. The DeviceManager instance must be retrieved first, and then call the relevant interface:

           

          Parameters: The fingerprint FingerPrint data returned by the device can be converted to the FingerPrint class to obtain the characteristic value data of the fingerprint. The class is shown in the table below.

          Description: The fingerprint module is mainly called through the register listener; the App only needs to process the required fingerprint data in the callback.

          FingerPrintFingerprint class
          mFeaturesFingerprint feature
          mPhotoFingerprint image

          7.6.1 Fingerprint 1:1 Comparison API

          1: 1 fingerprint comparison is generally used for the one-to-one comparison of ID cards. It needs to be used in conjunction with 3.5 IDCard. When ID card information is read and the ID card information contains fingerprint information, the Fingerprint comparison interface can be called.

          Interface call example:

           

          Parameter: MatchResult is the result of fingerprint comparison, detailed information is shown in the table below.

           

          MatchResultFingerprint comparison class
          mScoreMaximum similarity value of fingerprint comparison feature value (0-1000)
          mIndexThe index of the fingerprint with the largest similarity value, used for 1:N.
          mUuidThe owner of the fingerprint with the highest similarity value, used for 1:N.
          mResultCodeComparison result. 0 is correct, non-zero is incorrect
          mErrorCodeError code.
          0 is a valid result. Error codes are described:

          IDCARD_NO_DEV = -1
          FINGERPRINT_NO_DEV = -2
          IDCARD_NOT_DETECTED = -3
          FINGERPRINT_NOT_DETECTED = -4
          mPhotoFingerprint image

          7.6.2 Fingerprint 1:N Comparison API

          1:N fingerprint comparison is generally used for most comparison scenarios. The fingerprint data of N needs to be stored in advance, then a fingerprint is read and compared against it. Because the fingerprint information is embedded in the personnel information, refer to section 3.4 "Fingerprint Interface API" for the specific fingerprint-related addition, deletion, and modification API can.

          Interface call example:

           

          Parameter: MatchResult is the result of fingerprint comparison, see the class description for details.

           

          FingerFingerprint class
          uuidUser ID information of this fingerprint
          finger0Fingerprint feature value sequence 0
          finger1Fingerprint feature value sequence 1
          finger2Fingerprint feature value sequence 2
          finger3Fingerprint feature value sequence 3
          finger4Fingerprint feature value sequence 4

          7.7 Proximity sensor p-sensor API

          Proximity sensor p-sensor interface call example:

           

          Parameters: distance returned by the current measured distance, in millimeters. The normal test range is 0-800mm, and the error range is plus/minus 5mm, limited to indoor environments.

          Description: The short-range P-Sensor module mainly uses the register listener method, and the App only needs to process the required data in the callback.

           

          8. Facial Recognition Process Trigger Interface Description

          Supported face recognition triggers

           

          External trigger steps:

           

          Interface call example:

           

          9. Glossary

           

          10. Appendix

          10.1 Serial Port API Development

          1. Android devices will need to import the SDK package (com.beeboxes.sdk.jar) to the compileonlylibs directory.

          2. The PC client will need to import the serial SDK package (SerialTransport.jar) to the libs directory.

          3. The serial demo is executed for the first time, the system will kill the process and cause a crash when the USB read and write permissions are granted. The process can be simply restarted without affecting functionality.

          10.2 Required/Optional Items & Restrictions on Device Parameters

          Parameter type Field type
          Field
          Restrictions
             
          Personnel details   
             
          Required   
             
          Name   
             
          Required,   text input, between 1-64 characters.   
             
          Personnel ID   
             
          Required,   must be unique, text input, between 1-32 characters.   
             
          Image   
             
          Optional,   supports image upload. jpg, png, bmp format. Resolution at least 320*320px, max   size of 10MB.   
             
          Password   
             
          Optional,   text input, between 6-20 characters.   
             
          Gender   
             
          Optional,   drop-down single selection, default is "Please select". When the   user does not choose to add as a regular, the default gender is "blank".   
             
          Organization   
             
          Optional,   drop-down single selection. The default is the root organization (the   organization name must ne unique).   
             
          Email   
             
          Optional,   text input, between 4-64 characters.   
             
          Phone   
             
          Optional,   text input, between 4-64 characters.   
             
          IC card no.   
             
          Optional,   text input, between 0-32 characters.   
             
          Access card no.   
             
          Optional,   text input, between 0-32 characters.   
             
          ID no.   
             
          Optional,   text input, between 0-32 characters.   
             
          Recognition Parameter Library Name   
             
          Optional,   drop-down single selection, the default is "default", the specific   drop-down option needs to read the platform creation item (the only one in   the tenant, the maximum length is [1~64])   
             
          Optional   
             
          Registration Date   
             
          Optional,   format: YYYY-MM-DD    
             
          Position   
             
          Optional,   text input, between 0-64 characters.   
             
          Notes   
             
          Optional,   text input, between 0-256 characters.   
             
          Additional fields   
             
          Optional,   text input, between 0-32 characters. Up to 10 additional fields can be   created.   
             
          Device    
             
          -   
             
          Device Name   
             
          Optional,   text input, can benon-unique. Between 1 to 64 characters. When the device is   not named, the device is listed is displayed as "Unnamed device",   and the terminal is blank.   
             
          -   
             
          Device Group Name   
             
          Required,   text input, can be non-unique. Between 1-64 characters.   
             
          Personnel Rule   
             
          -   
             
          Access Rule Name   
             
          Required,   text input, must be unique. Between 1-64 characters.   
             
          -   
             
          Rule Description   
             
          Optional,   text input, between 0-64 characters.   
             
          -   
             
          Time Rule Name   
             
          Required,   text input, must be unique. Between 1-64 characters.   
             
          Access Record   
             
          -   
             
          Details   
             
          Photo   (registration, snapshot), personnel name, personnel number, verification   result, time (access time, accurate to the second), scoring, recognition parameter   library, personnel rules, access method, ID no., gender, nationality, birthdate   (year, month, day), address, country code, place of issue, issuing authority,   date of issue, expiration date
             
          The   above fields are read according to the personnel's access method. If the   access method is changed and some fields are blank/contain invalid   information, these field will be hidden.   
             
          Device Activation Code   
             
          -   
             
          -   
             
          12   characters (alphanumeric, case-insensitive). This code is randomly generated   by the system and can be used by multiple devices. However, this is unique,   and should not be reused.   
          Document library