Browse Source

Update documentation

master
陈福行 5 years ago
parent
commit
b3cac5facc
2 changed files with 27 additions and 11 deletions
  1. 17
    6
      README.md
  2. 10
    5
      README_CN.md

+ 17
- 6
README.md View File



## Start access ## Start access
> First configure the key and secret for the SDK, [application address](http://sdk.aicare.net.cn) > First configure the key and secret for the SDK, [application address](http://sdk.aicare.net.cn)

``` ```
  // Called in the application of the main project   // Called in the application of the main project
  AiFitSDK.getInstance (). Init (this, key, secret);   AiFitSDK.getInstance (). Init (this, key, secret);
``` ```


> Add below AndroidManifest.xml application tag > Add below AndroidManifest.xml application tag

``` ```
<application> <application>
... ...
// Call the isScanning method to see if it is scanning true: scanning; false: scanning stopped // Call the isScanning method to see if it is scanning true: scanning; false: scanning stopped
 isScanning ();  isScanning ();
``` ```

> Note: If it is a broadcast scale, you do not need to perform the connection operation. You can directly get the body fat data in the scan callback getAicareDevice (BroadData broadData) method. The broadcast scale calls stopScan () to get back no data. > Note: If it is a broadcast scale, you do not need to perform the connection operation. You can directly get the body fat data in the scan callback getAicareDevice (BroadData broadData) method. The broadcast scale calls stopScan () to get back no data.


``` ```
bodyFatData.getDecimalInfo())), bodyFatData .getHeight(), bodyFatData.getDecimalInfo())), bodyFatData .getHeight(),
bodyFatData.getAdc()); bodyFatData.getAdc());
``` ```

- If you need to get 6 additional body indicators such as body fat removal and weight control, please call AicareBleConfig.getMoreFatData to get MoreFatData object - If you need to get 6 additional body indicators such as body fat removal and weight control, please call AicareBleConfig.getMoreFatData to get MoreFatData object
Instructions: Instructions:

``` ```
AicareBleConfig.getMoreFatData (int sex, int height, double weight, AicareBleConfig.getMoreFatData (int sex, int height, double weight,
double bfr, double rom, double pp) double bfr, double rom, double pp)
    @Override     @Override
    protected void onServiceBinded (WBYService.WBYBinder binder) {     protected void onServiceBinded (WBYService.WBYBinder binder) {
        this.binder = binder;         this.binder = binder;
      
   }    }
   // If the history is obtained    // If the history is obtained
      binder.syncHistory ();       binder.syncHistory ();
      
      
      
   // Part of the method of WBYBinder    // Part of the method of WBYBinder
   public class WBYBinder extends LocalBinder {    public class WBYBinder extends LocalBinder {


        public void getDecimalInfo () {         public void getDecimalInfo () {
            mManager.getDecimalInfo ();             mManager.getDecimalInfo ();
        }         }
        
        ...         ...
} }
    
``` ```


## Class description ## Class description
| double| muscleMass| Muscle mass | double| muscleMass| Muscle mass
| double| protein| Protein amount | double| protein| Protein amount
| MoreFatData.FatLevel fatLevel| Obesity grade | MoreFatData.FatLevel fatLevel| Obesity grade

``` ```
public static enum FatLevel { public static enum FatLevel {
UNDER, // Underweight UNDER, // Underweight
FAT; overweight FAT; overweight
} }
``` ```

- BleProfileService Connection Status - BleProfileService Connection Status


``` ```
public static final int STATE_INDICATION_SUCCESS = 3; // Enable success public static final int STATE_INDICATION_SUCCESS = 3; // Enable success
public static final int STATE_TIME_OUT = 5; // connection timed out public static final int STATE_TIME_OUT = 5; // connection timed out
``` ```

- AicareBleConfig.SettingStatus Status information returned by the device - AicareBleConfig.SettingStatus Status information returned by the device


``` ```
int DATA_SEND_END = 25; // Measured data transmission is complete int DATA_SEND_END = 25; // Measured data transmission is complete
int UNKNOWN = -1; // unknown int UNKNOWN = -1; // unknown
``` ```

- WBYService Bluetooth information returned by the device - WBYService Bluetooth information returned by the device


``` ```
- The data displayed by the scale is inconsistent with the data received by the app - The data displayed by the scale is inconsistent with the data received by the app
1. The SDK will request decimals by default, and you can use getDecimalInfo () in WBYBinder to actively obtain decimals 1. The SDK will request decimals by default, and you can use getDecimalInfo () in WBYBinder to actively obtain decimals
2. When the app calculates the weight, it needs to pass in DecimalInfo (decimal object) for calculation 2. When the app calculates the weight, it needs to pass in DecimalInfo (decimal object) for calculation

``` ```
DecimalInfo { DecimalInfo {
    private int sourceDecimal; // The source data decimal places     private int sourceDecimal; // The source data decimal places
    private int lbGraduation; // lb division     private int lbGraduation; // lb division
} }
``` ```

- Why can I only measure my weight and no other body fat data? - Why can I only measure my weight and no other body fat data?
1. You must take off your shoes and socks and stand barefoot on the electrode pads of the body fat scale to measure body fat data. 1. You must take off your shoes and socks and stand barefoot on the electrode pads of the body fat scale to measure body fat data.



+ 10
- 5
README_CN.md View File

## 开始接入 ## 开始接入


> 首先给SDK配置key和secret,[申请地址](http://sdk.aicare.net.cn) > 首先给SDK配置key和secret,[申请地址](http://sdk.aicare.net.cn)

``` ```
//在主项目的application中调用 //在主项目的application中调用
AiFitSDK.getInstance().init(this, key, secret); AiFitSDK.getInstance().init(this, key, secret);
``` ```


> 在AndroidManifest.xml application标签下面增加 > 在AndroidManifest.xml application标签下面增加

``` ```
<application> <application>
... ...
## 调用SDK中的算法库 ## 调用SDK中的算法库
- 如果设备返回阻抗,没有体脂数据可以通过继承BleProfileServiceReadyActivity中的onGetFatData方法获得 BodyFatData 对象,调用AicareBleConfig.getBodyFatData方法计算得到cn.net.aicare.algorithmutil.BodyFatData对象 - 如果设备返回阻抗,没有体脂数据可以通过继承BleProfileServiceReadyActivity中的onGetFatData方法获得 BodyFatData 对象,调用AicareBleConfig.getBodyFatData方法计算得到cn.net.aicare.algorithmutil.BodyFatData对象
使用方法: 使用方法:
```


```
AicareBleConfig.getBodyFatData(AlgorithmUtil.AlgorithmType.TYPE_AIC AicareBleConfig.getBodyFatData(AlgorithmUtil.AlgorithmType.TYPE_AIC
ARE, bodyFatData.getSex(), bodyFatData.getAge(), ARE, bodyFatData.getSex(), bodyFatData.getAge(),
Double.valueOf(ParseData.getKgWeight(bodyFatData.getWeight(), Double.valueOf(ParseData.getKgWeight(bodyFatData.getWeight(),
bodyFatData.getDecimalInfo())), bodyFatData .getHeight(), bodyFatData.getDecimalInfo())), bodyFatData .getHeight(),
bodyFatData.getAdc()); bodyFatData.getAdc());
``` ```

- 如需要获取去脂体重,体重控制量等额外的 6 项身体指标,请调用调用AicareBleConfig.getMoreFatData计算得到 MoreFatData 对象 - 如需要获取去脂体重,体重控制量等额外的 6 项身体指标,请调用调用AicareBleConfig.getMoreFatData计算得到 MoreFatData 对象
使用方法: 使用方法:

``` ```
AicareBleConfig.getMoreFatData(int sex, int height, double weight, AicareBleConfig.getMoreFatData(int sex, int height, double weight,
double bfr, double rom, double pp) double bfr, double rom, double pp)
public final static int ADC = 4; //阻抗值 public final static int ADC = 4; //阻抗值
``` ```
## 版本历史 ## 版本历史

|版本号|更新时间|作者|更新信息| |版本号|更新时间|作者|更新信息|
|:----|:---|:-----|-----| |:----|:---|:-----|-----|
|1.0| 2017/2/15| Suzy| 初步版本|
|1.0.1| 2017/7/31| Suzy| 修复部分数据转换bug
|1.0.2| 2017/9/11| Suzy| 指令中的类型根据实际连上的设备类型设置
|1.0.3| 2017/11/16| Suzy| 代码优化
|1.0|2017/2/15|Suzy|初步版本
|1.0.1|2017/7/31|Suzy|修复部分数据转换bug
|1.0.2| 2017/9/11| Suzy|指令中的类型根据实际连上的设备类型设置
|1.0.3| 2017/11/16| Suzy|代码优化
|1.0.4| 2018/7/12| Suzy| 兼容广播秤 |1.0.4| 2018/7/12| Suzy| 兼容广播秤
|1.0.5| 2018/1/15| Suzy| 兼容新协议 |1.0.5| 2018/1/15| Suzy| 兼容新协议
|1.0.6| 2018/2/25| Suzy| 功能优化 |1.0.6| 2018/2/25| Suzy| 功能优化

Loading…
Cancel
Save