panlili2024
2024-11-11 145de2dcd3124f236e7d06bcdee17c7be08048b1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.hdl.sdk.ttl.HDLDeviceManger.Core;
 
import android.content.Context;
 
import com.hdl.sdk.ttl.Utils.LogUtils.HDLLog;
 
/**
 * Created by JLChen on 2019/7/25
 */
public class HDLTtlSdk {
 
    /**
     * 初始化 SDK
     *
     * @param context
     */
    public static void init(Context context, String mPathname, int mBaudrate) {
        HDLDeviceManager.init(context);
        HDLDeviceManager.setIsGetBusLightState(true);//根据是否bus网关设置
        HDLSerialPortCore.setIsModule(true);//根据是否带模组设置
        HDLSerialPortCore.initHDLSerialPort(mPathname, mBaudrate);
    }
 
    /**
     * 是否开启SDK日志打印
     *
     * @param bOpen
     */
    public static void setHDLLogOpen(boolean bOpen) {
        HDLLog.setHDLLogOpen(bOpen);
    }
 
    /**
     * 释放资源 关闭串口
     */
    public static void release() {
        HDLDeviceManager.release();
    }
}