### Example: Start Scanning and Handle Results Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document Demonstrates how to initiate a device scan and implement the SearchResponse callback to receive scan results. ```kotlin //kotlin code VPOperateManager.getInstance() .startScanDevice(object : SearchResponse { override fun onSearchStarted() { } override fun onDeviceFounded(p0: SearchResult) { } override fun onSearchStopped() { } override fun onSearchCanceled() { } }) ``` -------------------------------- ### Start JieLi Device OTA Upgrade Example Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document Initiates an OTA upgrade for a JieLi device. Ensure the firmware file path is correct and the device meets the prerequisites. The upgrade process can take 10-20 minutes and requires the app to be in the foreground. ```java private void startOTA() { String firmwareFilePath = "/storage/emulated/0/Android/data/com.timaimee.vpdemo/files/hband/jlOta/KH32_9626_00320800_OTA_UI_230421_19.zip"; tvOTAInfo.setText(firmwareFilePath); VPOperateManager.getInstance().startJLDeviceOTAUpgrade(firmwareFilePath, new JLOTAHolder.OnJLDeviceOTAListener() { @Override public void onOTAStart() { Logger.t(TAG).e("【Jie Li OTA】--->OTA upgrade【Start】"); tvOTAInfo.setText("Start upgrade"); } @Override public void onProgress(float progress) { Logger.t(TAG).e("【杰理OTA】--->OTA升级中:" + progress + "%\n"); tvOTAProgress.setText(String.format(Locale.CHINA, "%.2f", progress) + "%"); pbOTAProgress.setProgress((int) (progress * 100)); } @Override public void onNeedReconnect(String address, String dfuLangAddress, boolean isReconnectBySdk) { Logger.t(TAG).e("【Jie Li OTA】--->OTA upgrade dfuLang reconnecting: address = " + address + ", dfuLangAddress = " + dfuLangAddress + ", whether reconnected by SDK = " + isReconnectBySdk); tvOTAInfo.setText("Data transmission is completed, start searching for DFULang devices->Device internal upgrade"); } @Override public void onOTASuccess() { Logger.t(TAG).e("【杰理OTA】--->OTA升级【成功】"); tvOTAInfo.setText("OTA升级成功"); tvOTAProgress.setText("100%"); } @Override public void onOTAFailed(com.jieli.jl_bt_ota.model.base.BaseError error) { Logger.t(TAG).e("【杰理OTA】--->OTA升级【失败】:" + error.toString()); tvOTAInfo.setText("升级失败,error: code = " + error.getSubCode() + " , msg = " + error.getMessage()); } }); } ``` -------------------------------- ### Example of Setting Sedentary Settings Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/sdkdoc/VeepooSDK Android Api.md Provides an example of setting sedentary reminder preferences using VPOperateManager. This includes specifying start and end times, a threshold for inactivity, and the desired on/off state. ```kotlin VPOperateManager.getInstance().settingLongSeat( writeResponse, LongSeatSetting(10, 40, 12, 40, 40, false) ) { longSeat -> val message = "设置久坐:\n$longSeat" } ``` -------------------------------- ### Example: Read Current Step Count Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/sdkdoc/VeepooSDK Android Api - English.md Example of how to call the readSportStep interface to get real-time sport data. Ensure personal information is synchronized before use. ```kotlin //kotlin code VPOperateManager.getInstance().readSportStep({ if (it != Code.REQUEST_SUCCESS) { Log.e("Test", "write cmd failed") } }) { sportData -> } ``` -------------------------------- ### Example of Setting Find My Phone Listener Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/sdkdoc/VeepooSDK Android Api.md An example demonstrating how to set up the listener for the 'Find My Phone' feature using VPOperateManager. The callback receives a message indicating the phone is being sought. ```kotlin VPOperateManager.getInstance().settingFindPhoneListener { val message = "(监听到手环要查找手机)-where is the phone,make some noise!" } ``` -------------------------------- ### Example: Reading Temperature Data Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document An example demonstrating how to initiate a temperature data read operation. It includes checks for device support and provides an implementation for the ITemptureDataListener callback. ```kotlin // kotlin code if (!VpSpGetUtil.getVpSpVariInstance(applicationContext).isSupportReadTempture){ return } VPOperateManager.getInstance().readTemptureDataBySetting({ },object :ITemptureDataListener{ override fun onReadOriginProgressDetail( day: Int, date: String?, allPackage: Int, currentPackage: Int ) { } override fun onReadOriginProgress(progress: Float) { } override fun onReadOriginComplete() { } override fun onTemptureDataListDataChange(temptureDataList: MutableList?) { } }, readOriginSetting) ``` -------------------------------- ### Weather Data Setting Example Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/sdkdoc/VeepooSDK Android Api - English.md Example code demonstrating how to set weather data. This includes defining the weather conditions and then sending them to the device. ```APIDOC /** * Weather data setting */ | Member name | Type | Description | | -------------------- | -------- | ------------------------------------------------------------ | | timeBean | TimeData | Year Month Day Hour Minute | | temperatureMaxF | int | Maximum Fahrenheit | | temperatureMinF | int | Minimum Fahrenheit | | temperatureMaxC | int | Maximum Celsius | | temperatureMinC | int | Minimum Celsius | | yellowLevel | int | UV intensity index | | weatherStateWhiteDay | int | Daytime weather status, this value is an int value within a specified range, the value range is as follows:
0-4 Sunny
5-12 Sunny to cloudy
13-16 Overcast
17-20 Showers
21-24 Thunderstorm
25-32 Hail
33-40 Light rain
41-48 Moderate rain
49-56 Heavy rain
57-72 Torrential rain
73-84 Light snow
85-100 Heavy snow
101-155 Overcast | | weatherStateNightDay | int | Nighttime weather status, this value is an int value within a specified range, the value range is as follows:
0-4 Sunny
5-12 Sunny to cloudy
13-16 Overcast
17-20 Showers
21-24 Thunderstorm
25-32 Hail
33-40 Light rain
41-48 Moderate rain
49-56 Heavy rain
57-72 Heavy rain
73-84 Light snow
85-100 Heavy snow
101-155 Overcast | | windLevel | String | Wind direction level. If the wind force is a range value, please connect it with ‘-’, such as "3-5"; if it is a single value, just "3" | | canSeeWay | double | Visibility unit m, 3.16 | ``` -------------------------------- ### Example Usage of pushImageMsg Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document This example demonstrates how to call the `pushImageMsg` method and handle the different callback events from the `IImageMsgPushListener`. ```java VPOperateManager.getInstance().pushImageMsg(pushImagePath, new IImageMsgPushListener() { @Override public void onImageMsgPushSuccess() { tvPushInfo.setText("图片推送成功"); } @Override public void onImageMsgPushProgress(int currentBlock, int sumBlock, int progress) { tvPushInfo.setText("图片推送进度:" + progress + "%\n"); } @Override public void onImageMsgPushFailed(ErrorCode errorCode) { tvPushInfo.setText("图片推送错误:" + errorCode.info); } }); ``` -------------------------------- ### Example: Reading PPG Raw Data Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/sdkdoc/VeepooSDK Android Api.md Example of how to initiate reading PPG raw data using the VeepooSDK. It demonstrates setting up the necessary callbacks and logging the responses. ```java private void readPPGRawData() { sb.setLength(0); appendMsg("【读取】PPG原始数据"); VPOperateManager.getInstance().readPPGRawData(timeData, ppgTestMode, new BleWriteResponse() { @Override public void onResponse(int code) { appendMsg("【读取PPG测量开关状态指令发送" + (code == Code.REQUEST_SUCCESS ? "成功】" : "失败】")); } }, new IPPGRawDataReadListener() { @Override public void onPPGReadStart(int count) { appendMsg("开始读取PPG原始数据。\n一共" + count + "组数据"); } @Override public void onPPGRawDataRead(int index, int count, @NonNull PPGRawData ppgRawData) { appendMsg("PPG原始数据读取中。\n[" + index + "/" + count + "] --> " + ppgRawData.toString()); } @Override public void onPPGRawDataReadComplete(@NonNull PPGReadData ppgReadData) { appendMsg("PPG原始数据读取完成。\n" + ppgReadData); } @Override public void onPPGRawDataReadStop() { String content = tvPPGOptInfo.getText().toString(); appendMsg(content + "\nPPG原始数据读取停止。"); } }); } ``` -------------------------------- ### Start PPG Real-Time Transmission (Java) Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-文档 App requests to start PPG real-time transmission. Requires a callback for the command write result and a listener for transmission events. ```java /** * app请求开始PPG实时传输 (App requests to start PPG real-time transmission) * @param bleWriteResponse 指令写入结果回调 (Callback for the command write result) * @param transmissionListener PPG实时传输监听 (PPG real-time transmission listener) */ public void startPPGRealTimeTransmission(BleWriteResponse bleWriteResponse, IPPGRealTimeTransmissionListener transmissionListener) ``` -------------------------------- ### readSleepData Example Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document Example of how to initiate reading sleep data and provide a callback listener. ```Kotlin VPOperateManager.getInstance().readSleepData({ // Callback for operation status or completion }, object : ISleepDataListener { override fun onSleepDataChange(day: String?, sleepData: SleepData?) { // Handle sleep data changes } override fun onSleepProgress(progress: Float) { // Handle sleep reading progress updates } override fun onSleepProgressDetail(day: String?, packagenumber: Int) { // Handle detailed sleep reading progress (for testing) } override fun onReadSleepComplete() { // Handle completion of sleep reading } }, 3) ``` -------------------------------- ### Example: Setting Pregnancy State Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document An example demonstrating how to set the device to 'Pregnancy period' state. It includes a placeholder for the write response callback and a listener to process the returned women's data. ```kotlin VPOperateManager.getInstance().settingWomenState( { }, { womenData -> val message = "Women Status-Setting:\n$womenData" }, WomenSetting(EWomenStatus.PREING, TimeData(2016, 3, 1), TimeData(2017, 1, 14)) ) ``` -------------------------------- ### startScanDevice Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/com/veepoo/protocol/VPOperateManager.html Starts scanning for VPOOL devices. ```APIDOC ## startScanDevice ### Description Starts scanning for devices. ### Method ```java public void startScanDevice(com.inuker.bluetooth.library.search.response.SearchResponse searchResponse) ``` ### Parameters #### Path Parameters - **searchResponse** (com.inuker.bluetooth.library.search.response.SearchResponse) - Required - Callback for scan results. ``` -------------------------------- ### Start Mini-Checkup Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/sdkdoc/VeepooSDK Android Api.md Initiates a mini-checkup test. The SDK writes a command to the device to start the test and provides a callback with the result. ```APIDOC ## Start Mini-Checkup ### Description Initiates a mini-checkup test on the device. This function writes a command to the device to start the test and returns a status code indicating the success or failure of the command write operation. ### Method Signature ```java public void startMiniCheckup(BleWriteResponse bleWriteResponse, IMiniCheckupOptListener listener) ``` ### Parameters #### Callback Parameters - **bleWriteResponse** (BleWriteResponse) - Callback for the write operation response. If the response code is `Code.REQUEST_SUCCESS`, the command was written successfully; otherwise, it failed. - **listener** (IMiniCheckupOptListener) - Listener for mini-checkup operations, providing feedback on the test progress and results. ### Example Code ```java VPOperateManager.getInstance().startMiniCheckup(code -> { if (code == Code.REQUEST_SUCCESS) { appendMsg("【开始】微体检指令写入成功!"); } else { appendMsg("【开始】微体检指令写入失败!"); } }, miniCheckupOptListener); ``` ``` -------------------------------- ### Example: Setting Pregnancy Status Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/sdkdoc/VeepooSDK Android Api - English.md An example demonstrating how to set the women's status to 'Pregnancy period' (PREING). It includes the necessary parameters for the `settingWomenState` method, such as time data for the last menstrual period and the due date. ```kotlin VPOperateManager.getInstance().settingWomenState( { }, { womenData -> val message = "Women Status-Setting:\n$womenData" }, WomenSetting(EWomenStatus.PREING, TimeData(2016, 3, 1), TimeData(2017, 1, 14)) ) ``` -------------------------------- ### ZT163 Device Always-Off-Screen Activity Example (Java) Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document Example Activity demonstrating how to enable, disable, and read the always-off-screen status of the ZT163 device using the VeepooSDK. Implements the IZT163DeviceAlwaysOffScreenOptListener interface. ```java /** * Activity for controlling ZT163 Device Always-Off-Screen feature. * ZT163 设备常灭屏功能界面。 */ public class ZT163DeviceAlwaysOffScreenActivity extends AppCompatActivity implements IZT163DeviceAlwaysOffScreenOptListener { private TextView tvInfo; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_zt163_device_always_off_screen); tvInfo = findViewById(R.id.tvInfo); // Enable Always-Off-Screen | 开启常灭屏 findViewById(R.id.btnOpen).setOnClickListener(v -> { VPOperateManager.getInstance().setZT163DeviceAlwaysOffScreen(true, code -> { // Command sent callback | 指令发送回调 }, this); }); // Disable Always-Off-Screen | 关闭常灭屏 findViewById(R.id.btnClose).setOnClickListener(v -> { VPOperateManager.getInstance().setZT163DeviceAlwaysOffScreen(false, code -> { // Command sent callback | 指令发送回调 }, this); }); // Read Current Status | 读取当前状态 findViewById(R.id.btnRead).setOnClickListener(v -> { VPOperateManager.getInstance().readZT163DeviceAlwaysOffScreen(code -> { // Command sent callback | 指令发送回调 }, this); }); } @Override public void onZT163DeviceAlwaysOffScreenSettingSuccess(boolean isOpen) { String state = isOpen ? "ON/开启" : "OFF/关闭"; tvInfo.setText("Setting Success | 设置成功: " + state); } @Override public void onZT163DeviceAlwaysOffScreenSettingFailed() { tvInfo.setText("Setting Failed | 设置失败"); } @Override public void onZT163DeviceAlwaysOffScreenReport(boolean isOpen) { String state = isOpen ? "ON/开启" : "OFF/关闭"; tvInfo.setText("Status Reported | 状态上报: " + state); } @Override public void onFunctionNotSupport() { tvInfo.setText("Function Not Supported | 当前设备不支持该功能"); } } ``` -------------------------------- ### Start Mini-Checkup Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/sdkdoc/VeepooSDK Android Api - English.md Initiates a mini-checkup test. The SDK writes a command to the device to start the test and provides feedback on the success of this operation. ```APIDOC ## Start Mini-Checkup ### Description Initiates a mini-checkup test. The SDK writes a command to the device to start the test and provides feedback on the success of this operation. ### Method ```java public void startMiniCheckup(BleWriteResponse bleWriteResponse, IMiniCheckupOptListener listener) ``` ### Parameters #### Request Body - **bleWriteResponse** (BleWriteResponse) - Listener for write operations. The response code indicates if the command was written successfully. - **listener** (IMiniCheckupOptListener) - Listener for mini-checkup test results and status updates. ### Request Example ```java VPOperateManager.getInstance().startMiniCheckup(code -> { if (code == Code.REQUEST_SUCCESS) { appendMsg("【开始】微体检指令写入成功!"); } else { appendMsg("【开始】微体检指令写入失败!"); } }, miniCheckupOptListener); ``` ``` -------------------------------- ### Example Usage of Reading Sleep Data Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/sdkdoc/VeepooSDK Android Api - English.md Example of how to initiate sleep data reading and implement the ISleepDataListener callbacks. ```APIDOC ## Example Code ### Description Example of how to initiate sleep data reading and implement the ISleepDataListener callbacks. ### Code ```kotlin //kotlin code VPOperateManager.getInstance().readSleepData({ },object :ISleepDataListener{ override fun onSleepDataChange(day: String?, sleepData: SleepData?) { } override fun onSleepProgress(progress: Float) { } override fun onSleepProgressDetail(day: String?, packagenumber: Int) { } override fun onReadSleepComplete() { } },3) ``` ``` -------------------------------- ### startDeviceScan Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/index-all.html Starts device scanning. Overloaded methods are available in ClassicBTManager. ```APIDOC ## startDeviceScan (ClassicBTManager - overload 1) ### Description Starts device scanning with a specified timeout. This overload is part of the ClassicBTManager class. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters - **timeout** (type) - Required - Description of timeout in milliseconds ``` ```APIDOC ## startDeviceScan (ClassicBTManager - overload 2) ### Description Starts device scanning with a specified type and timeout. This overload is part of the ClassicBTManager class. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters - **type** (type) - Required - Description of device type to scan for - **timeout** (type) - Required - Description of timeout in milliseconds ``` ```APIDOC ## startDeviceScan (IBluetoothDiscovery) ### Description Starts device scanning with a specified timeout. This method is part of the IBluetoothDiscovery interface. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters - **timeout** (type) - Required - Description of timeout in milliseconds ``` -------------------------------- ### Set PPG Measurement Status Switch Example Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document Example code for sending a command to set the PPG measurement switch status. It updates a TextView with the success or failure of the command. ```java VPOperateManager.getInstance().setPPGSwitchStatus(ppgSwitchStatus, code -> tvPPGOptInfo.setText("设置PPG测量开关状态指令发送" + (code == Code.REQUEST_SUCCESS ? "成功" : "失败"))); ``` -------------------------------- ### startUiUpdate Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/com/veepoo/protocol/VPOperateManager.html Starts the UI update process (UI channel). ```APIDOC ## startUiUpdate ### Description Starts the UI update process (UI channel). ### Method public void ### Parameters - **bleWriteResponse** (IBleWriteResponse) - Description not available. - **isUiFlash** (boolean) - Description not available. ``` -------------------------------- ### Sleep Data Listener Implementation Example (Kotlin) Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-文档 An example implementation of the ISleepDataListener interface, demonstrating how to handle sleep data changes, progress updates, progress details, and completion notifications. This listener is crucial for receiving and processing sleep data asynchronously. ```kotlin //kotlin code VPOperateManager.getInstance().readSleepData({ },object :ISleepDataListener{ override fun onSleepDataChange(day: String?, sleepData: SleepData?) { } override fun onSleepProgress(progress: Float) { } override fun onSleepProgressDetail(day: String?, packagenumber: Int) { } override fun onReadSleepComplete() { } },3) ``` -------------------------------- ### Start Nordic OTA Upgrade Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document Initiates the Nordic OTA upgrade process. Ensure the device is disconnected from any internal GATT connection before starting. ```java VPOperateManager.getInstance().startNordicOtaUpgrade(firmwareFilePath, listener) ``` -------------------------------- ### startDetectTempture Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/index-all.html Starts temperature detection. Overloaded methods are available in VPOperateAbstract and VPOperateManager. ```APIDOC ## startDetectTempture (VPOperateAbstract) ### Description Starts temperature detection. This overload is part of the VPOperateAbstract class. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters - **client** (type) - Required - Description of client - **mac** (type) - Required - Description of mac address - **bleWriteResponse** (type) - Required - Description of bleWriteResponse ``` ```APIDOC ## startDetectTempture (VPOperateManager) ### Description Starts real-time temperature detection. This overload is part of the VPOperateManager class. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters - **bleWriteResponse** (type) - Required - Description of bleWriteResponse - **responseListener** (type) - Required - Description of responseListener ``` -------------------------------- ### startDetectPTT Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/index-all.html Starts PTT detection. This method is part of the VPOperateAbstract class. ```APIDOC ## startDetectPTT ### Description Starts PTT detection. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters - **client** (type) - Required - Description of client - **mac** (type) - Required - Description of mac address - **bleWriteResponse** (type) - Required - Description of bleWriteResponse - **isNeedCurve** (type) - Required - Description of isNeedCurve - **ecgDetectListener** (type) - Required - Description of ecgDetectListener - **isSupportDisease** (type) - Required - Description of isSupportDisease ``` -------------------------------- ### startClearUi Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/com/veepoo/protocol/VPOperateManager.html Starts the data clearing process (UI channel). ```APIDOC ## startClearUi ### Description Starts the data clearing process (UI channel). ### Method public void ### Parameters - **bleWriteResponse** (IBleWriteResponse) - Description not available. - **dataReceiveAddress** (int) - Description not available. - **fileLength** (long) - Description not available. ``` -------------------------------- ### startDetectECG Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/index-all.html Starts ECG measurement. Overloaded methods are available in VPOperateAbstract and VPOperateManager. ```APIDOC ## startDetectECG (VPOperateAbstract) ### Description Starts ECG measurement. This overload is part of the VPOperateAbstract class. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters - **client** (type) - Required - Description of client - **mac** (type) - Required - Description of mac address - **bleWriteResponse** (type) - Required - Description of bleWriteResponse - **isNeedCurve** (type) - Required - Description of isNeedCurve - **ecgDetectListener** (type) - Required - Description of ecgDetectListener - **isSupportDisease** (type) - Required - Description of isSupportDisease ``` ```APIDOC ## startDetectECG (VPOperateManager) ### Description Starts ECG measurement. This overload is part of the VPOperateManager class. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters - **bleWriteResponse** (type) - Required - Description of bleWriteResponse - **isNeedCurve** (type) - Required - Description of isNeedCurve - **ecgDetectListener** (type) - Required - Description of ecgDetectListener ``` -------------------------------- ### startConnectByBreProfiles Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/index-all.html Starts a connection using BreProfiles. This method is available in ClassicBTManager and IBluetoothOperation. ```APIDOC ## startConnectByBreProfiles ### Description Starts a connection using BreProfiles. ### Method Not specified (likely a method call within the SDK) ### Endpoint Not applicable (SDK method) ### Parameters - **breDevice** (type not specified) - Description not specified - **device** (type not specified) - Description not specified ``` -------------------------------- ### startDetectSPO2H Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/index-all.html Starts SpO2H detection. Overloaded methods are available in VPOperateAbstract and VPOperateManager. ```APIDOC ## startDetectSPO2H (VPOperateAbstract) ### Description Starts SpO2H detection. This overload is part of the VPOperateAbstract class. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters - **client** (type) - Required - Description of client - **mac** (type) - Required - Description of mac address - **bleWriteResponse** (type) - Required - Description of bleWriteResponse ``` ```APIDOC ## startDetectSPO2H (VPOperateManager - overload 1) ### Description Starts real-time SpO2H detection. This overload is part of the VPOperateManager class. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters - **bleWriteResponse** (type) - Required - Description of bleWriteResponse - **spo2HDataListener** (type) - Required - Description of spo2HDataListener ``` ```APIDOC ## startDetectSPO2H (VPOperateManager - overload 2) ### Description Starts real-time SpO2H detection with light data callback. This overload is part of the VPOperateManager class. ### Method Not specified (SDK method) ### Endpoint Not applicable (SDK method) ### Parameters - **bleWriteResponse** (type) - Required - Description of bleWriteResponse - **spo2HDataListener** (type) - Required - Description of spo2HDataListener - **lightDataCallBack** (type) - Required - Description of lightDataCallBack ``` -------------------------------- ### Open Jieli Service Notification Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document Initiates the process to open Jieli data notifications. This is a required step before starting device authentication. It also includes an example of changing the MTU. ```java private void openJLNotify() { VPOperateManager.getInstance().openJLDataNotify(new BleNotifyResponse() { @Override public void onNotify(UUID service, UUID character, byte[] value) { } @Override public void onResponse(int code) { tvOpenInfo.setText("已开启通知"); VPOperateManager.getInstance().changeMTU(247, new IMtuChangeListener() { @Override public void onChangeMtuLength(int cmdLength) { } }); } }); } ``` -------------------------------- ### init Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/com/veepoo/protocol/VPOperateManager.html Initializes the VPOperateManager with the application context. ```APIDOC ## init ### Description Initializes the VPOperateManager. ### Method ```java public void init(android.content.Context context) ``` ### Parameters #### Path Parameters - **context** (android.content.Context) - Required - The application context. ``` -------------------------------- ### Start Body Composition Measurement Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document Initiates a body composition measurement on the device. Requires prior setup of body composition support. It takes a BleWriteResponse for write operations and an IBodyComponentDetectListener for callbacks during and after the measurement. ```kotlin VPOperateManager.getInstance().startDetectBodyComponent(bleWriteResponse,object :IBodyComponentDetectListener{ override fun onDetecting(progress: Int, leadState: Int) { "【Body Composition Measurement】onDetecting:$progress,$leadState".logd() } override fun onDetectSuccess(bodyComponent: BodyComponent) { "【Body Composition Measurement】onDetectSuccess:${bodyComponent}".logd() } override fun onDetectFailed(detectState: DetectState) { "【Body Composition Measurement】onDetectFailed:${detectState}".loge() } override fun onDetectStop() { "【Body Composition Measurement】onDetectStop".loge() } }) ``` -------------------------------- ### JieLi Watch Dial Info Listener Interface Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document This Java interface defines the callbacks for monitoring the process of obtaining watch dial information from the JieLi platform. Implement this interface to handle events such as getting dial information, starting, completion, success, and failure. ```java public interface OnWatchDialInfoGetListener { /** * Getting dial information * (Generally, this method will be called back if it is called again before the acquisition is completed) */ void onGettingWatchDialInfo(); /** * Start getting dial information */ void onWatchDialInfoGetStart(); /** * Completed getting dial information */ void onWatchDialInfoGetComplete(); /** * Successfully obtained watch dial information * * @param systemFatFiles system dial * @param serverFatFiles server dial * @param picFatFile photo dial */ void onWatchDialInfoGetSuccess(List systemFatFiles, List serverFatFiles, FatFile picFatFile); /** * Failed to obtain dial */ void onWatchDialInfoGetFailed(BaseError error); } ``` -------------------------------- ### startDetectBloodGlucose Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/index-all.html Starts the detection of blood glucose. This method is part of the VPOperateAbstract class. ```APIDOC ## startDetectBloodGlucose ### Description Starts the detection of blood glucose. ### Method Not specified (likely a method call within the SDK) ### Endpoint Not applicable (SDK method) ### Parameters - **client** (type not specified) - Description not specified - **mac** (type not specified) - Description not specified - **bleWriteResponse** (type not specified) - Description not specified ``` -------------------------------- ### Read Origin Data From Day Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document Enables customized reading of raw data by specifying the date and the number of records to start from, which helps avoid duplicate readings. For example, setting [yesterday, 150] will read from the 150th record of yesterday to the end of yesterday, and then continue to the day before yesterday. ```APIDOC ## readOriginDataFromDay ### Description Enables customized reading of raw data by specifying the date and the number of records to start from, which helps avoid duplicate readings. For example, setting [yesterday, 150] will read from the 150th record of yesterday to the end of yesterday, and then continue to the day before yesterday. ### Method readOriginDataFromDay(bleWriteResponse, originDataListener, day, position, watchday) ### Parameters - **bleWriteResponse**: (Type not specified) - Description for bleWriteResponse - **originDataListener**: (Type not specified) - Listener for origin data changes - **day**: (String) - The specific day to start reading from - **position**: (Int) - The record position to start reading from - **watchday**: (Int) - The total number of days to read backwards from the specified day ``` -------------------------------- ### Read Origin Data Single Day Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document Reads the raw data of a single specified day, allowing customization of the starting day and record number. It is designed to read only the data for the current day. For example, setting [yesterday, 150] will read from the 150th record of yesterday to the end of yesterday. ```APIDOC ## readOriginDataSingleDay ### Description Reads the raw data of a single specified day, allowing customization of the starting day and record number. It is designed to read only the data for the current day. For example, setting [yesterday, 150] will read from the 150th record of yesterday to the end of yesterday. ### Method readOriginDataSingleDay(bleWriteResponse, originDataListener, day, position, watchday) ### Parameters - **bleWriteResponse**: (Type not specified) - Description for bleWriteResponse - **originDataListener**: (Type not specified) - Listener for origin data changes - **day**: (String) - The specific day to read - **position**: (Int) - The record position to start reading from - **watchday**: (Int) - Total number of days to read (should be 1 for single day reading) ``` -------------------------------- ### Start Connect by BR/EDR Profiles Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/com/veepoo/protocol/jl/classic/interfaces/IBluetoothOperation.html Initiates a connection using BR/EDR profiles. ```APIDOC ## startConnectByBreProfiles ### Description Initiates the process of connecting to a Bluetooth device using BR/EDR profiles. ### Method Signature `boolean startConnectByBreProfiles(android.bluetooth.BluetoothDevice device)` ### Parameters * **device** (android.bluetooth.BluetoothDevice) - The Bluetooth device to connect to. ``` -------------------------------- ### Start Sport Mode Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-文档 Starts a sport mode on the device. Requires the device to support sport modes. ```APIDOC ## Start Sport Mode ### Description Starts a sport mode on the device. Requires the device to support sport modes. ### Method Signature `startSportModel(IBleWriteResponse bleWriteResponse, ISportModelStateListener sportModelStateListener)` ### Parameters #### Callback Interfaces - **bleWriteResponse** (IBleWriteResponse) - Listener for write operations. - **sportModelStateListener** (ISportModelStateListener) - Listener for sport mode state updates. ### Return Data Same as [Read Sport Model State](#读取运动模式状态). ### Example Code ```kotlin // Kotlin code VPOperateManager.getInstance() .startSportModel({ }, object : ISportModelStateListener { override fun onSportModelStateChange(sportModelStateData: SportModelStateData) { } override fun onSportStopped() { } }) ``` ``` -------------------------------- ### settingFindDevice Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/index-all.html Sets up the anti-loss feature for the device and includes a listener for related events. This method is available in VPOperateManager. ```APIDOC ## settingFindDevice (VPOperateManager) ### Description Sets up the anti-loss feature for the device and registers a listener for related events. ### Method Not specified (likely a method call within the SDK). ### Parameters - **bleWriteResponse**: Type not specified - Description not specified. - **findDeviceDatalistener**: Type not specified - Description not specified. - **isOpen**: Type not specified - Description not specified. ``` -------------------------------- ### setStartInsomniaTime Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/com/veepoo/protocol/model/datas/SleepPrecisionData.html Sets the start time of insomnia. Use this to record the exact start time of an insomnia event. ```APIDOC ## setStartInsomniaTime ### Description Sets the start time of insomnia. ### Method public void setStartInsomniaTime(java.lang.String startInsomniaTime) ### Parameters #### Path Parameters - **startInsomniaTime** (java.lang.String) - Description: The start time of insomnia to set. ``` -------------------------------- ### startDetectBP Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/com/veepoo/protocol/VPOperateManager.html Starts real-time blood pressure detection. Requires listeners for write responses and blood pressure data, and a detection model. ```APIDOC ## startDetectBP ### Description Starts real-time blood pressure detection. It's recommended to manage a flag to track measurement status and call `stopDetectBP` when progress reaches 100. The first reading with 100 progress is considered valid. ### Method Signature public void startDetectBP(IBleWriteResponse bleWriteResponse, IBPDetectDataListener bpDetectDataListener, EBPDetectModel model) ### Parameters * `bleWriteResponse` (IBleWriteResponse) - The listener for write operation responses. Success indicates the command was written successfully. * `bpDetectDataListener` (IBPDetectDataListener) - The listener for blood pressure detection data. * `model` (EBPDetectModel) - The blood pressure detection model. For private mode, ensure low and high pressure values are set beforehand using `settingDetectBP`. ``` -------------------------------- ### readSleepDataFromDay Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/com/veepoo/protocol/VPOperateManager.html Reads sleep data starting from a specified day. This method allows defining the starting point for reading data sequentially. ```APIDOC ## readSleepDataFromDay ### Description Reads sleep data starting from a specified day. This method allows defining the starting point for reading data sequentially. ### Method public void readSleepDataFromDay ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * `bleWriteResponse` - Listener for write operations. * `sleepReadDatalistener` - Listener for sleep data, returns the progress and corresponding sleep data. * `day` - The day to start reading from. 0 represents today, 1 represents yesterday, and so on. If yesterday is passed, the reading order will be yesterday, the day before yesterday, etc. * `watchday` - The storage capacity of the watch in days. This depends on the device. After password verification, it can be obtained via `getWatchday()` in the `onFunctionSupportDataChange` callback. ``` -------------------------------- ### Initiate Raw Data Reading Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/sdkdoc/VeepooSDK Android Api - English.md This code snippet demonstrates how to initiate the reading of raw origin data using the VPOperateManager. It requires a listener to handle progress and completion callbacks. ```kotlin //kotlin code VPOperateManager.getInstance().readOriginData({ },object :IOriginDataListener{ override fun onReadOriginProgressDetail( day: Int, date: String?, allPackage: Int, currentPackage: Int ) { } override fun onReadOriginProgress(progress: Float) { } override fun onReadOriginComplete() { } override fun onOringinFiveMinuteDataChange(originData: OriginData?) { } override fun onOringinHalfHourDataChange(originHalfHourData: OriginHalfHourData?) { } },3) ``` -------------------------------- ### Start Nordic OTA Upgrade Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/sdkdoc/VeepooSDK Android Api - English.md Initiates an OTA upgrade for a Nordic device. Ensure the device is disconnected before starting the upgrade if any anomalies are encountered. ```APIDOC ## startNordicOtaUpgrade ### Description Initiates the Over-The-Air (OTA) upgrade process for a Nordic device using a specified firmware file. ### Method ```java VPOperateManager.getInstance().startNordicOtaUpgrade(firmwareFilePath, listener) ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **firmwareFilePath** (String) - Required - Locally stored OTA upgrade file path. - **listener** (OnMcuMgrOtaListener) - Required - Listener to receive Nordic Device OTA upgrade events. ``` -------------------------------- ### VPOperateManager.init(context) Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/index-all.html Initializes the VPOperateManager with the provided context. This is a class method within com.veepoo.protocol. ```APIDOC ## init(context) ### Description Initializes the VPOperateManager with the provided context. ### Method (Implicitly a static or initialization method) ### Endpoint N/A (SDK Method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response N/A #### Response Example N/A ``` -------------------------------- ### SDK Initialization Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document Initializes the VeepooSDK. It is recommended to use ApplicationContext. This method should only be called once during the app's lifecycle. ```kotlin init(context) ``` -------------------------------- ### Example: Renaming a BLE Device Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document This example demonstrates how to call the bleDeviceRename function to rename a BLE device. Ensure the device is connected before attempting to rename it. ```kotlin VPOperateManager.getInstance().bleDeviceRename("MyDevice", object : IDeviceRenameListener { override fun onDeviceRenameSuccess(deviceName: String) { } override fun onDeviceRenameFail(error: ERenameError, deviceName: String) { } }, bleWriteResponse) ``` -------------------------------- ### Start Blood Component Measurement Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/sdkdoc/VeepooSDK Android Api.md Starts the blood component measurement process. Requires a BleWriteResponse listener, a boolean to indicate if calibration mode should be used, and an IBloodComponentDetectListener. ```java VPOperateManager.getInstance().startDetectBloodComponent(bleWriteResponse, isUseCalibrationMode, detectListener) ``` -------------------------------- ### checkVersionAndFile Source: https://github.com/hbandsdk/android_ble_sdk/blob/master/android_sdk_source/apidoc/index-all.html Performs the initial steps for firmware upgrades, including version and file validation, and monitoring the target device's status. This method is part of the VPOperateManager class. ```APIDOC ## checkVersionAndFile(oadSetting, updateCheckListener) ### Description Firmware upgrade's primary operation steps, including version check, file check, and monitoring the status of the target [device to be upgraded]. If both checks are successful, it indicates that firmware upgrade can be performed. ### Method APIDOC ### Endpoint APIDOC ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### SDK Initialization Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document Initializes the VeepooSDK. This method must be called before using any other SDK interfaces. It is recommended to use the ApplicationContext. ```APIDOC ## SDK Initialization ```kotlin init(context: Context) ``` ### Parameters #### Path Parameters - **context** (Context) - Required - It is recommended to use ApplicationContext Note: All interfaces can only be called after the SDK is initialized. During the running of the App, it only needs to be initialized once, and there is no need to initialize it repeatedly. ``` -------------------------------- ### Start Device Scanning Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document Starts Bluetooth scanning to discover devices. Non-company devices are filtered out. Call stopScanDevice to stop scanning. This interface is ineffective if Bluetooth is turned off. ```kotlin startScanDevice(searchResponse) ``` -------------------------------- ### Push Text Message with Callbacks Source: https://github.com/hbandsdk/android_ble_sdk/wiki/VeepooSDK-Android-API-Document This example demonstrates how to push a text message using the SDK. It includes callbacks for Bluetooth write operations and text message push events, handling success, failure, and unsupported function scenarios. ```java VPOperateManager.getInstance().pushTextMsg(content, new BleWriteResponse() { @Override public void onResponse(int code) { if(code!= Code.REQUEST_SUCCESS) { tvPushInfo.setText("蓝牙数据发送失败"); } } }, new ITextMsgPushListener() { @Override public void onTextMsgPushSuccess() { tvPushInfo.setText("文本推送成功"); } @Override public void onTextMsgPushFailed() { tvPushInfo.setText("文本推送失败"); } @Override public void onFunctionNotSupport() { tvPushInfo.setText("不支持该功能"); } }); ```