devices.dart 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // ignore_for_file: non_constant_identifier_names
  2. import 'package:vnote_device_plugin/consts/status.dart';
  3. import 'package:vnote_device_plugin/consts/types.dart';
  4. abstract class DeviceConsts {
  5. static final Map<int, String> STATUS_DESC_MAP = {
  6. VDeviceEventStatus.PERMISSION_OFF_BT: "权限-BLUETOOTH 未开启",
  7. VDeviceEventStatus.PERMISSION_OFF_BT_ADMIN: "权限-BLUETOOTH_ADMIN 未开启",
  8. VDeviceEventStatus.PERMISSION_OFF_FINE_LOCATION:
  9. "权限-ACCESS_FINE_LOCATION 未开启",
  10. VDeviceEventStatus.PERMISSION_OFF_COARSE_LOCATION:
  11. "权限-ACCESS_COARSE_LOCATION 未开启",
  12. VDeviceEventStatus.PERMISSION_OFF_BT_SCAN: "权限-BLUETOOTH_SCAN 未开启",
  13. VDeviceEventStatus.PERMISSION_OFF_BT_ADVERTISE:
  14. "权限-BLUETOOTH_ADVERTISE 未开启",
  15. VDeviceEventStatus.PERMISSION_OFF_BT_CONNECT: "权限-BLUETOOTH_CONNECT 未开启",
  16. VDeviceEventStatus.CALLBACK_UNDEFINED: "外设SDK-未注册回调接口",
  17. VDeviceEventStatus.PARAM_ERROR: "外设SDK-参数传递错误",
  18. VDeviceEventStatus.DEVICE_UNSUPPORT: "不支持该型号设备驱动",
  19. // VDeviceEventStatus.BLE_NOT_ON: "蓝牙未开启",
  20. // VDeviceEventStatus.BLUETOOTH_CONNECTED_NO_NOTIFY: "蓝牙连接成功,注册通知失败",
  21. VDeviceEventStatus.DEVICE_NOT_MATCHED: "该蓝牙设备需要绑定配对",
  22. VDeviceEventStatus.DEVICE_MAC_INVALID: "蓝牙Mac地址无效",
  23. };
  24. static final Map<String, String> SDK_2_SERVER_TR_MAP = {
  25. DeviceTypes.TEMP: "Temp",
  26. DeviceTypes.WEIGHT: "BMI",
  27. DeviceTypes.SPO2: "SpO2",
  28. DeviceTypes.NIBP: "NIBP",
  29. DeviceTypes.SUGAR: "GLU",
  30. DeviceTypes.URINE: "Urine",
  31. DeviceTypes.IC_READER: "ICReader",
  32. DeviceTypes.HEART: "HEART",
  33. };
  34. /// 将SDK 设备类型 翻译成 服务中的设备Key
  35. static String transType2ServerKey(String sdkDeviceType) {
  36. return SDK_2_SERVER_TR_MAP[sdkDeviceType] ?? sdkDeviceType;
  37. }
  38. }