Bläddra i källkod

fix: doc

master
larryzhang 2 år sedan
förälder
incheckning
54b91ea5ac
2 ändrade filer med 20 tillägg och 19 borttagningar
  1. 11
    10
      README.md
  2. 9
    9
      README_CN.md

+ 11
- 10
README.md Visa fil

|---------|------------:| ---------: | ----------------- | |---------|------------:| ---------: | ----------------- |
| v1.0 | 2019/07/08 |JosonXiong | Preliminary version | | v1.0 | 2019/07/08 |JosonXiong | Preliminary version |
|v1.1.1 |2023/06/26 |Larry| Document filing | |v1.1.1 |2023/06/26 |Larry| Document filing |


## Table of Contents ## Table of Contents


## 1st、The conditions of use ## 1st、The conditions of use
Minimum version iOS 8.0 Minimum version iOS 8.0
The Bluetooth version used by the device requires 4.0 and above. The Bluetooth version used by the device requires 4.0 and above.

## 2nd、Use ## 2nd、Use
1. Import TPSMSleSDK.framework into the Xcode project.
2. Add "Privacy-Bluetooth Always Usage Description" to the info.plist file;
3. Import "#import <TPMSBleSDK/ELTPMSBleManager.h>" to the controller you want to use, and follow the "<ELTPMSBleManagerDelegate>" protocol.
4. Set delegate
##### 1. Import TPSMSleSDK.framework into the Xcode project.
##### 2. Add "Privacy-Bluetooth Always Usage Description" to the info.plist file;
##### 3. Import "#import <TPMSBleSDK/ELTPMSBleManager.h>" to the controller you want to use, and follow the "<ELTPMSBleManagerDelegate>" protocol.
##### 4. Set delegate
``` ```
[ELTPMSBleManager shareManager].delegate = self; [ELTPMSBleManager shareManager].delegate = self;
``` ```
5.Implementing proxy method
##### 5.Implementing proxy method
``` ```
-(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state; -(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state;
-(void)TPMSBleManagerReceiveData:(ELTPMSDataModel *_Nonnull)model; -(void)TPMSBleManagerReceiveData:(ELTPMSDataModel *_Nonnull)model;
``` ```


## 3rd、Get broadcast data ## 3rd、Get broadcast data
### 1.Determine if the phone Bluetooth is available
##### 1.Determine if the phone Bluetooth is available
Proxy method: Proxy method:
``` ```
-(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state; -(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state;
[ELTPMSBleManager shareManager].isOn [ELTPMSBleManager shareManager].isOn
``` ```
Get current Bluetooth enabled is available; Get current Bluetooth enabled is available;
### 2.Start scanning
##### 2.Start scanning
``` ```
[[ELTPMSBleManager shareManager] startScan]; [[ELTPMSBleManager shareManager] startScan];
``` ```
### 3.Stop scanning
##### 3.Stop scanning
``` ```
[[ELTPMSBleManager shareManager] stopScan]; [[ELTPMSBleManager shareManager] stopScan];
``` ```
### 4.Method description
##### 4.Method description
``` ```
-(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state; -(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state;
``` ```

+ 9
- 9
README_CN.md Visa fil

最低版本iOS 8.0 最低版本iOS 8.0
设备所使用的蓝牙版本需要4.0及以上 设备所使用的蓝牙版本需要4.0及以上
## 二、开始使用 ## 二、开始使用
1.将 TPMSBleSDK.framework 导入Xcode工程;
2.在info.plist文件中加入“Privacy - Bluetooth Always Usage Description”
3.在需要使用的 控制器.m 中导入 #import <TPMSBleSDK/ELTPMSBleManager.h>,并遵守 < ELTPMSBleManagerDelegate> 协议;
4.设置代理
##### 1.将 TPMSBleSDK.framework 导入Xcode工程;
##### 2.在info.plist文件中加入“Privacy - Bluetooth Always Usage Description”;
##### 3.在需要使用的 控制器.m 中导入 #import <TPMSBleSDK/ELTPMSBleManager.h>,并遵守 < ELTPMSBleManagerDelegate> 协议;
##### 4.设置代理


``` ```
[ELTPMSBleManager shareManager].delegate = self; [ELTPMSBleManager shareManager].delegate = self;
``` ```


5.实现代理方法
##### 5.实现代理方法


``` ```
-(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state; -(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state;
``` ```


## 三、获取广播数据 ## 三、获取广播数据
### 1.判断手机蓝牙是否可用
##### 1.判断手机蓝牙是否可用
可通过代理方法: 可通过代理方法:
``` ```
-(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state; -(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state;
[ELTPMSBleManager shareManager].isOn; [ELTPMSBleManager shareManager].isOn;
``` ```
获取当前蓝牙是否打开可用; 获取当前蓝牙是否打开可用;
### 2.开始扫描
##### 2.开始扫描
``` ```
[[ELTPMSBleManager shareManager] startScan]; [[ELTPMSBleManager shareManager] startScan];
``` ```
### 3.停止扫描
##### 3.停止扫描
``` ```
[[ELTPMSBleManager shareManager] stopScan]; [[ELTPMSBleManager shareManager] stopScan];
``` ```
### 4.代理方法说明
##### 4.代理方法说明
``` ```
-(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state; -(void)TPMSBleManagerUpdateBleState:(TPMSBluetoothState)state;
``` ```

Laddar…
Avbryt
Spara