BLESolstice Protocol Reference

Conforms to CBPeripheralDelegate
NSObject
Declared in BLESolstice.h

Overview

Communication agent, holding peripheral connection object, make a protocol conversion between the app and the device, so that the API is easier to understand than the binary. All api are suitable for the scene, not all devices support all api, if your device does not support your api call, you will get an NSError or in the console to see the “device does not support” log

– getConnectedPeriphral required method

This method can help you to get that Device object you are connected to.

- (CBPeripheral *)getConnectedPeriphral

Return Value

Returns as a CBPeripheral object

Declared In

BLESolstice.h

– readDeviceInfo required method

! Read device Info. Got the response in method readResponseFromDevice:

- (void)readDeviceInfo

Declared In

BLESolstice.h

– readDeviceBattery required method

! Read device battery. Got the response in method readResponseFromDevice:

- (void)readDeviceBattery

Declared In

BLESolstice.h

– rebootDevice required method

! Reboot device .Special device supported

- (void)rebootDevice

Declared In

BLESolstice.h

– deviceUpgrade required method

! Upgrade device for DFU ,device will enter DFU state while received this cmd

- (void)deviceUpgrade

Declared In

BLESolstice.h

– debindFromSystem required method

! Device debind from iPhone system

- (void)debindFromSystem

Declared In

BLESolstice.h

– setDNDMode: required method

! Set don’t disurb model

- (void)setDNDMode:(ZRDNDModel *)dndModel

Declared In

BLESolstice.h

– readDNDModeInfo required method

! Read DND model. Got the response in method readResponseFromDevice:

- (void)readDNDModeInfo

Declared In

BLESolstice.h

– setWeather: required method

! Sent weather info to device for show in screen ,special devices support

- (void)setWeather:(ZRWeather *)weather

Declared In

BLESolstice.h

– syscTimeAtOnce required method

- (void)syscTimeAtOnce

See Also

Declared In

BLESolstice.h

– syscTime: required method

Synchronization time

- (void)syscTime:(NSDate *)date

Parameters

date

The date your need sysc in device.

Declared In

BLESolstice.h

– readTime required method

! Read device dateTime. Got the response in method readResponseFromDevice:

- (void)readTime

Declared In

BLESolstice.h

– setBLESpeedMode: required method

! Set app and watch sync speed

- (void)setBLESpeedMode:(BLECommunicateMode)mode

Declared In

BLESolstice.h

– readBLESpeedMode required method

! Read ble speed mode. Got the response in method readResponseFromDevice:

- (void)readBLESpeedMode

Declared In

BLESolstice.h

– setBLESign: required method

! Set BLE sign

- (void)setBLESign:(BLEParamSign)sign

Declared In

BLESolstice.h

– readBLESign required method

! Read ble sign type. Got the response in method readResponseFromDevice:

- (void)readBLESign

Declared In

BLESolstice.h

– setAlarmClock: required method

! The device reserves a fixed number of alarm settings (usually eight), this method allows you to set the alarm one by one, the id of the alarm is a continuous natural number, do not exceed the allowable range, if the device has an alarm id 0x07, This is you add an alarm id is still 0x07, which is the total number of alarm clock in the device is still 1, that 0x07 alarm content will be your last set. Special device support, device in <BLEProtocol_Colorful> did not support this method ,use method setAlarmClocks:andSchedules: instead.

- (void)setAlarmClock:(ZRClock *)clockModel

Parameters

clockModel

alarm clock object.

Declared In

BLESolstice.h

– setAlarmClocks:andSchedules: required method

Because of the protocol, all alarms and schedules are written in one time in the same command. With this method, you need to remember the alarms and schedules you have set. Each time this method is called, the new alarm is written And schedule settings, all previous settings will be cleared. Communication reasons, this method takes a long time, when used, please note that the operation of the time interval. This method is designed for BLEProtocolColorful> devices, but is compatible with other devices and is not recommended for use if your device is not BLEProtocolColorful

- (void)setAlarmClocks:(NSArray<ZRClock*> *)clockModels andSchedules:(NSArray<ZRSchedule*> *)schedules

Parameters

clockModels

All clocks method, you should been set less than 4 in BLEProtocol_Colorful, less than 8 in other protocol type device.

schedules

You are advised to write no more than 4 calendars

Declared In

BLESolstice.h

– readAlarmClocks: required method

Read alarm clocks from device. If you had sent nil to param racResponse,you will got the response in method readResponseFromDevice:

- (void)readAlarmClocks:(ReadAlarmClockResponse)racResponse

Parameters

racResponse

Block for read response .

Declared In

BLESolstice.h

– clearAllClocks required method

! Clear all clocks in smartband

- (void)clearAllClocks

Declared In

BLESolstice.h

– setSchedule: required method

! Set single ZRSchedule ,special device support.

- (void)setSchedule:(ZRSchedule *)sModel

Declared In

BLESolstice.h

– closeSchedule: required method

! Close single ZRSchedule ,special device support.

- (void)closeSchedule:(ZRSchedule *)sModel

Declared In

BLESolstice.h

– readScheduleInfo: required method

Read schedule info ,If you had sent nil to param rsResponse, you will got the response in method readResponseFromDevice: dict[@“cur_num”] 当前可配置日程数量 remaining number of schedule could be set. dict[@“all_num”]:日程最大数量 max number of schedule we can configure dict[@“day_num”]: 每天可配置日程数量 max number of schedule could be configured for one day.

- (void)readScheduleInfo:(ReadSheduleResponse)rsResponse

Parameters

rsResponse

Block for read schedule info.

Declared In

BLESolstice.h

– readSchedule: required method

! Read special schedule model. Got the response in method readResponseFromDevice:

- (void)readSchedule:(ZRSchedule *)sModel

Declared In

BLESolstice.h

– clearAllSchedules required method

! Clear all ,there is no way to delete one schedule model ,your should call this method if you need remove some invalid calendars for set more

- (void)clearAllSchedules

Declared In

BLESolstice.h

– setSedentary: required method

! Set sedentary warning

- (void)setSedentary:(ZRSedentary *)sedentaryModel

Declared In

BLESolstice.h

– readSedentary required method

! Read sendentary. Got the response in method readResponseFromDevice:

- (void)readSedentary

Declared In

BLESolstice.h

– setDeviceOption: required method

! Setting device option ,Some bracelets only support some settings

- (void)setDeviceOption:(ZRHWOption *)deOption

Declared In

BLESolstice.h

– readDeviceOption required method

! Read device option. Got the response in method readResponseFromDevice:

- (void)readDeviceOption

Declared In

BLESolstice.h

– readSupportSports required method

! Get sport type list that device support. Got the response in method readResponseFromDevice:

- (void)readSupportSports

Declared In

BLESolstice.h

– setSportTarget: required method

! Add a moving target to the device, and then you can see the type of motion you added on the device’s exercise screen

- (void)setSportTarget:(ZRSportTarget *)st

Declared In

BLESolstice.h

– readSportTargets required method

! Read Sport target in device. Got the response in method readResponseFromDevice:

- (void)readSportTargets

Declared In

BLESolstice.h

– addContacts: required method

Add contacts to the device ,special device support.

- (void)addContacts:(ZRContacts *)cModels

Declared In

BLESolstice.h

– readContacts required method

! Read. Got the response in method readResponseFromDevice:

- (void)readContacts

Declared In

BLESolstice.h

– removeContacts: required method

! Remove

- (void)removeContacts:(NSArray<ZRContacts*> *)cModels

Declared In

BLESolstice.h

– clearAllContacts required method

! Clear

- (void)clearAllContacts

Declared In

BLESolstice.h

– setPersonalInfo: required method

! Set personal info .The device requires you to pass in actual wearer information to help correct the gait algorithm

- (void)setPersonalInfo:(ZRPersonal *)personalModel

Declared In

BLESolstice.h

– readPersonalInfo required method

! Read personal info. Got the response in method readResponseFromDevice:

- (void)readPersonalInfo

Declared In

BLESolstice.h

– setEHRWParam: required method

Heart rate alarm parameters ,Special device support

- (void)setEHRWParam:(ZREHRWP *)ehrwp

Declared In

BLESolstice.h

– readEHRWParam required method

! Read. Got the response in method readResponseFromDevice:

- (void)readEHRWParam

Declared In

BLESolstice.h

– setGNSSParameter: required method

Set GNSS location information, this function is aided <BLEProtocol_Watch> positioning, other devices do not need to deal with it.

- (void)setGNSSParameter:(ZRGnssParam *)gp

Declared In

BLESolstice.h

– readGNSSParameter required method

! Read. Got the response in method readResponseFromDevice:

- (void)readGNSSParameter

Declared In

BLESolstice.h

– setTargetOnceDay: required method

Set the target number of days and target calories on the day, a ring indicating the progress will be displayed on the home page of the device. If the device supports this method

- (void)setTargetOnceDay:(ZRTargetOnceDay *)target

Declared In

BLESolstice.h

– readTargetOnceDay required method

! Read. Got the response in method readResponseFromDevice:

- (void)readTargetOnceDay

Declared In

BLESolstice.h

– setMessagePush: required method

Set incoming call reminder and message reminder

- (void)setMessagePush:(ZRMesgPush *)messagePush

Declared In

BLESolstice.h

– readMessagePush required method

! Read. Got the response in method readResponseFromDevice:

- (void)readMessagePush

Declared In

BLESolstice.h

– pushStr: required method

Push string, Example: [ZRBLE pushStr:@“This is a test string”];

- (void)pushStr:(NSString *)str

Declared In

BLESolstice.h

– addSpecialList: required method

Add a message blacklists . The contents of the blacklist agreement are as follows: The app writes the corresponding application package name (such as WeChat) to the hand ring through a specific protocol. The wristband performs blacklist filtering by using the package name from the data information received by the ANCS, and the application message that adds the blacklist is no longer displayed on the handband interface on. Notes: 1. Due to limited bracelet space, only four blacklist applications are currently supported 2. The factory does not set a blacklist 3. Some custom firmware should be set to white list client requirements, iwown common version is set to blacklist Set the blacklist protocol as follows: Add     “com.tencent.xin ”- WeChat              "com.tencent.mqq" - QQ              "com.apple.mobilephone" - Incoming call              "com.apple.MobileSMS" - message For more build identify for third part apps. use 【ios-deploy –id [udid] –list_bundle_id 】in Ternimal got them. Links:http://www.bijishequ.com/detail/430052             NSArray * arr = @ [@ "com.apple.mobilephone",                               @ "com.apple.MobileSMS"                               @ "com.tencent.mqq",                               @ "com.tencent.xin"];             NSMutableArray * mArr = [NSMutableArray arrayWithCapacity: 0];             for (int i = 0; i <arr.count; i ++) {                 ZeronerRoll * zRoll = [[ZeronerRoll alloc] init];                 zRoll.rId = 100 + i;                 zRoll.rollName = arr [i];                 [mArr addObject: zRoll];             }             [[BLELib3 shareInstance] addSpecialList: mArr]; 2. Read the blacklist application information @code [[BLELib3 shareInstance] readAllList];@endcode 3. Clear blacklist    @code    [[BLELib3 shareInstance] clearAllLists];@endcode 4 read the contents of the blacklist @code NSMutableArray * mArr = [NSMutableArray arrayWithCapacity: 0];             for (int i = 0; i <3; i + = 2) {                 ZeronerRoll * zRoll = [[ZeronerRoll alloc] init];                 zRoll.rId = 101 + i;                 [mArr addObject: zRoll];             }             [[BLELib3 shareInstance] removeSpecialList: mArr]; @endcode

- (void)addSpecialList:(NSArray<ZRRoll*> *)sLists

Parameters

sLists

The blaklists

Declared In

BLESolstice.h

– setKeyNotify: required method

setKeyNotify 进入智拍模式设置1. 退出智拍模式设置0 // 通知拍照从 - (void)notifyToTakePicture; 获得 call this method to become smart photo or exits. set value 1 to active and set 0 to exit; get photoes @see - (void)notifyToTakePicture;

- (void)setKeyNotify:(BKeyNotify)keyNotify

Declared In

BLESolstice.h

– setMotors: required method

Set the vibration mode

- (void)setMotors:(NSArray<ZRMotor*> *)motors

Declared In

BLESolstice.h

– readSupportMotorCount required method

! Read count of motor type. Got the response in method readResponseFromDevice:

- (void)readSupportMotorCount

Declared In

BLESolstice.h

– feelMotor: required method

! Experience the vibration<##>

- (void)feelMotor:(ZRMotor *)motor

Declared In

BLESolstice.h

– setRecognitionParams: required method

! Set motion recognition parameters, transparent protocols, special equipment support

- (void)setRecognitionParams:(ZRAction *)action

Declared In

BLESolstice.h

– setCustomOptions: required method

! Custom device function protocol, special device support

- (void)setCustomOptions:(ZRCOption *)cOption

Declared In

BLESolstice.h

– readCustomOptions required method

! Read. Got the response in method readResponseFromDevice:

- (void)readCustomOptions

Declared In

BLESolstice.h

– startEpoUpgrade required method

<BLEProtocol_Watch> The device’s EPO (Assisted Positioning Protocol) upgrade is used to assist the device in positioning. When the device receives this command, it will trigger BTNotify communication and implement the BTNotify protocol protocol to upgrade the EPO file

- (void)startEpoUpgrade

Declared In

BLESolstice.h

– setBleConnectStatus required method

! Devices that implement <BLEProtocol_Colorful> need to set the state of the communication over the lBLE connection in three states, direct, iOS, Android; only the fact that the state is iOS is communicable in our case, and the rest are invalid . Calling the setBleConnectStatus method attempts to set the connection state parameter, and the getConnectionStatus party can read the connection parameter. The return value is available in the responseOfConnectStatus: method.

- (void)setBleConnectStatus

Declared In

BLESolstice.h

– getConnectionStatus required method

! responseOfConnectStatus:<##>

- (void)getConnectionStatus

Declared In

BLESolstice.h

– getDataStoreDate required method

This method will read the device’s data, you can get the returned data info in the updateNormalHealthDataInfo: method, you can sync the data you want to get based on the data

- (void)getDataStoreDate

Declared In

BLESolstice.h

– startSpecialData: required method

! Mehtod to sysc data .

- (void)startSpecialData:(SD_TYPE)sdType

Declared In

BLESolstice.h

– startSpecialData:withDate: required method

! Mehtod to sysc data .

- (void)startSpecialData:(SD_TYPE)sdType withDate:(NSDate *)date

Declared In

BLESolstice.h

– startSpecialData:withDate:startSeq:endSeq: required method

Synchronize the data method, incoming data from the updateNormalHealthDataInfo: method to get your specified time or type of data, the data is packaged in a fixed manner, based on the amount of data, some of the data we are packaged together, But there are some data as a separate data package

- (void)startSpecialData:(SD_TYPE)sdType withDate:(NSDate *)date startSeq:(NSInteger)startSeq endSeq:(NSInteger)endSeq

Parameters

sdType

Type

date

Special date .This version of the SDK which we put the time of the data as an important dimension, many data are packaged based on the date. However, some bracelets do not support this. If you do not get a valid date, you can pass in nil when syncing data or we consider this case, which is also valid on certain devices. Or you can use method without this parameter like startSpecialData:

startSeq

Some devices rely on Seq for their data continuity and require that they be passed in when they are synchronized. If you get startSeq & endSeq in your device info is 0, this means your device does not need this seq, Please also 0 value as a parameter to synchronize data, which is ok, or you can use the method does not need to pass in this parameter

endSeq

Similar to startSeq.

Declared In

BLESolstice.h

– stopSpecialData: required method

! SDK internal use, do not need to use it

- (void)stopSpecialData:(SD_TYPE)sdType

Declared In

BLESolstice.h