Class BleDevice

java.lang.Object
com.yasee.yasee.ble.BleDevice

public class BleDevice extends Object
蓝牙连接设备类
  • Field Details

    • device

      public final BluetoothDevice device
      系统蓝牙对象
    • advertisementData

      public final AdvertisementData advertisementData
      广播数据
    • current

      public static BleDevice current
      当前使用的设备
    • battery

      public int battery
      获取电量信息 (默认为0) battery 电量
  • Constructor Details

  • Method Details

    • getGatt

      public BluetoothGatt getGatt()
      获取当前的Gatt
      Returns:
      the gatt
    • connect

      public void connect()
      连接设备
    • disConnect

      public void disConnect()
      关闭设备
    • send

      public void send(byte[] data)
      发送指令信息
      Parameters:
      data - the data
    • send

      public void send(Integer check, UUID cmd, HashMap<String,Object> parms)
    • getBleProcess

      public BleProcess getBleProcess()
      设备的连接状态
      Returns:
      the ble process
    • getModel

      public String getModel()
      设备注册型号
      Returns:
      the model
    • getMac

      public String getMac()
      设备的Mac地址
      Returns:
      the mac
    • getPlatform

      public Platforms getPlatform()
      获取平台信息
      Returns:
      the platform
    • refreshDeviceCache

      public void refreshDeviceCache()
      清理Gatt 缓存数据