BluIDSDK
public class BluIDSDK
BluIDSDK class is a collection of functions needed to access the variety of BluB0X security features like scanning of nearby devies, unlocking of door, updation of firmware.
-
Declaration
Swift
public init() -
Declaration
Swift
public convenience init(env: BluIDSDK_Environment) -
Declaration
Swift
public func enableFileLogging(enable: Bool) -
Declaration
Swift
public func isFileLoggingEnabled() -> Bool -
The function provides current SDK package version.
Return:
Returns response with SDK Version.
Usage Example:
m_bluIDSDKClient().getSDKVersion()Declaration
Swift
public func getSDKVersion() -> String -
This function checks and return user device’s Bluetooth Adapter power status.
Return:
Returns response with either true if bluetooth is turned ON or false.
Usage Example:
let response = m_bluIDSDKClient.isBluetoothTurnedON() print(response)Declaration
Swift
public func isBluetoothTurnedON() -> Bool -
This function reports user’s consent, for the usage of Bluetooth adapter.
Return:
Returns response with either true if the permission is granted or false.
Usage Example:
let response = m_bluIDSDKClient.isBluetoothAuthorized() print(response)Declaration
Swift
public func isBluetoothAuthorized() -> Bool -
The function is used to fetch the debug logs.
Return:
Returns response with logs of type String.
Usage Example:
m_bluIDSDKClient.registerDebugLogging(onLog: { (data) in print(data) })Declaration
Swift
public func registerDebugLogging(onLog callback: @escaping ((String) -> Void))Parameters
onLog{requestCallback} cb - The callback that handles the response.
-
The function is used to stop fetching the debug logs.
Usage Example:
m_bluIDSDKClient.unregisterDebugLogging()Declaration
Swift
public func unregisterDebugLogging() -
This function is used for signing in user with their BluB0x credentials.
Return:
Returns response with either error with
BluIDSDKErroror success withUserData.Usage Example:
m_bluIDSDKClient.login(credentials: UserCredentials(username:"username", password:"password"), onResponse: { (error, data) in print(error ?? "", data ?? "") if(error == nil){ self.syncPersonCards(onComplete:{ (error,data) in print(error ?? "",data ?? "") } } })Possible Errors:
Declaration
Swift
public func login(credentials: UserCredentials, onResponse callback: @escaping (BluIDSDKError?, UserData?) -> Void)Parameters
credentialsUserCredentialsCrendentials are username and passwordonResponseThis callback is triggered when the BluSKY server responds to login Request.
-
refreshLogin function is used to keep the session alive for current logged in user.
Return:
Returns response with either error with
BluIDSDKErroror success withUserData.Usage Example:
m_bluIDSDKClient.refreshLogin(onResponse: { (error, data) in print(error ?? "", data ?? "") })Possible Errors:
Declaration
Swift
public func refreshLogin(onResponse callback: @escaping (BluIDSDKError?, UserData?) -> Void)Parameters
onResponseThis callback is triggered when the BluSKY server responds to login Request.
-
Declaration
Swift
public func refreshIntegrator(integrator: String) -> BluIDSDKError? -
When user is signing-in for the first time on their device, this function needs to be invoke, so that user’s device is registered with BluSKY server. This will enable BluB0X to send important updates to the user device via notification
- firebaseToken : firebase token of the device on which SDK is running
- onResponse : This callback is triggered when the BluSKY server responds to registerUserDevice Request.
Return:
Returns response with either error with
BluIDSDKErroror success response withMobileDeviceObject.Usage Example:
m_bluIDSDKClient.registerUserDevice(firebaseToken: "firebaseToken",onResponse: { (error, data) in print(error ?? "", data ?? "") })Possible Errors:
BluIDSDKError.serverUnauthorizedDeclaration
Swift
public func registerUserDevice(firebaseToken: String, onResponse callback: @escaping (BluIDSDKError?, MobileDeviceObject?) -> Void) -
This function signs off the user from the their device and erases all the user cached content from their device.
Usage Example:
m_bluIDSDKClient.logout()Declaration
Swift
public func logout() -
This function scans and returns nearby BluPOINT devices.
Return:
Returns a list of
Device_Informationfor nearby BluPOINT devices.Usage Example:
do{ try? m_bluIDSDKClient.startDeviceDiscovery(filter:ScanFilter(signalStrength:-80,successiveCallbackFrequencyInMillis:3000),onDeviceDiscovered: { (data) in print(data) }) }Possible Errors:
Declaration
Swift
public func startDeviceDiscovery(filter: ScanFilter?, onDeviceDiscovered callback: @escaping onDevicesDicovered) throwsParameters
filterThis is a filter for scan callbacks, in terms for restricting successive callbacks and based on signal strength.
onDeviceDiscoveredThis callback is triggered once the device is discovered.
-
This function allows SDK to start auto-detection of gesture and once user performs a gesture, SDK authenticates the closest nearby BluPOINT enabled door to unlock, based on PersonCard availablity with the user.
Note: This function has dependency on syncPersonCards API
Usage Example:
m_bluIDSDKClient.startGestureBasedAuthentication()Declaration
Swift
public func startGestureBasedAuthentication() -
This function stops auto-detection of gesture.
Usage Example:
m_bluIDSDKClient.stopGestureBasedAuthentication()Declaration
Swift
public func stopGestureBasedAuthentication() -
This function update user preferences for gesture based authentication
Usage Example:
let gestureSettings = UserPreferences(allowAccess: AllowAccessType.foreground , enableVibrate : false, enableTap:true, enableTwist:true, enableAppSpecific:false, enableWave:false, enableRange: true, enableAI: false, enableAppleWatch: false, enableBluREMOTE:false, enhancedTap: true) m_bluIDSDKClient.saveUserPreference(setting:gestureSettings)Declaration
Swift
public func saveUserPreference(setting: UserPreferences)Parameters
settingGesture Settings of type
UserPreferences. Allow users to choose access type(Foreground,Background or Always) and enable any gesture based authentication. -
This function update user preferences for gesture based authentication.
Return:
Returns gesture settings of type
UserPreferenceswhich provides the setting for different gestures. If no setting is done by the user the default values are returned.Usage Example:
let gestureSettings = m_bluIDSDKClient.getUserPreference() print(gestureSettings)Declaration
Swift
public func getUserPreference() -> UserPreferences -
This function stops ongoing device discovery
Usage Example:
m_bluIDSDKClient.stopDeviceDiscovery()Declaration
Swift
public func stopDeviceDiscovery() -
This function allow user to blink LED near by BluPOINT devices
Note: Device should be unlock before calling this function
Return:
Returns response with
BluIDSDKErrorif any.Usage Example:
let deviceLED = Device_LED(color: Device_LED_Color(red: 0, green: 0xff, blue: 0),onTimeInSeconds: UInt8(5)) m_bluIDSDKClient.identifyDevice(withLED:deviceLED,onResponse:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func identifyDevice(withLED: Device_LED, onResponse: @escaping (BluIDSDKError?) -> Void)Parameters
withLEDDevice_LEDis the colour and time to which the LED of the unlocked device is set.onResponseThis callback is triggered when the device responds to the glow LED request.
-
This function allow user to beep BluPONT device for given seconds
Note: Device should be unlock before calling this function
Return:
Returns response with
BluIDSDKErrorif any.Usage Example:
let buzzerONInSeconds = UInt8(5) m_bluIDSDKClient.identifyDevice(withBuzzerONInSeconds:UInt8(buzzerONInSeconds),onResponse:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func identifyDevice(withBuzzerONInSeconds: UInt8, onResponse: @escaping (BluIDSDKError?) -> Void)Parameters
withBuzzerOnInSecondsTime for which the buzzer is set ON.
onResponseThis callback is triggered when the device responds to the ring buzzer request.
-
This function allows both blinking LED and beeping device for given seconds
Note: Device should be unlock before calling this function
Return:
Returns response with
BluIDSDKErrorif any.Usage Example:
let bothLEDnBuzzerONInSeconds = Device_LED(color: Device_LED_Color(red: 0, green: 0xff, blue: 0),onTimeInSeconds: UInt8(5)) m_bluIDSDKClient.identifyDevice(withBothLEDnBuzzerONInSeconds:bothLEDnBuzzerONInSeconds,onResponse:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseBluIDSDKError.deviceConnectionLostDeclaration
Swift
public func identifyDevice(withBothLEDnBuzzerONInSeconds: Device_LED, onResponse: @escaping (BluIDSDKError?) -> Void)Parameters
timeInSecondsThe time for which the LED of the unlocked device glows.
callbackThis callback is triggered when the device responds to the glow LED and ring buzzer request.
-
Disconnect and Locks the access of connected BluPOINT device
m_bluIDSDKClient.lockDeviceAccess()Declaration
Swift
public func lockDeviceAccess() -
Gets firmware Version, Name, MAC address, Stack version and KeySet Id of the conncted BluPOINT device.
Return:
Returns response with either error with
BluIDSDKErroror success with device details of typeDevice_Details.Usage Example:
let deviceID = "aaaa1111-bb22-cc33-dd44-eee555fff666" m_bluIDSDKClient.getDeviceInformation(deviceID:deviceID,callback:{ (error,data) in print(error ?? "", data ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func getDeviceInformation(deviceID: String, callback: @escaping (BluIDSDKError?, Device_Details?) -> Void)Parameters
deviceIDDevice ID of BluPOINT device to get the device information
callbackThis callback is triggered when the device responds to the getDeviceInformation request.
-
Gets firmware Version, Name, MAC address, Stack version and KeySet Id of the conncted BluPOINT device.
Return:
Returns response with either error with
BluIDSDKErroror success with device details of typeDevice_Details.Usage Example:
m_bluIDSDKClient.getDeviceInformation(callback:{ (error,data) in print(error ?? "", data ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func getDeviceInformation(callback: @escaping (BluIDSDKError?, Device_Details?) -> Void)Parameters
callbackThis callback is triggered when the device responds to the getDeviceInformation request.
-
Gets current firmware version of the connected BluPOINT device
Note: Device should be unlock before calling this function
Return:
Returns response with either
BluIDSDKErroror success with firmware version of type String.Usage Example:
m_bluIDSDKClient.getDeviceFirmwareVersion(callback:{ (error,data) in print(error ?? "", data ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseBluIDSDKError.deviceCommunicationErrorDeclaration
Swift
public func getDeviceFirmwareVersion(callback: @escaping (BluIDSDKError?, String?) -> Void)Parameters
callbackThis callback is triggered when the device responds to the get the device firmware version request.
-
Returns list of available firmware version in BluSKY Server.
Note: It has dependency on login API
Return:
Returns response with list of available firmwares in BluSKY server of type
Device_Firmware.Usage Example:
m_bluIDSDKClient.listAvailableFirmwareVersions(onResponse:{ (data) in print(data ?? "") })Declaration
Swift
public func listAvailableFirmwareVersions(onResponse callback: @escaping (([Device_Firmware]?) -> Void))Parameters
onResponseThis callback is triggered when the BluSKY server responds to get list of available firmware request.
-
Deletes firmware list from user device.
Return:
Returns response with a array of version with it’s corresponding error if any.
Usage Example:
var versions = ["0.00.35","0.00.36"] let response = m_bluIDSDKClient.removeFirmwareFromUserDevice(versions:versions) print(response)Possible Errors:
Declaration
Swift
public func removeFirmwareFromUserDevice(versions: [String]) -> [String : BluIDSDKError?]Parameters
versionsA list of firmware versions to be deleted.
-
The function is used to authenticate whether the user is allowed at that BluPOINT device.
Return:
Returns response with either
BluIDSDKErrorif any.Usage Example:
m_bluIDSDKClient.transferCredential(deviceID:"aaaa1111-bb22-cc33-dd44-eee555fff666",onResponse:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.deviceConnectFailureDeclaration
Swift
public func transferCredential(deviceID: String, onResponse callback: @escaping (BluIDSDKError?) -> Void)Parameters
deviceIDDevice ID of unlocked BluPOINT device.
onResponseThis callback is triggered when the device responds to the transfer credentials request.
-
Gets person cards from BluSKY Server and saves it to user device
Note: It has dependency on login API
Return:
Returns response with either
BluIDSDKErroror success response with list ofPersonCardDetails.Usage Example:
m_bluIDSDKClient.syncPersonCards(onComplete:{ (error,data) in print(error ?? "",data ?? "") })Possible Errors:
Declaration
Swift
public func syncPersonCards(onComplete callback: @escaping (BluIDSDKError?, [PersonCardDetails]?) -> Void)Parameters
onCompleteThis callback is triggered when the BluSKY server responds to the syncPersonCards Request.
-
Gets person cards for given User ID from BluSKY Server and saves it to user device
Note: It has dependency on login API
Return:
Returns response with either
BluIDSDKErroror success response with list ofPersonCardDetails.Usage Example:
var userID = "1234abcd-5678-910e-80f3-d6712de9a4db" m_bluIDSDKClient.syncPersonCardsByID(userID : userID,filter: .BluB0XMobile,onComplete:{ (error,data) in print(error ?? "",data ?? "") })Possible Errors:
Declaration
Swift
public func syncPersonCardsByID(userID: String, filter: CredentialType?, onComplete callback: @escaping (BluIDSDKError?, [PersonCardDetails]?) -> Void)Parameters
userIDUnique identifier of a user assigned by BluB0x.
filteronCompleteThis callback is triggered when the BluSKY server responds to the syncPersonCardsByID Request.
-
Returns all person cards available in user device.
Return:
Returns response with list of
PersonCardDetails.Usage Example:
let response = m_bluIDSDKClient.getPersonCardsOffline() print(response)Declaration
Swift
public func getPersonCardsOffline() -> [PersonCardDetails] -
Downloads given firmware versions from BluSKY server.
Note: It has dependency on login API
Return:
Returns response with array of firmware version and its corresponsing
BluIDSDKErrorif any.Usage Example:
do{ try? m_bluIDSDKClient.downloadFirmware(versions:["0.00.36","0.00.35"],onResponse:{ (data) in print(data) }) }Possible Errors:
BluIDSDKError.serverUnauthorizedBluIDSDKError.serverBadRequest(errorCode:)BluIDSDKError.serverError(errorCode:)Declaration
Swift
public func downloadFirmware(versions: [String], onResponse callback: @escaping ([String : BluIDSDKError?]) -> Void) throwsParameters
versionsA list of firmware Versions that are to be downloaded
onCompleteThis callback is triggered when the BluSKY server responds to the download firmware request.
-
Downloads given firmware version from BluSKY server
Note: It has dependency on login API
Return:
Returns response with
BluIDSDKErrorif any.Usage Example:
m_bluIDSDKClient.downloadFirmware(version:"0.00.36",onComplete:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.serverUnauthorizedBluIDSDKError.serverBadRequest(errorCode:)BluIDSDKError.serverError(errorCode:)BluIDSDKError.downloadFailed(message:)BluIDSDKError.error(error: error)Declaration
Swift
public func downloadFirmware(version: String, onComplete callback: @escaping ((BluIDSDKError?) -> Void))Parameters
versionVersion denotes the firmware version that is to be downloaded
onCompleteThis callback is triggered when the BluSKY server responds to the download firmware request.
-
Reboots connectd BluPOINT device after given seconds.
Note: Device should be unlock before calling this function
Return:
Returns response with either
BluIDSDKErroror success response with String set to nil.Usage Example:
let afterSeconds: UInt8 = 3 m_bluIDSDKClient.rebootDevice(afterSeconds:afterSeconds,onDisconnect:{ (error,data) in print(error ?? "",data ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutDeclaration
Swift
public func rebootDevice(afterSeconds: UInt8?, onDisconnect callback: @escaping (BluIDSDKError?, String?) -> Void)Parameters
afterSecondsDelay in seconds to perform reboot of BluPOINT device
onDisconnectThis callback is triggered when the device gets disconnected.
-
This function update’s device firmware.
Note: Device should be unlock before calling this function
Return:
Returns response with either
BluIDSDKErroror success response with Boolean which denotes whether the device is connected or not.Usage Example:
m_bluIDSDKClient.updateSingleDeviceFirmware(version:"0.00.36",onUpdateComplete:{ (error,data) in print(error ?? "",data ?? "") }, progressHandler : {(percent) in print(percent) })Possible Errors:
BluIDSDKError.firmwareUpdateFailed(errorMessage)Declaration
Swift
public func updateSingleDeviceFirmware(version: String, onUpdateComplete callback: @escaping ((BluIDSDKError?, Bool?) -> Void), progressHandler: @escaping ((Int) -> Void))Parameters
versionFirmware version to which the firmware needs to be upgraded.
onUpdateCompleteThis callback is triggered when the firmware upgrade is complete.
progressHandlerThe callback which checks the progress of the upgrade process and takes actions accordingly
-
This function update’s multiple BluPOINT device’s firmware to a given firmware version.
Return:
Returns response with a array of deviceId of type String and its corresponding
BluIDSDKErrorif any.Usage Example:
m_bluIDSDKClient.updateMultipleDeviceFirmware(deviceIDs:["aaaa1111-bb22-cc33-dd44-eee555fff666","aaaa1111-bb22-cc33-dd44-eee555fff777"],firmwareVersion: "0.00.36",onUpdateComplete:{ (data) in print(data) }, progressHandler : {(deviceID,percent,error) in print(deviceID , percent ?? "" , error ?? "") })Possible Errors:
BluIDSDKError.deviceConnectFailureBluIDSDKError.deviceInvalidResponseBluIDSDKError.firmwareUpdateFailed(errorMessage)Declaration
Swift
public func updateMultipleDeviceFirmware(deviceIDs: [String], firmwareVersion: String, onUpdateComplete callback: @escaping (([String : BluIDSDKError?]) -> Void), progressHandler: @escaping (String, Int?, BluIDSDKError?) -> Void)Parameters
deviceListList of device IDs of BluPOINT devices whose firmware are to be upgraded.
versionThe firmware version to which the devices will be upgraded.
onUpdateCompleteThis callback is triggered when the upgradation process is completed.
progressHandlerThe callback which checks the progress of the upgrade process and takes actions accordingly. It returns the deviceID with its progress percent Int and
BluIDSDKErrorif any. -
Returns device mode of a selected BluPOINT device, device modes are BluPOINT and BluBOOT
Return:
Returns response with
DeviceModegiving whether the device is in BluPOINTMode or blubootMode.Usage Example:
let response = m_bluIDSDKClient.getDeviceMode() print(response)Declaration
Swift
public func getDeviceMode() -> DeviceMode -
Return BLE Tx power of connected BluPOINT device.
Note: Device should be unlock before calling this function.
Return:
Returns response with either
BluIDSDKErroror transmission power UInt8.Usage Example:
m_bluIDSDKClient.getBLETxPowerLevel(callback:{ (error,data) in print(error ?? "",data ?? "") })Possible Errors:
BluIDSDKError.deviceConnectFailureDeclaration
Swift
public func getBLETxPowerLevel(callback: @escaping (BluIDSDKError?, UInt8?) -> Void)Parameters
callbackThis callback is triggered when the device responds to getBLETxPowerLevel request.
-
Sets BLE Tx power of connected BluPOINT device, this will advertis all packets and data packets with this power level
Note: Device should be unlock before calling this function
Return:
Returns response with either
BluIDSDKErroror success with transmission power UInt8.Usage Example:
let strength: UInt8 = 3 m_bluIDSDKClient.updateDeviceBLETxPowerLevel(strength: strength,callback:{ (error,data) in print(error ?? "",data ?? "") })Possible Errors:
BluIDSDKError.deviceConnectFailureBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func updateDeviceBLETxPowerLevel(strength: UInt8, callback: @escaping (BluIDSDKError?, UInt8?) -> Void)Parameters
strengthThe strength to be set for the BluPOINT device.
callbackThis callback is triggered when the device responds to updateDeviceBLETxPowerLevel request.
-
This function will unlock restricted access to BluPOINT device and allow user to tweak BluPOINT device settings such as, name, LED color, Tx Power, Gesture Settings etc and Upgrade device firmware.
Note: It has dependency on login API
Return:
Returns response with either
BluIDSDKErroror success with unlock validity time of typeInt64.Usage Example:
m_bluIDSDKClient.unlockDeviceAccess(deviceID: "aaaa1111-bb22-cc33-dd44-eee555fff666",onResponse:{ (error,data) in print(error ?? "",data ?? "") }, onDisconnect: { (data1) in print(data1) })Possible Errors:
BluIDSDKError.deviceConnectFailureBluIDSDKError.deviceConnectionLostDeclaration
Swift
public func unlockDeviceAccess(deviceID: String, onResponse callback: @escaping (BluIDSDKError?, Int64?) -> Void, onDisconnect disconnectCb: ((String) -> Void)?)Parameters
deviceIDDevice ID of BluPOINT device to unlock.
onResponseThis callback is triggered once the device responds to the unlock request.
onDisconnectThis callback is triggered when the device gets disconnected.
-
Set encryption keys of the connected device, encryption key is use to validate the credentials.
Return:
Returns response with
BluIDSDKErrorif any else with nil.Usage Example:
m_bluIDSDKClient.updateDeviceKeys(key: "144 bytes key",callback:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutDeclaration
Swift
public func updateDeviceKeys(key: String, callback: @escaping (BluIDSDKError?) -> Void)Parameters
keyThe value of the new device keys for the BluPOINT device.
onResponseThis callback is triggered when the device responds to updateDeviceKeys request.
-
Gets list of all requests to BluPONT device to access door.
Return:
Returns response with list of access logs of type
AccessLogItem.Usage Example:
let response = m_bluIDSDKClient.getAccessLogs() print(response)Declaration
Swift
public func getAccessLogs() -> [AccessLogItem]? -
Gets user device (Phone) information and logs to diagnostic any issue
Return:
Returns response with diagnostic logs of type
DiagnosticLog.Usage Example:
let response = m_bluIDSDKClient.getDiagnosticInfo() print(response)Declaration
Swift
public func getDiagnosticInfo(callback: @escaping (DiagnosticLog) -> Void)Parameters
callbackThis callback is triggered when the SDK responds to getDiagnosticInfo request.
-
Declaration
Swift
public func clearDiagnosticLogs() -
Updates name of connected BluPOINT device.
Return:
Returns response with
BluIDSDKErrorif any else with nil.Usage Example:
m_bluIDSDKClient.updateDeviceName(name: "device1",onResponse:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func updateDeviceName(name: String, onResponse callback: @escaping (BluIDSDKError?) -> Void)Parameters
nameThe value of the new device name for the BluPOINT device
onResponseThis callback is triggered when the device responds to the updateDeviceName request.
-
Updates MAC address of connected BluPOINT device.
Return:
Returns response with
BluIDSDKErrorif any else with nil.Usage Example:
m_bluIDSDKClient.updateDeviceMacAddress(macAddress: "1a2b3c4d5e6f",onResponse:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func updateDeviceMacAddress(macAddress: String, onResponse callback: @escaping (BluIDSDKError?) -> Void)Parameters
macThe value of the new device MAC for the BluPOINT device
onResponseThis callback is triggered when the device responds to the updateDeviceMacAddress request.
-
Gets Access key of connected BluPOINT device, AccessKey is key used by BluPOINT device to communicate with SDK.
Return:
Returns response with either
BluIDSDKErroror success response with device key of type String.Usage Example:
m_bluIDSDKClient.getDeviceAccessKey(onResponse:{ (error,data) in print(error ?? "",data ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func getDeviceAccessKey(onResponse callback: @escaping (BluIDSDKError?, String?) -> Void)Parameters
onResponseThis callback is triggered when the device responds to the getDeviceAccessKey request.
-
The function is used to set range and enable or disable Enhanced Tap operation for the connected BluPOINT device .
Return:
Returns response with
BluIDSDKErroror with success with nil.Usage Example:
let enhancedTapSettings = EnhancedTapSettings(enabled: true,iosBackgroundPower: -65,iosForegroundPower: -60,androidPower: -55) m_bluIDSDKClient.updateDeviceSettings(enhanceTapSetting: enhancedTapSettings,callback:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func updateDeviceSettings(enhanceTapSetting: EnhancedTapSettings, callback: @escaping (BluIDSDKError?) -> Void)Parameters
enhanceTapSettingsThe new enhance Tap settings for the BluPOINT device.
onResponseThis callback is triggered when the device responds to the updateDeviceSettings request.
-
This function allow user to enable or disable wiegend based communication between BluPOINT device and SDK.
Note: Device should be unlock before calling this function
Return:
Returns response with
BluIDSDKErroror with success with nil.Usage Example:
m_bluIDSDKClient.updateDeviceSettings(enableWiegand: true,callback:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func updateDeviceSettings(enableWiegand: Bool, callback: @escaping (BluIDSDKError?) -> Void)Parameters
enableWiegandThe new Wiegand settings for the BluPOINT device
onResponse{requestCallback} cb - The callback that handles the response.
-
The function is used to set the readerID for the connected BluPOINT device.
Return:
Returns response with
BluIDSDKErroror with success with nil.Usage Example:
let readerID: UInt32 = 843621 m_bluIDSDKClient.setDeviceReaderID(readerID: readerID,callback:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func setDeviceReaderID(readerID: UInt32, callback: @escaping (BluIDSDKError?) -> Void)Parameters
readerIDThe new reader ID for the BluPOINT device
onResponseThis callback is triggered when the device responds to the setDeviceReaderID request.
-
Declaration
Swift
public func startBLELogging(deviceName: String, gestureType: String) throws -
Declaration
Swift
public func stopBLELogging() throws -
This function update BluPOINT LED color for different state i.e, (inUse,idle)
Note: Device should be unlock before calling this function
Return:
Returns response with
BluIDSDKErroror with success with nil.Usage Example:
let deviceState : DeviceState = .in_use let ledColor = Device_LED_Color(red:0,green:0xff,blue:0) m_bluIDSDKClient.setDeviceStateLEDColor(forDeviceState: deviceState,color:ledColor,onResponse:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func setDeviceStateLEDColor(forDeviceState deviceState: DeviceState, color ledColor: Device_LED_Color, onResponse callback: @escaping ((BluIDSDKError?) -> Void))Parameters
deviceStateThe state of BluPOINT device for which the color needs to be changed
ledColorThe color which needs to be set
onResponseThis callback is triggered when the device responds to the setDeviceStateLEDColor request.
-
This function return the BluPOINT LED color for different state i.e, (inUse,idle)
Note: Device should be unlock before calling this function
Return:
Returns response with either
BluIDSDKErroror success response with led colour of typeBluPOINT_LED_Color.Usage Example:
m_bluIDSDKClient.getDeviceStateLEDColor(forDeviceState: .idle,onResponse:{ (error,data) in print(error ?? "",data ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func getDeviceStateLEDColor(forDeviceState deviceState: DeviceState, onResponse callback: @escaping ((BluIDSDKError?, Device_LED_Color?) -> Void))Parameters
deviceStateThe state of BluPOINT device for which the color needs to be changed
onResponseThis callback is triggered when the device responds to the getDeviceStateLEDColor request.
-
This function removes all Person Cards from user Phone.
m_bluIDSDKClient.deleteAllPersonCardsFromUserDevice()Declaration
Swift
public func deleteAllPersonCardsFromUserDevice() -
This function removes, list of Person Cards provided by user.
Declaration
Swift
public func deletePersonCardsFromUserDevice(cardIDs: [String])Parameters
cardIDsList of card IDs to be deleted.
let cardIDs = ["4","6"] m_bluIDSDKClient.deletePersonCardsFromUserDevice(cardIDs:cardIDs) -
This function erase all user setting and bring device to factory setting.
This function reset’s BluPOINT device to it’s factory state.
Return:
Returns response with either
BluIDSDKErroror success response with nil.Usage Example:
m_bluIDSDKClient.factoryResetDevice(onComplete:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func factoryResetDevice(onComplete callback: @escaping ((BluIDSDKError?) -> Void))Parameters
onCompleteThis callback is triggered when the device gets reset.
-
Update Gesture based authentication setting of connected BluPOINT device, settings include the minimum power required for a gesture and enabling and disabling gesture for the device.
Return:
Returns response with
BluIDSDKErroror with success with nil.Usage Example:
let tapSettings = GestureSetting(enabled: true, power: -50) let gestureType = GestureType.tap m_bluIDSDKClient.updateDeviceSettings(gesture: gestureType,setting: tapSettings,callback:{ (error) in print(error ?? "") })Possible Errors:
BluIDSDKError.deviceAPITimeoutBluIDSDKError.deviceInvalidResponseDeclaration
Swift
public func updateDeviceSettings(gesture: GestureType, setting: GestureSetting, callback: @escaping (BluIDSDKError?) -> Void)Parameters
gestureGesture Type that is needed to be updated.
settingThe new gesture setting of type
GestureSettingfor the BluPOINT device.onResponseThis callback is triggered when the device responds to the updateDeviceSettings request.
BluIDSDK Class Reference