Copy crpblelib-*.aar to the project's libs directory. If there is an old version of the aar package in it, please delete it.
Configure permissions in AndroidManifest.xml
x
Please declare the following components in the application tag
xxxxxxxxxx
Perform the following configuration when generating apk for code obfuscation
xxxxxxxxxx-keep class com.crrepa.ble.** { *; }
The following contains all the functions supported by the MoYoung Watch, and a certain watch only supports part of the functions. To find out if your watch supports a feature, contact us.
CRPBleClient is the entry point of the SDK. The client needs to maintain an instance of CRPBleClient. It is recommended to initialize CRPBleClient in Application.onCreate().
xxxxxxxxxxCRPBleClient bleClient = CRPBleClient.create(context);
Start scan
Normal scanning can be started with permission enabled and Bluetooth enabled. When the watch is found during scanning, it is called back by CRPScanCallback.onScanning(). After the scan is finished, all the watchs found during the scan are recalled by CRPScanCallback.onScanComplete(). The scan duration can be set in milliseconds. Because the Bluetooth scan operation is time-consuming, the recommended scan time is 10 seconds.
xxxxxxxxxxbleClient.scanDevice(scanCallback, 10 * 1000);
Cancel scan
Stop scanning while scanning, and canceling scanning also triggers CRPScanCallback.onScanComplete().
xxxxxxxxxxbleClient.cancelScan();
Connect
Get the Mac Address to the watch by scanning the CRPScanDevice of the callback. Connect to the watch via CRPBleDevice.connect() and callback state via CRPBleConnectionStateListener.onConnectionStateChange() . It is recommended to increase the appropriate delay when the reconnection is disconnected, so that the system can recover resources and ensure the connection success rate.
xxxxxxxxxxString address = CRPScanDevice.getDevice().getAddress();CRPBleDevice bleDevice = bleClient.getBleDevice(address);CRPBleConnection bleConnection = bleDevice.connect();bleConnection.setConnectionStateListener(bleConnectionStateListener);
Reconnect
There are two ways to reconnect:
New GATT connection (recommend)
xxxxxxxxxx// close GATT CRPBleConnection.close();// delay 3 secondsString address = CRPScanDevice.getDevice().getAddress();CRPBleDevice bleDevice = bleClient.getBleDevice(address);CRPBleConnection bleConnection = bleDevice.connect();bleConnection.setConnectionStateListener(bleConnectionStateListener);
Continue to connect
xxxxxxxxxxCRPBleConnection.connect();
Sync Time
Keep the watch and the phone in the same time.
xxxxxxxxxxbleConnection.syncTime();
Set Time System
Sets the time system of the watch.
xxxxxxxxxxbleConnection.sendTimeSystem(byte type);
CRPTimeSystemType:
TIME_SYSTEM_12 | TIME_SYSTEM_24 |
---|---|
12-Hour Time | 24-Hour Time |
Get Time System
Query the time system of the watch.
xxxxxxxxxxbleConnection.queryTimeSystem(CRPDeviceTimeSystemCallback callback);
Query firmware version
Query the current firmware version of the watch.
xxxxxxxxxxbleConnection.queryFrimwareVersion(CRPDeviceFirmwareVersionCallback);
Check firmware
Version is the current firmware version. The new firmware information is called back via CRPDeviceNewFirmwareVersionCallback.onNewFirmwareVersion().
xxxxxxxxxxbleConnection.checkFirmwareVersion(CRPDeviceNewFirmwareVersionCallback, version, CRPFirmwareUpgradeType);
CRPFirmwareUpgradeType:
NORMAL_UPGEADE_TYPE | BETA_UPGRADE_TYPE | FORCED_UPDATE_TYPE |
---|---|---|
Normal upgrade. Used for regular upgrades. | BETA upgrade. Used for internal testing version upgrades. | Forced upgrade. Generally not used, for major updates, forcing users to upgrade. |
CRPFirmwareVersionInfo:
version | changeNotes | changeNotesEn | type | mcu |
---|---|---|---|---|
Current firmware version number of the watch | change note | english change note | Upgrade type, same as CRPFirmwareUpgradeType | MCU type, used to distinguish upgrade mode |
Firmware upgrade
The chip firmware upgrade method of each platform is different, and the upgrade method of each platform is as follows.
Nordic/Goodix
Huntersun
The upgrade mode of Huntersun watch is different from the normal mode. It has a separate broadcast name and Mac address, and the Mac address is called back through CRPDeviceDfuAddressCallback. Before the upgrade, you need to query the Mac address of the firmware upgrade mode of the watch. You can save this Mac address and re-upgrade after the upgrade fails.
xxxxxxxxxxbleConnection.queryHsDfuAddress(CRPDeviceDfuAddressCallback);
After the watch enters the firmware upgrade mode, it will disconnect the Bluetooth connection from the normal mode, and initiate a firmware upgrade after the Bluetooth connection is disconnected. After the watch enters the firmware upgrade mode, it is not allowed to initiate a normal Bluetooth connection, which will cause the firmware upgrade to fail.
xxxxxxxxxxbleConnection.enableHsDfu();
The upgrade progress is called back through CRPBleFirmwareUpgradeListener. After the upgrade is successful, the watch will restart and return to the normal mode; after the upgrade fails, the firmware upgrade can be restarted.
xxxxxxxxxxHsDfuController hsDfuController = new HsDfuController();hsDfuController.setUpgradeListener(CRPBleFirmwareUpgradeListener);hsDfuController.setAddress(address);hsDfuController.start();
After the upgrade succeeds or fails, this interface can be called to exit the firmware upgrade process.
xxxxxxxxxxhsDfuController.abort();
Realtek
Sifli
Start upgrade
Unable to abort upgrade. The upgrade progress is called back through CRPBleFirmwareUpgradeListener. Please add in AndroidManifest:
xxxxxxxxxx
xxxxxxxxxxSifliDfuController controller = SifliDfuController.getInstance();controller.setUpgradeListener(CRPBleFirmwareUpgradeListener);controller.start(String address);
Start upgrade
The upgrade progress is called back through CRPBleFirmwareUpgradeListener. Please add in AndroidManifest:
xxxxxxxxxx
xxxxxxxxxxRtkDfuController controller = RtkDfuController.getInstance();controller.setUpgradeListener(new CRPBleFirmwareUpgradeListener());controller.start(String address);
Abort upgrade
xxxxxxxxxxcontroller.abort();
Query Huntersun dfu address
Enable Huntersun Dfu mode
Start upgrade
Abort upgrade
Start upgrade
The upgrade progress is called back through CRPBleFirmwareUpgradeListener.
xxxxxxxxxxbleConnection.startFirmwareUpgrade(isGoodix, CRPBleFirmwareUpgradeListener);
Abort upgrade
After the upgrade succeeds or fails, this interface can be called to exit the firmware upgrade process.
xxxxxxxxxxbleConnection.abortFirmwareUpgrade();
Query DFU status
Check whether the watch is in the DFU data transmission state. In the new firmware, the watch will restart multiple times during the DFU process. When the watch is in the DFU state, avoid sending other commands to the watch. The result is called back via CRPDeviceDfuStatusCallback.onDeviceDfuStatus().
xxxxxxxxxxbleConnection.queryDeviceDfuStatus(CRPDeviceDfuStatusCallback);
CRPDeviceDfuStatusCallback
DEVICE_STATUS_NORMAL | DEVICE_STATUS_DFU |
---|---|
Normal | DFU |
Query the current battery of the watch. When the battery level of the watch exceeds 100, it means the watch is charging.
xxxxxxxxxxbleConnection.queryDeviceBattery();
Set up the watch battery listener.
xxxxxxxxxxbleConnection.setDeviceBatteryListener(CRPDeviceBatteryListener);
Subscription battery
When the battery of the watch changes, it will be called back through CRPDeviceBatteryListener.onDeviceBattery(battery).
xxxxxxxxxxbleConnection.subscribeDeviceBattery();
Set user information
Set the user's personal information to the watch.
xxxxxxxxxxbleConnection.sendUserInfo(CRPUserInfo);
CRPUserInfo:
weight | height | gender | age |
---|---|---|---|
Weight (used to calculate calories) | Height (used to calculate the distance of the activity) | Gender (used to measure blood pressure or blood oxygen) | Age (for measuring blood pressure or blood oxygen) |
Set steps length
In the watch firmware 1.6.6 and above, you can set the step length to the watch to calculate the activity data more accurately.
xxxxxxxxxxbleConnection.sendStepLength(length);
Today's weather
Set the weather today to the watch.
xxxxxxxxxxbleConnection.sendTodayWeather(CRPTodayWeatherInfo);
CRPTodayWeatherInfo:
city | lunar | festival | pm25 | temp | weatherId |
---|---|---|---|---|---|
City | Lunar Festival (not necessary) | festival(not necessary) | PM2.5 | Real-time temperature | Weather status |
CRPWeatherId:
CLOUDY | FOGGY | OVERCAST | RAINY | SNOWY | SUNNY | SANDSTORM | HAZE |
---|---|---|---|---|---|---|---|
partly cloudy | fog | overcast | rainy | snowy | sunny | sandstorm | haze |
Weather in the next 7 days
Set the weather for the next 7 days to the watch.
xxxxxxxxxxbleConnection.sendFutureWeather(CRPFutureWeatherInfo);
CRPFutureWeatherInfo.FutureBean:
weatherId | lowTemperature | highTemperature |
---|---|---|
Weather status | lowest temperature | Maximum temperature |
Weather listener
The watch can save real-time weather for 2 hours, and the weather information will be cleared after 2 hours. When the watch has no weather information today, when the watch switches to the weather interface, the weather is reset by CRPWeatherChangeListener.onUpdateWeather().
xxxxxxxxxxbleConnection.setWeatherChangeListener(CRPWeatherChangeListener);
Set steps listeners
All activity-related data is called back through the CRPStepChangeListener.
xxxxxxxxxxbleConnection.setStepChangeListener(CRPStepChangeListener);
Query today's steps
Get the number of steps today, and the result is called back by CRPActionChangeListener.onStepChange().
xxxxxxxxxxbleConnection.syncStep();
CRPStepInfo:
steps | distance | calories | time |
---|---|---|---|
steps | Distance (in meters) | Calories (units of kilocalories) | Activity duration, (the default value is 0, which means the watch does not support) |
Query history steps
The watch can save the number of active steps in the last three days, and can query the number of active steps in a given day. The result is called back via CRPStepChangeListener.onHistoryStepChange().
xxxxxxxxxx// Sifli watches support the history of the last 7 days, while other watches only support the last three days. It is recommended to query the next one after querying the callback in the previous day.bleConnection.queryHistoryStep(CRPHistoryDay);
Set steps category listener
The step count data is called back via the CRPStepsCategoryChangeListener.
xxxxxxxxxxbleConnection.setStepsCategoryListener(CRPStepsCategoryChangeListener);
Query steps category
Some watchs support the classification statistics for the last two days. The result is called back by CRPStepsCategoryChangeListener.onStepsCategoryChange().
xxxxxxxxxxbleConnection.queryStepsCategory(CRPStepsCategoryDateType);
Set sleep listener
All sleep related data is called back via CRPSleepChangeListener.
xxxxxxxxxxbleConnection.setSleepChangeListener(CRPSleepChangeListener);
Query today's sleep
Get today's sleep data, the result is called back by CRPSleepChangeListener.onSleepChange(). The watch sleep clear time is 8:00 pm, and the watch records the sleep time period from 8:00 pm to 10:00 am the next day.
xxxxxxxxxxbleConnection.syncSleep();// added rem sleep statebleConnection.syncRemSleep();
CRPSleepInfo:
totalTime | restfulTime | lightTime | soberTime | SLEEP_STATE_RESTFUL | SLEEP_STATE_LIGHT | SLEEP_STATE_SOBER | SLEEP_STATE_REM | remTime |
---|---|---|---|---|---|---|---|---|
Total sleep time | restful time | light time | awake time | restful | light sleep | awake | rem sleep | rem sleep time |
CRPSleepInfo.DetailBean:
startTime | endTime | totalTime | type |
---|---|---|---|
start time | end time | total time | sleep state |
Query history sleep
The watch can save sleep data for the last three days and can query the sleep data for a given day. The result is called back by CRPSleepChangeListener.onPastSleepChange().
xxxxxxxxxxbleConnection.queryHistorySleep(CRPHistoryDay);// added rem sleep statebleConnection.queryHistoryRemSleep(CRPHistoryDay);
Set the unit system
xxxxxxxxxxbleConnection.sendMetricSystem(CRPMetricSystemType);
CRPMetricSystemType:
METRIC_SYSTEM | IMPERIAL_SYSTEM |
---|---|
METRIC | IMPERIAL |
Query the unit system
xxxxxxxxxxbleConnection.queryMetricSystem(CRPDeviceMetricSystemCallback callback);
Set the quick view state
Turns the quick view on or off.
xxxxxxxxxxbleConnection.sendQuickView(state);
Query the quick view state
The result is called back via CRPDeviceQuickViewCallback.onQuickView().
xxxxxxxxxxbleConnection.queryQuickView(CRPDeviceQuickViewCallback);
Set the effective time for quick view
The watch supports the effective period of quick view, and the ban bright screen is effective only when the watch is illuminated.
xxxxxxxxxxbleConnection.sendQuickViewTime(CRPPeriodTimeInfo);
Get the effective time for quick view
Check the effective time period of quick view set by the watch. The result is called back by CRPDevicePeriodTimeCallback.onPeriodTime().
xxxxxxxxxxbleConnection.queryQuickViewTime(CRPDevicePeriodTimeCallback);
Set goal steps
Push the user's target step number to the watch. When the number of active steps reaches the target step, the watch will have a target to reach the reminder.
xxxxxxxxxxbleConnection.sendGoalSteps(steps)
Get goal steps
Query the target number of steps in the watch, and the result is called back by CRPDeviceGoalStepCallback.onGoalStep().
xxxxxxxxxxbleConnection.queryGoalStep(CRPDeviceGoalStepCallback);
Set daily goals
The daily goal is to set a goal value for each day.
xxxxxxxxxxbleConnection.sendDailyGoals(CRPDailyGoalsInfo);
CRPDailyGoalsInfo:
steps | calories | trainingTime | distance |
---|---|---|---|
The goal steps | The goal calories(unit:Kcal) | The goal distance time(unit:minute) | The goal distance |
Query daily goals
Callback via CRPDailyGoalsCallback.onDailyGoals() .
xxxxxxxxxxbleConnection.queryDailyGoals(CRPDailyGoalsCallback);
Set training day goals
The training day is to identify a certain day as an training day, and the goal value can be set separately, and the goal value of the training day will override the daily goal value.
xxxxxxxxxxbleConnection.sendTrainingDayGoals(CRPDailyGoalsInfo);
Query training day goals
Callback via CRPTrainingDayGoalsCallback.onTrainingDayGoals() .
xxxxxxxxxxbleConnection.queryTrainingDayGoals(CRPTrainingDayGoalsCallback);
Set training day
xxxxxxxxxxbleConnection.sendTrainingDays(CRPTrainingDayInfo);
CRPTrainingDayInfo:
enable | trainingDays |
---|---|
ture is enable; otherwise vice versa | The training day, same alarm |
Query training day
Callback via CRPTrainingDayGoalsCallback.onTrainingDays() .
xxxxxxxxxxbleConnection.queryTrainingDay(CRPTrainingDayGoalsCallback);
Set display watch face index
The watch supports a variety of different watch face, which can be switched freely.
xxxxxxxxxx// The index of the built-in watch face starts from 1 and increases sequentially. The index of the download dial is after the built-in watch face.bleConnection.sendDisplayWatchFace(byte index);
Query display watch face index
Query the index of the watch face being used by the watch, and the result is called back through CRPDeviceWatchFacesCallback.onDisplayWatchFace().
xxxxxxxxxxbleConnection.queryDisplayWatchFace(CRPDeviceDisplayWatchFaceCallback);
Query the watch face layout
Query the watch watchface layout information, and the result is called back by CRPDeviceWatchFaceLayoutCallback.onWatchFaceLayoutChange().
xxxxxxxxxxbleConnection.queryWatchFaceLayout(CRPDeviceWatchFaceLayoutCallback);
CRPWatchFaceLayoutInfo:
timePosition | timeTopContent | timeBottomContent | textColor | backgroundPictureMd5 | height | width | thumHeight | thumWidth | compressionType |
---|---|---|---|---|---|---|---|---|---|
time position | content displayed above time | content displayed below time | font color(RGB) | The background image MD5 has a length of 32 bits. When padded with 0, the background image restores the default background. | The watch face height, default 240 px. | The watch face width, default 240 px. | The thum watch face height, The default is 0, which means it is not supported | The thum watch face width,The default is 0, which means it is not supported | The compression type(LZO, RGB_DEDUPLICATION, RGB_LINE, SIFLI, ORIGINAL) |
CRPWatchFaceLayoutType:
WATCH_FACE_TIME_TOP | Time is at the top right |
---|---|
WATCH_FACE_TIME_BOTTOM | Time is at the bottom right |
WATCH_FACE_CONTENT_CLOSE | Do not display anything |
WATCH_FACE_CONTENT_DATE | Date |
WATCH_FACE_CONTENT_SLEEP | Sleep |
WATCH_FACE_CONTENT_HEART_RATE | Heart Rate |
WATCH_FACE_CONTENT_STEP | Steps |
Set the watchface layout
xxxxxxxxxxbleConnection.sendWatchFaceLayout(CRPWatchFaceLayoutInfo);
Set watch face background
The dial of the 1.3-inch color screen supports the replacement of the background image with a picture size of 240 * 240 px. Compressed indicates whether the picture needs to be compressed (the watch with the master control of 52840 does not support compression and is fixed to false); timeout indicates the timeout period, in seconds. The replacement progress is called back through the CRPWatchFaceSwitchListener.
xxxxxxxxxxbleConnection.sendWatchFaceBackground(CRPWatchFaceBackgroundInfo, CRPFileTransListener)
CRPWatchFaceBackgroundInfo:
bitmap | thumBitmap | type | timeout |
---|---|---|---|
The bitmap of background image | The bitmap of thumbnail | CRPWatchFaceLayoutInfo.CompressionType | Transmission timeout(unit: TimeUnit.SECONDS). 30 seconds by default. |
Abort watch face background
Abort transfer during watch face background image transfer.
xxxxxxxxxxbleConnection.abortWatchFaceBackground();
Get support watch face type
Some watchs add a new watch face to query the supported watch face types. The result is called back by CRPDeviceSupportWatchFaceCallback.onSupportWatchFace().
xxxxxxxxxxbleConnection.querySupportWatchFace(CRPDeviceSupportWatchFaceCallback);
CRPSupportWatchFaceInfo:
displayWatchFace | supportWatchFaceList |
---|---|
The watchface id | The support watchface type list, used to get the watch faces available on the server |
Get the watch face store
According to the watch face type supported by the watch, obtain a list of watch faces that the watch can be replaced. The result is called back via CRPDeviceWatchFaceStoreCallback.onWatchFaceStoreChange().
xxxxxxxxxxbleConnection.queryWatchFaceStore(List list, String firmwareVersion, int pageCount, int pageIndex, CRPDeviceWatchFaceStoreCallback callback);
Get the list of available watch faces by way of paging query.
Get the watch face information of the watch face Id
Gets the watchface information of the watchface ID, and the result is called back by CRPDeviceWatchFaceCallback.onWatchFaceChange().
xxxxxxxxxxbleConnection.queryWatchFaceOfID(id, CRPDeviceWatchFaceCallback);
Send download watch face
Send the watchface file of the new watchface to the watch, during which the watch will restart. The transfer progress is called back by CRPWatchFaceTransListener.
xxxxxxxxxxbleConnection.sendWatchFace(CRPWatchFaceInfo info, CRPFileTransListener listener, timeout);
CRPWatchFaceInfo:
file | type |
---|---|
The watch face file | WacthFaceType |
Abort Download watch face
xxxxxxxxxxbleConnection.abortWatchFace();
Delete Download watch face
The Sifli watch supports deleting the watch face, and the deletion result is called back through CRPWatchFaceDeleteCallback.
xxxxxxxxxxbleConnection.deleteWatchFace(int id, CRPWatchFaceDeleteCallback callback);
Query the available storage space of the watch
Query the available storage space of the Siche watch to determine whether the watch can download new dials. Via the CRPAvailableStorageCallback.onAvailableSize() callback.
xxxxxxxxxxbleConnection.queryAvailableStorage(CRPAvailableStorageCallback);
Some watches support the new version of the alarm clock (up to 8 alarm clocks, which can be deleted), and other watches only support the old version of the alarm clock (3 fixed alarm clocks, which cannot be deleted).
Set alarm(old version)
The watch supports three alarm clocks, and the alarm information can be set separately according to the alarm number. A single alarm supports setting the date.
xxxxxxxxxxbleConnection.sendAlarm(CRPAlarmInfo)
CRPAlarmInfo:
id | hour | minute | repeatMode | enable |
---|---|---|---|---|
The alarm id | hour (24-hour format) | minute | Repeat mode(For example, repeat on Monday and Tuesday, repeatMode = MONDAY + TUESDAY) | enable |
Alarm id:
FIRST_CLOCK | SECOND_CLOCK | THIRD_CLOCK |
---|---|---|
First alarm clock | Second alarm clock | Third alarm clock |
Repeat mode:
SINGLE | SUNDAY | MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | EVERYDAY |
---|---|---|---|---|---|---|---|---|
Single, only valid today. | Repeat on Sunday | Repeat on Monday | Repeat on Tuesday | Repeat on Wednesday | Repeat on Thursday | Repeat on Friday | Repeat on Saturday | Everyday |
Query all alarm(old version)
Query the alarm information saved by the watch, and the result is called back by CRPAlarmCallback.onAlarmList().
xxxxxxxxxxbleConnection.queryAllAlarm(CRPAlarmCallback);
Set alarm(new version)
The alarm index cannot exceed 8.
xxxxxxxxxxbleConnection.sendNewAlarm(CRPAlarmInfo info);
Delete alarm(new version)
xxxxxxxxxx// Delete the alarm with the specified indexbleConnection.deleteNewAlarm(int id);
Delete all alarm(new version)
xxxxxxxxxxbleConnection.deleteAllNewAlarm();
Query all alarm(new version)
Callback via CRPAlarmCallback.onNewAlarmList().
xxxxxxxxxxbleConnection.queryAllNewAlarm(CRPAlarmCallback callback);
Set the watch version
The watch is divided into Chinese and international versions. The Chinese version only supports Simplified Chinese. The international version supports multiple languages and traditional Chinese.
xxxxxxxxxxbleConnection.sendDeviceVersion(CRPDeviceVersionType);
CRPDeviceVersionType:
CHINESE_EDITION | INTERNATIONAL_EDITION |
---|---|
Chinese Edition | International Edition |
Get the watch version
Query the version that the watch is using, and the result is called back by CRPDeviceVersionCallback.onDeviceVersion().
xxxxxxxxxxbleConnection.queryDeviceVersion(CRPDeviceVersionCallback);
Set the watch language
Set the language of the watch.
xxxxxxxxxxbleConnection.sendDeviceLanguage(CRPDeviceLanguageType);
CRPDeviceLanguageType:
LANGUAGE_ENGLISH | LANGUAGE_CHINESE | LANGUAGE_JAPANESE | LANGUAGE_KOREAN | LANGUAGE_GERMAN | LANGUAGE_FRENCH | LANGUAGE_SPANISH | LANGUAGE_ARABIC | LANGUAGE_RUSSIAN | LANGUAGE_TRADITIONAL | LANGUAGE_UKRAINIAN | LANGUAGE_ITALIAN | LANGUAGE_PORTUGUESE |
---|---|---|---|---|---|---|---|---|---|---|---|---|
English | Chinese Simplified | Japanese | Korean | German | French | Spanish | Arabic | Russian | traditional Chinese | Ukrainian | Italian | Portuguese |
Note: Italian and Portuguese only support watch firmware 1.7.1 and above.
Get the watch language
Query the language that the watch is using and the list of languages supported by the watch. The result is called back by CRPDeviceLanguageCallback.onDeviceLanguage(int type, int[] languageArray).
type | languageArray |
---|---|
The type of language being used | The List of all language types supported by the watch |
xxxxxxxxxxbleConnection.queryDeviceLanguage(CRPDeviceLanguageCallback);
Set other message
Turn on or off other message.
xxxxxxxxxxbleConnection.sendOtherMessageState(state);
Get other message
Query other message enable status, and the result is called back by CRPDeviceOtherMessageCallback.onOtherMessage().
xxxxxxxxxxbleConnection.queryOtherMessageState(CRPDeviceOtherMessageCallback);
Send message
Send various types of message content to the watch.
xxxxxxxxxxbleConnection.sendMessage(CRPMessageInfo);
CRPMessageInfo:
message | type | versionCode | isHs | isSmallScreen |
---|---|---|---|---|
Message content | Message type(CRPBleMessageType) | Firmware version (for example: MOY-AA2-1.7.6, which is 176) | Whether the MCU is HS, please confirm the MCU type with us. | Is the watch screen smaller than 1 inch |
CRPBleMessageType:
MESSAGE_PHONE | phone |
---|---|
MESSAGE_SMS | SMS |
MESSAGE_WECHAT | WeChat (Chinese Edition) |
MESSAGE_QQ | |
MESSAGE_FACEBOOK | |
MESSAGE_TWITTER | |
MESSAGE_WHATSAPP | |
MESSAGE_WECHAT_IN | WeChat (International Edition) |
MESSAGE_INSTAGREM | INSTAGREM |
MESSAGE_SKYPE | SKYPE |
MESSAGE_KAKAOTALK | KAKAOTALK |
MESSAGE_LINE | LINE |
MESSAGE_OTHER | Other |
End call
When the watch receives a phone type message push, the watch will vibrate for a fixed time. Call this interface to stop the watch vibration when the watch is connected or the phone is hung up.
xxxxxxxxxxbleConnection.sendCall0ffHook();
Set call number listener
Watches that support calls can make calls on the watch, and the outgoing phone number can be obtained through CRPCallNumberListener.onCallNumber().
xxxxxxxxxxbleConnection.setCallNumberListener(CRPCallNumberListener);
Set call contact name
Send the name of the outgoing contact, and the incoming contact still uses sendMessage.
xxxxxxxxxxbleConnection.sendCallContactName(name);
Query the list of messages supported by the watch
Some watches have a built-in list of supported App messages. Callback via CRPMessageListCallback.onMessageList() .
xxxxxxxxxx// See CRPBleMessageType for the message typebleConnection.queryMessageList(CRPMessageListCallback);
Set sedentary reminder state
Turn the sedentary reminder on or off.
xxxxxxxxxxbleConnection.sendSedentaryReminder(state);
Query sedentary reminder state
Query the sedentary reminder status, and the result is called back by CRPDeviceSedentaryReminderCallback.onSedentaryReminder().
xxxxxxxxxxbleConnection.querySedentaryReminder(CRPDeviceSedentaryReminderCallback);
Set sedentary reminder time
Set a valid period for sedentary reminders.
xxxxxxxxxxbleConnection.sendSedentaryReminderPeriod(CRPSedentaryReminderPeriodInfo);
CRPRemindersToMovePeriodInfo:
period | steps | startHour | endHour |
---|---|---|---|
Sedentary reminder period (unit: minute) | Maximum number of steps | Start time (24-hour clock) | End time (24-hour clock) |
Get sedentary reminder time
Query the watch for sedentary reminder valid period, the result is called back by CRPDeviceRemindersToMovePeriodCallback.onSedentaryReminderPeriod().
xxxxxxxxxxbleConnection.querySedentaryReminderPeriod(CRPDeviceSedentaryReminderPeriodCallback);
Look for the watch and the watch will vibrate for a few seconds after receiving this command.
xxxxxxxxxxbleConnection.findDevice();
Set heart rate listener
All heart rate related data will be called back via CRPHeartRateChangeListener.
xxxxxxxxxxbleConnection.setHeartRateChangeListener(CRPHeartRateChangeListener);
Query last dynamic heart rate measurement
The dynamic heart rate is measured in an unconnected state and the watch can save the last measurement. The result is called back by CRPHeartRateChangeListener.onMeasureComplete().
xxxxxxxxxxbleConnection.queryLastDynamicRate(CRPHistoryDynamicRateType);
CRPHeartRateInfo:
startMeasureTime | measureData | timeInterval | heartRateType |
---|---|---|---|
Start time (in milliseconds) | Heart rate measurements, a single data representing the average 2 heart rate over the measurement interval. | Time interval of heart rate measurement data (in minutes) | Heart rate data type |
HeartRateType:
PART_HEART_RATE | TODAY_HEART_RATE | YESTERDAY_HEART_RATE |
---|---|---|
Action heart rate | Today heart rate | Yesterday heart rate |
Enable timing to measure heart rate
The watch supports 24-hour timed measurement of heart rate, starting from 0:00, you can set the measurement interval, the time interval is a multiple of 5 minutes.
xxxxxxxxxx// The measurement interval = interval * 5 minutesbleConnection.enableTimingMeasureHeartRate(interval);
Disable timing to measure heart rate
Turn off the timing to measure the heart rate.
xxxxxxxxxxbleConnection.disableTimingMeasureHeartRate();
Query timing to measure heart rate status
The query timing measures the heart rate on state, and the result is called back by CRPDeviceTimingMeasureHeartRateCallback.onTimingMeasure().
xxxxxxxxxxbleConnection.queryTimingMeasureHeartRate(CRPDeviceTimingMeasureHeartRateCallback);
Query today's heart rate measurement data
Today's heart rate measurement is divided into two types, which are obtained according to the measurement method supported by the corresponding watch. The result is called back by CRPHeartRateChangeListener.on24HourMeasureResult().
xxxxxxxxxxbleConnection.queryTodayHeartRate(CRPHeartRateType);
CRPHeartRateType:
TIMING_MEASURE_HEART_RATE | ALL_DAY_HEART_RATE |
---|---|
Timed heart rate measurement | 24-hour continuous measurement |
Query history heart rate
Query the heart rate data of the previous day, and the result is called back by CRPHeartRateChangeListener.on24HourMeasureResult().
xxxxxxxxxxbleConnection.queryHistoryTimingHeartRate(CRPHistoryDay)
Query Action data
Some watchs support heart rate measurement in a variety of motion modes. The measurements include other motion-related data such as heart rate and calories. This interface is used to obtain data such as calories. The watch can save the last three sports data. Supporting 24-hour continuous measurement of the watch, the exercise heart rate can be obtained from the 24-hour heart rate data according to the movement up time; other watch exercise heart rate and dynamic heart rate acquisition methods are consistent.
xxxxxxxxxxbleConnection.queryMovementHeartRate();
CRPMovementHeartRateInfo:
type | startTime | endTime | validTime | steps | distance | calories |
---|---|---|---|---|---|---|
Sport mode | Start time (unit: milliseconds) | End time (unit: milliseconds) | Effective duration of exercise (unit: second) | Number of steps (partial motion mode is not supported) | Active distance (partial motion mode is not supported) | Calories |
Sport mode:
WALK_TYPE | RUN_TYPE | BIKING_TYPE | ROPE_TYPE | BADMINTON_TYPE | BASKETBALL_TYPE | FOOTBALL_TYPE | SWIM_TYPE |
---|---|---|---|---|---|---|---|
Walking | Run | bicycle | rope skipping | badminton | basketball | football | Swim |
Start measure once heart rate
Start measuring a single heart rate and the result is called back by CRPHeartRateChangeListener.onOnceMeasureComplete().
xxxxxxxxxxbleConnection.startMeasureOnceHeartRate();
Stop measure once heart rate
End a once measurement. A measurement time that is too short will result in no measurement data.
xxxxxxxxxxbleConnection.stopMeasureOnceHeartRate();
Query history once heart rate
Call back through CRPHeartRateChangeListener.onHistoryHeartRate(List
xxxxxxxxxxbleConnection.queryHistoryHeartRate();
Set blood pressure listener
All blood pressure related data will be recalled via CRPBloodPressureChangeListener.
xxxxxxxxxxbleConnection.setBloodPressureChangeListener(CRPBloodPressureChangeListener);
Start measure blood pressure
Start measuring blood pressure.
xxxxxxxxxxbleConnection.startMeasureBloodPressure();
Stop measure blood pressure
Stop measuring blood pressure, too short a measurement time will result in no measurement results. The measurement results are called back via CRPBloodPressureChangeListener.onBloodPressureChange().
xxxxxxxxxxbleConnection.stopMeasureBloodPressure();
Enable continue blood pressure
xxxxxxxxxxbleConnection.enableContinueBloodPressure();
Disable continue blood pressure
xxxxxxxxxxbleConnection.disableContinueBloodPressure();
Query continue blood pressure state
Call back through CRPBloodPressureChangeListener.onContinueState(boolean state).
xxxxxxxxxxbleConnection.queryContinueBloodPressureState();
Query last 24 hour blood pressure
Call back through CRPBloodPressureChangeListener.onContinueBloodPressure(CRPBloodPressureInfo info);
xxxxxxxxxxbleConnection.queryLast24HourBloodPressure();
Query history once blood pressure
Call back through CRPBloodPressureChangeListener.onHistoryBloodPressure();
xxxxxxxxxxbleConnection.queryHistoryBloodPressure();
Set blood oxygen listener
All blood oxygen related data will be called back via CRPBloodOxygenChangeListener.
xxxxxxxxxxbleConnection.setBloodOxygenChangeListener(CRPBloodOxygenChangeListener);
Start Measure blood oxygen
Start measuring blood oxygen.
xxxxxxxxxxbleConnection.startMeasureBloodOxygen();
Stop measure blood oxygen
Stop measuring blood oxygen, too short a measurement time will result in no measurement results. The result is called back by CRPBloodOxygenChangeListener.onBloodOxygenChange().
xxxxxxxxxxbleConnection.stopMeasureBloodOxygen();
Enable timing measure blood oxygen
xxxxxxxxxx// The measurement interval = interval * 5 minutesbleConnection.enableTimingMeasureBloodOxygen(int interval);
Disable timing measure blood oxygen
xxxxxxxxxxbleConnection.disableTimingMeasureBloodOxygen();
Query timing measure blood oxygen state
Call back through CRPBloodOxygenChangeListener.onTimingMeasure(int interval);
xxxxxxxxxxbleConnection.bleConnection.queryTimingBloodOxygenMeasureState();
Query timing blood oxygen
Call back through CRPBloodOxygenChangeListener.onContinueBloodOxygen(CRPBloodOxygenInfo info);
xxxxxxxxxxbleConnection.queryTimingBloodOxygen(CRPBloodOxygenTimeType timeType);
Enable continue blood oxygen
xxxxxxxxxxbleConnection.enableContinueBloodOxygen();
Disable continue blood oxygen
xxxxxxxxxxbleConnection.disableContinueBloodOxygen();
Query continue blood oxygen state
Call back through CRPBloodOxygenChangeListener.onContinueState(boolean state);
xxxxxxxxxxbleConnection.queryContinueBloodOxygenState();
Query last 24 hour blood oxygen
Call back through CRPBloodOxygenChangeListener.onContinueBloodOxygen(CRPBloodOxygenInfo info);
xxxxxxxxxxbleConnection.queryLast24HourBloodOxygen();
Query history once blood oxygen
Call back through CRPBloodOxygenChangeListener.onHistoryBloodOxygen();
xxxxxxxxxxbleConnection.queryHistoryBloodOxygen();
Enable camera view
xxxxxxxxxxbleConnection.enterCameraView();
Exit camera view
xxxxxxxxxxbleConnection.exitCameraView();
Set photo monitor
Long press the watch photo interface, you can trigger the camera's camera command, callback through CRPCameraOperationListener.onTakePhoto ().
xxxxxxxxxxbleConnection.setCameraOperationListener(CRPCameraOperationListener);
The watch can issue commands such as music control and hang up calls, and callbacks via CRPPhoneOperationListener.onOperationChange().
xxxxxxxxxxbleConnection.setPhoneOperationListener(CRPPhoneOperationListener);
CRPPhoneOperationType:
MUSIC_PLAY_OR_PAUSE | MUSIC_PREVIOUS | MUSIC_NEXT | REJECT_INCOMING | VOLUME_UP | VOLUME_DOWN | MUSIC_PLAY | MUSIC_PAUSE |
---|---|---|---|---|---|---|---|
Play / Pause | Previous | Next | Hang up the phone. You can press and hold the trigger on the call alert interface. | Turn up the volume | Turn down the volume | Play | Pause |
Set RSSI listening
The watch RSSI is read and the result is called back by CRPDeviceRssiListener.onDeviceRssi().
xxxxxxxxxxbleConnection.setDeviceRssiListener(CRPDeviceRssiListener);
Read the watch RSSI
Read the real-time RSSI value of the watch.
xxxxxxxxxxbleConnection.readDeviceRssi();
The watch is turned off.
xxxxxxxxxxbleConnection.shutDown();
Set the do not disturb time
The watch supports the Do Not Disturb period. Do not display message push and sedentary reminders during the time.
xxxxxxxxxxbleConnection.sendDoNotDistrubTime(CRPPeriodTimeInfo);
CRPPeriodTimeInfo:
startHour | startMinute | endHour | endMinute |
---|---|---|---|
Start time hours (24-hour clock) | Start time minutes | End time hours (24-hour clock) | End time minutes |
Get the do not disturb time
Check the do not disturb time set by the watch. The result is called back by CRPDevicePeriodTimeCallback.onPeriodTime().
xxxxxxxxxxbleConnection.queryDoNotDistrubTime(CRPDevicePeriodTimeCallback);
CRPDevicePeriodTimeCallback:
DO_NOT_DISTRUB_TYPE | QUICK_VIEW_TYPE |
---|---|
Do not disturb | Quick view |
Set the breathing light
Some watchs support breathing lights and turn the breathing lights on or off.
xxxxxxxxxxbleConnection.sendBreathingLight(enable);
Get the status of the breathing light
Check the watch breathing light on. The result is called back via CRPDeviceBreathingLightCallback.onBreathingLight().
xxxxxxxxxxbleConnection.queryBreathingLight(CRPDeviceBreathingLightCallback);
Set ECG listener
All ECG related data will be recalled via CRPBleECGChangeListener.
xxxxxxxxxxbleConnection.setECGChangeListener(CRPBleECGChangeListener);
Measuring ECG
Start measuring ECG. The ECG measurement time is 30S, and the user needs to touch the left and right electrodes of the watch with both hands. ECG measurement data is retraced during CRPBleECGChangeListener.onECGChange().
xxxxxxxxxxbleConnection.startECGMeasure();
Stop measuring ECG
Used to actively stop ECG measurement during ECG measurement.
xxxxxxxxxxbleConnection.stopECGMeasure();
Detect new ECG measurement methods
In the new measurement mode, the watch can save the last unsent measurement result; the old version does not.
xxxxxxxxxxboolean newMeasurementVersion = bleConnection.isNewECGMeasurementVersion();
Get the last ECG data
Query the ECG data saved by the watch, and the result is called back by CRPBleECGChangeListener.onECGChange().
xxxxxxxxxxbleConnection.queryLastMeasureECGData();
Send heart rate during ECG measurement
Using the data obtained by the measurement, the instantaneous heart rate is calculated by the ECG algorithm library and sent to the watch.
xxxxxxxxxxbleConnection.sendECGHeartRate(heartRate);
Set the physiological cycle reminder
Some watch support the female physiological cycle reminder, set or turn off the physiological cycle reminder.
xxxxxxxxxxbleConnection.sendPhysiologcalPeriod(CRPPhysiologcalPeriodInfo);
CRPPhysiologcalPeriodInfo:
physiologcalPeriod | menstrualPeriod | startDate | menstrualReminder | ovulationReminder | ovulationDayReminder | ovulationEndReminder | reminderHour | reminderMinute |
---|---|---|---|---|---|---|---|---|
Physiological cycle (unit: day) | Menstrual period (unit: day) | Start date of this physiological cycle | Menstruation begins to remind (the day before the menstrual period reminder) | Ovulation reminder (reminder the day before ovulation) | Ovulation Day Reminder (Reminder on the day before ovulation) | Reminder at the end of the ovulation period (a reminder one day before the end of the ovulation day) | Reminder time (hours, 24 hours) | Reminder time (minutes) |
Query physiological cycle reminder
Query the reminder information of the physiological cycle that has been saved in the watch. The result is called back via CRPDevicePhysiologcalPeriodCallback.
xxxxxxxxxxbleConnection.queryPhysiologcalPeriod(CRPDevicePhysiologcalPeriodCallback);
Set find phone listener
xxxxxxxxxxbleConnection.setFindPhoneListener(CRPFindPhoneListener);
Start find phone
After receiving the callback to find the mobile phone for the bracelet, the APP can vibrate and play the ringtone reminder, and you can reply to the bracelet by this command. Some bracelets support this command.
xxxxxxxxxxbleConnection.startFindPhone();
End finding phone
When the user retrieves the phone, the vibrating and ringing reminder ends, and the bracelet can be returned by this command. Some bracelets support this command.
xxxxxxxxxxbleConnection.stopFindPhone();
Set player state
Some bracelets can show that the music player is playing or paused.
xxxxxxxxxxbleConnection.setMusicPlayerState(CRPMusicPlayerStateType);
CRPMusicPlayerStateType:
MUSIC_PLAYER_PAUSE | MUSIC_PLAYER_PLAY |
---|---|
pause | play |
Set song name
Some bracelets can display information about the song being played.
xxxxxxxxxxbleConnection.sendSongTitle(title);
Set lyrics
xxxxxxxxxxbleConnection.sendLyrics(String lyrics);
Close Music Control
xxxxxxxxxxbleConnection.closeMusicControl();
Set max volume
xxxxxxxxxxbleConnection.sendCurrentVolume(int volume);
Set Current volume
xxxxxxxxxxbleConnection.sendMaxVolume(int volume);
Set drinking reminder
Set information such as the start time of drinking reminders.
xxxxxxxxxxbleConnection.sendDrinkWaterReminder(CRPDrinkWaterPeriodInfo);
CRPDrinkWaterPeriodInfo:
enable | startHour | startMinute | count | period | currentCups |
---|---|---|---|---|---|
enable | hours | minutes | reminders | reminder interval | the current water intake |
Query drinking reminder
Query the current drinking reminder information of the bracelet. The result is called back through CRPDeviceDrinkWaterPeriodCallback.onDrinkWaterPeriod(CRPDrinkWaterPeriodInfo).
xxxxxxxxxxbleConnection.queryDrinkWaterReminderPeriod(CRPDeviceDrinkWaterPeriodCallback);
Set the heart rate alarm value
Sets the heart rate alarm status and alarm heart rate value.
xxxxxxxxxxbleConnection.setMaxHeartRate(heartRate, enable);
Query the heart rate alarm value
Query the status of the bracelet heart rate alarm and the heart rate alarm value. The result is called back by CRPDeviceMaxHeartRateCallback.onHeartRate(heartRate, enable).
xxxxxxxxxxbleConnection.queryMaxHeartRate(CRPDeviceMaxHeartRateCallback);
Start training
Some bracelets support instructions to turn on the training mode. type is the same as CRPMovementHeartRateInfo.type.
xxxxxxxxxxbleConnection.startMovement(type);
Sets training state
Training is divided into three states, pause, continue and end.
xxxxxxxxxxbleConnection.setMovementState(CRPMovementHeartRateStateType);
CRPMovementHeartRateStateType:
MOVEMENT_PAUSE | MOVEMENT_CONTINUE | MOVEMENT_COMPLETE |
---|---|---|
pause | continue | complete |
Monitor training state
The training state can also be modified on the bracelet, and the measurement state can be obtained in time through CRPMovementStateListener.onMeasureState().
xxxxxxxxxxbleConnection.setMovementStateListener(CRPMovementStateListener);
Set training listener
xxxxxxxxxxbleConnection.setTrainingListener(CRPTrainingChangeListener listener);
Query History Training
Query the training records stored in the watch.The query results will be delivered through CRPTrainingChangeListener.onHistoryTrainingChange(List
xxxxxxxxxxbleConnection.queryHistoryTraining();
Query Training Detail
Query the detail data of a certain training. The query results will be delivered through CRPTrainingChangeListener.onTrainingChange(CRPTrainingInfo info).
xxxxxxxxxx// onHistoryTrainingChange(List list) // id is the index of the list.bleConnection.queryTraining(int id);
Gets the protocol version
The current protocol version can be divided into V1 and V2.
xxxxxxxxxxCRPProtocolVersion version = bleConnection.getProtocolVersion();
Start measuring once temperature
After starting the measurement, the real-time temperature is called back through CRPTempChangeListener.onMeasureTemp(), and the measurement state is called back through CRPTempChangeListener.onMeasureTempState().
xxxxxxxxxxbleConnection.startMeasureTemp();
Stop measuring once temperature
xxxxxxxxxxbleConnection.stopMeasureTemp();
Enable timing temperature measurement
After the timing measurement is turned on, the bracelet automatically measures temperature every half an hour.
xxxxxxxxxxbleConnection.enableTimingMeasureTemp();
Disable timing temperature measurement
xxxxxxxxxxbleConnection.disableTimingMeasureTemp();
Query the timing of temperature measurement status
The measurement state is called back through CRPTimingMeasureTempStateCallback.onMeasureState().
xxxxxxxxxxbleConnection.queryTimingMeasureTempState(CRPTimingMeasureTempStateCallback);
Query the result of timing temperature measurement
The bracelet can save the last two days of timing temperature measurement data, and the result is called back through CRPTempChangeListener.onTimingMeasureTemp(CRPTempInfo).
xxxxxxxxxxbleConnection.queryTimingMeasureTemp(CRPTempTimeType);
CRPTempTimeType:
TODAY | YESTERDAY |
---|---|
today | yesterday |
CRPTempInfo:
type | measureInterval | tempList |
---|---|---|
CRPTempTimeType | Measurement interval (unit: minute, default 30 minutes) | temperature data |
Sets listener of temperature measurement results
xxxxxxxxxxbleConnection.setTempChangeListener(CRPTempChangeListener);
Enable continuous body temperature measure
xxxxxxxxxxbleConnection.enableContinueTemp();
Disable continuous body temperature measure
xxxxxxxxxxbleConnection.disableContinueTemp();
Query continuous body temperature measure state
Callback via CRPTempChangeListener.onContinueState().
xxxxxxxxxxbleConnection.queryContinueTempState();
查询最近 24 小时的体温测量记录
通过CRPTempChangeListener.onContinueTemp()回调。
xxxxxxxxxxbleConnection.queryLast24HourTemp();
Sets display time
time is the screen-on time, unit: second, cannot exceed 255.
xxxxxxxxxxbleConnection.sendDisplayTime(time);
Query display time
The result is called back by CRPDeviceDisplayTimeCallback. onDisplayTime().
xxxxxxxxxxbleConnection.queryDisplayTime(CRPDeviceDisplayTimeCallback);
Set hand washing reminder
Set the start time of hand washing, switch and other information.
xxxxxxxxxxbleConnection.sendHandWashingReminder(CRPHandWashingPeriodInfo);
CRPHandWashingPeriodInfo:
enable | startHour | startMinute | count | period |
---|---|---|---|---|
enable | hours | minutes | reminders | reminder interval |
Query hand washing reminder
The result is called back through CRPDeviceHandWashingPeriodCallback.onHandWashingPeriod (CRPHandWashingPeriodInfo).
xxxxxxxxxxbleConnection.queryHandWashingReminderPeriod(CRPDeviceHandWashingPeriodCallback);
xxxxxxxxxxbleConnection.sendLocalCity(city);
Sets temperature system
Switch the temperature system of the bracelet.
xxxxxxxxxxbleConnection.sendTempUnit(CRPTempUnit);
CRPTempUnit:
CELSIUS | FAHRENHEIT |
---|---|
Celsius | Fahrenheit |
Query temperature system
The result is called back by CRPWeatherChangeListener.onTempUnitChange().
xxxxxxxxxxbleConnection.queryTempUnit();
Set brightness
xxxxxxxxxxbleConnection.sendBrightness(int brightness);
Set brightness
Call back through CRPDeviceBrightnessCallback.onBrightness(int cuurent, int max);
xxxxxxxxxxbleConnection.queryBrightness(CRPDeviceBrightnessCallback callback);
Call back through CRPBtAddressCallback.onAddress(String address);
xxxxxxxxxxbleConnection.queryBtAddress(CRPBtAddressCallback callback);
Check support contacts
Call back through CRPContactConfigCallback.onContactConfig(CRPContactConfigInfo info);
xxxxxxxxxxbleConnection.checkSupportQuickContact(CRPContactConfigCallback callback);
CRPContactConfigInfo:
supported | count | width | height |
---|---|---|---|
Whether to support quick contacts | The count of contacts | The contact avatar width | The contact avatar height |
Query current contacts count
Call back through CRPContactCountCallback.onContactCount(int count);
xxxxxxxxxxbleConnection.queryContactCount(CRPContactCountCallback callback);
Set contacts listener
The setting result is called back through CRPContactListener.
xxxxxxxxxxbleConnection.setContactListener(CRPContactListener listener);
Set contacts
CRPContactInfo:
id | width | height | address | name | number |
---|---|---|---|---|---|
The contacts id | The contacts avatar width | The contacts avatar height | The contacts avatar storage address | The contacts name | The contacts phone number |
xxxxxxxxxxbleConnection.sendContact(CRPContactInfo info);
Set contacts avatar
The transfer progress is called back through CRPFileTransListener.
xxxxxxxxxxbleConnection.sendContactAvatar(int id, Bitmap bitmap, int timeout, CRPFileTransListener listener);
Delete contacts
xxxxxxxxxxbleConnection.deleteContact(int id);
Delete contacts avatar
xxxxxxxxxxbleConnection.deleteContactAvatar(int id);
Delete all contacts
xxxxxxxxxxbleConnection.clearContact();
Query whether the watch supports special symbols
Whether the three symbols +*# are supported in the phone number.
xxxxxxxxxxbleConnection.queryContactNumberSymbol(CRPContactNumberSymbolCallback);
Set battery saing listener
xxxxxxxxxxbleConnection.setBatterySavingListener(CRPBatterySavingChangeListener listener);
Set battery saving state
After the battery saving mode is turned on, the quick view will be turned off.
xxxxxxxxxxbleConnection.sendBatterySaving(boolean enable);
Get battery saving state
Call back through CRPBatterySavingChangeListener.onBatterSaving(boolean enable);
xxxxxxxxxxbleConnection.queryBatterySaving();
Query support pill reminder
Call back through CRPPillReminderCallback. onPillReminder(int supportCount, List
CRPPillReminderInfo:
id | dateOffset | name | repeat | reminderTimeList |
---|---|---|---|---|
The pill id | Start taking medicine in a few days | The pill name | The take medicine every few days | The time point and dosage of the medicine each day |
CRPPillReminderInfo.ReminderTimeBean:
time | count |
---|---|
The time to take medicine(For example, 100 is 01:40 am) | The dose |
xxxxxxxxxxbleConnection.queryPillReminder(CRPPillReminderCallback callback);
Set pill reminder
xxxxxxxxxxbleConnection.sendPillReminder(CRPPillReminderInfo info);
Delete pill reminder
xxxxxxxxxx// CRPPillReminderInfo.idbleConnection.deletePillReminder(int id);
Clear pill reminder
xxxxxxxxxxbleConnection.clearPillReminder();
Query tap to wake state
Call back through CRPTapToWakeCallback.onWakeState(boolean enable);
xxxxxxxxxxbleConnection.queryTapToWakeState(CRPTapToWakeCallback callback);
Set tap to wake state
xxxxxxxxxxbleConnection.sendTapToWakeState(boolean enable);
Some watches require the user to confirm the pairing on the watch after the connection is successful.
xxxxxxxxxx// After the pairing is completed, you need to save the paired key (bytes), and send the same key after connecting again, without confirming again.bleConnection.createBond(byte[] bytes, CRPDeviceBondStateCallback callback);
Set HRV listener
xxxxxxxxxxbleConnection.setNewHrvListener(CRPNewHrvChangeListener listener);
Query support HRV measure
xxxxxxxxxxbleConnection.querySupportNewHrv();
Start measure once HRV
xxxxxxxxxxbleConnection.startMeasureNewHrv();
Stop measure once HRV
xxxxxxxxxxbleConnection.stopMeasureNewHrv();
Query HRV History
xxxxxxxxxxbleConnection.queryHistoryNewHrv();
Set stress listener
xxxxxxxxxxbleConnection.setStressListener(CRPStressListener listener);
Query support stress measure
If there is a reply, it means that the pressure measurement is supported, and if there is no reply, it means that it does not support it. Via the CRPSressListener.onSupportStress() callback.
xxxxxxxxxxbleConnection.querySupportStress();
Start once stress
Callback via CRPSressListener.onStressChange() when the measurement is complete.
xxxxxxxxxxbleConnection.startMeasureStress();
Stop once stress
xxxxxxxxxxbleConnection.stopMeasureStress();
Query stress history
The watch can save the last 10 measurement records, through the CRPStressListener.onHistoryStressChange() callback.
xxxxxxxxxxbleConnection.queryHistoryStress();
Enable timing stress measure
The measurement interval is fixed at half an hour.
xxxxxxxxxxbleConnection.enableTimingStress();
Disable timing stress measure
xxxxxxxxxxbleConnection.disableTimingStress();
Query timing stress measure status
Call back through CRPStressListener.onTimingStressStateChange().
xxxxxxxxxxbleConnection.queryTimingStressState();
Query history timing stress
The watch can save the measurement records of the last two days through the callback of CRPStressListener.onTimingStressChange().
xxxxxxxxxxbleConnection.queryTimingStress(CRPStressDate);
Query the count of supported E-Card
If there is a reply, it means that the watch supports E-Card, and if there is no reply, it means that it does not support it. Via the CRPElectronicCardCountCallback.onElectronicCardCount() callback.
xxxxxxxxxxbleConnection.queryElectronicCardCount(CRPElectronicCardCountCallback)
CRPElectronicCardCountInfo:
count | urlBytesLimit | savedIdList |
---|---|---|
The max count supported | url max bytes(utf-8) | List of saved E-Card IDs |
Set E-Card
xxxxxxxxxxbleConnection.sendElectronicCard(CRPElectronicCardInfo);
CRPElectronicCardInfo:
id | title | url |
---|---|---|
E-Card id (cannot exceed supported max) | the title | url (the watch uses this url to produce the corresponding QR code) |
Delete E-Card
xxxxxxxxxxbleConnection.deleteElectronicCard(id);
Query E-Card Details
Via the CRPElectronicCardCallback.onElectronicCard() callback.
xxxxxxxxxxbleConnection.queryElectronicCard(id, CRPElectronicCardCallback);
E-Card Sorting
Reorder E-Cards by idList.
xxxxxxxxxxbleConnection.sendElectronicCardList(idList);
Set calendar event listener
xxxxxxxxxxbleConnection.setCalendarEventListener(CRPCalendarEventListener);
Query support calendar event
The max number of events and saved reminder events are supported through the CRPCalendarEventListener.onSupportEvent() callback.
xxxxxxxxxxbleConnection.querySupportCalendarEvent();
Set calendar event
xxxxxxxxxxbleConnection.sendCalendarEvent(CRPCalendarEventInfo);
CRPCalendarEventInfo:
id | title | startHour | startMinute | endHour | endMinute | time |
---|---|---|---|---|---|---|
The event ID | The event title | Start time(hour) | Start time(minute) | End time(hour) | End time(minute) | reminder time(Timestamp, unit: second) |
Detele calendar event
xxxxxxxxxxbleConnection.deleteCalendarEvent(id);
Query calendar event details
Via the CRPCalendarEventListener.onEvent() callback.
xxxxxxxxxxbleConnection.queryCalendarEvent(int id);
Set calendar event on status and reminder time
xxxxxxxxxx// minutes indicates how long to remind in advance, unit: minute, cannot be negative.bleConnection.sendCalendarEventReminderTime(boolean enable, int minutes);
Query calendar event on status and reminder time
Via the CRPCalendarEventListener.onEventReminderTime() callback.
xxxxxxxxxxbleConnection.queryCalendarEventReminderTime();
Delete all calendar event
xxxxxxxxxxbleConnection.clearCalendarEvent();
Some watches support GPS positioning, which can be used to record the movement track of outdoor training.
Set GPS listener
xxxxxxxxxxbleConnection.setGpsChangeListener(CRPGpsChangeListener)
Query history GPS
Callback through CRPGpsChangeListener.onHistoryGpsPathChange(List
xxxxxxxxxxbleConnection.queryHistoryGps()
Query GPS details
Through CRPGpsChangeListener.onGpsPathChange(CRPGpsPathInfo) callback.
xxxxxxxxxx// time is the timestamp when GPS training started (unit: second)bleConnection.queryGpsDetail(int time)
CRPGpsPathInfo:
time | locationList |
---|---|
the start time | longitude and latitude collection |
Send epo file
Updating the epo file can help the watch to search stars more quickly. After receiving the CRPGpsChangeListener.onUpdateEpoChange(CRPEpoType) callback, send the corresponding epo file to the watch.
xxxxxxxxxxbleConnection.sendEpoFile(File, CRPEpoType, CRPFileTransListener)
Set vibration strength
Adjust the vibration strength of the watch motor.
xxxxxxxxxxbleConnection.sendVibrationStrength(CRPVibrationStrength strength)
Query vibration strength
A callback indicates support, and no callback indicates that the watch does not support this function. Callback via CRPVibrationStrengthCallback.onVibrationStrength().
xxxxxxxxxxbleConnection.queryVibrationStrength(CRPVibrationStrengthCallback callback)