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

@@ -81,12 +81,14 @@ You can also use aar package dependency,Please download it into the project's li

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

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

> Add below AndroidManifest.xml application tag

```
<application>
...
@@ -140,6 +142,7 @@ The APIs related to scanning are as follows. For details, please refer to the Bl
// Call the isScanning method to see if it is scanning true: scanning; false: scanning stopped
 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.

```
@@ -248,8 +251,10 @@ Double.valueOf(ParseData.getKgWeight(bodyFatData.getWeight(),
bodyFatData.getDecimalInfo())), bodyFatData .getHeight(),
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
Instructions:

```
AicareBleConfig.getMoreFatData (int sex, int height, double weight,
double bfr, double rom, double pp)
@@ -263,13 +268,13 @@ Get an instance of WBYService.WBYBinder in BleProfileServiceReadyActivity.onServ
    @Override
    protected void onServiceBinded (WBYService.WBYBinder binder) {
        this.binder = binder;
      
   }
   // If the history is obtained
      binder.syncHistory ();
      
      
      
   // Part of the method of WBYBinder
   public class WBYBinder extends LocalBinder {

@@ -383,10 +388,10 @@ Get an instance of WBYService.WBYBinder in BleProfileServiceReadyActivity.onServ
        public void getDecimalInfo () {
            mManager.getDecimalInfo ();
        }
        
        ...
}
    
```

## Class description
@@ -542,6 +547,7 @@ Get an instance of WBYService.WBYBinder in BleProfileServiceReadyActivity.onServ
| double| muscleMass| Muscle mass
| double| protein| Protein amount
| MoreFatData.FatLevel fatLevel| Obesity grade

```
public static enum FatLevel {
UNDER, // Underweight
@@ -551,6 +557,7 @@ public static enum FatLevel {
FAT; overweight
}
```

- BleProfileService Connection Status

```
@@ -561,6 +568,7 @@ public static final int STATE_SERVICES_DISCOVERED = 2; // Discover services
public static final int STATE_INDICATION_SUCCESS = 3; // Enable success
public static final int STATE_TIME_OUT = 5; // connection timed out
```

- AicareBleConfig.SettingStatus Status information returned by the device

```
@@ -592,6 +600,7 @@ int SET_DID_FAILED = 24; // Set DID failed
int DATA_SEND_END = 25; // Measured data transmission is complete
int UNKNOWN = -1; // unknown
```

- WBYService Bluetooth information returned by the device

```
@@ -661,6 +670,7 @@ deviceType == AicareBleConfig.TYPE_WEI_TEMP is a connected scale with temperatur
- 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
2. When the app calculates the weight, it needs to pass in DecimalInfo (decimal object) for calculation

```
DecimalInfo {
    private int sourceDecimal; // The source data decimal places
@@ -671,6 +681,7 @@ DecimalInfo {
    private int lbGraduation; // lb division
}
```

- 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.


+ 10
- 5
README_CN.md View File

@@ -80,12 +80,14 @@ repositories {
## 开始接入

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

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

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

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

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

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

```
AicareBleConfig.getMoreFatData(int sex, int height, double weight,
double bfr, double rom, double pp)
@@ -603,12 +607,13 @@ public final static int USER_ID = 3; //用户编号
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.5| 2018/1/15| Suzy| 兼容新协议
|1.0.6| 2018/2/25| Suzy| 功能优化

Loading…
Cancel
Save