BluetoothDeviceConfig.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using UnityEngine;
  2. namespace SmartBowSDK
  3. {
  4. public class BluetoothDeviceConfig
  5. {
  6. public string deviceName;
  7. public string service;
  8. public string characteristicWrite;
  9. public string characteristicNotify;
  10. public static BluetoothDeviceConfig GetDefault()
  11. {
  12. BluetoothDeviceConfig config = new BluetoothDeviceConfig();
  13. //两个设备匹配
  14. config.deviceName = string.Join(" | ", new[] {
  15. "Bbow_20210501",
  16. "HOUYI Pro",
  17. "Pistol",
  18. "Pistol M9",
  19. "Pistol M17",
  20. "Rifle M416",
  21. "ARTEMIS Pro",//游戏弓
  22. "APOLLO", //KIT
  23. "WDF-Baseball"//棒球
  24. });
  25. if (Application.platform == RuntimePlatform.Android)
  26. {
  27. config.service = "0000fff0";
  28. config.characteristicWrite = "0000fff2";
  29. config.characteristicNotify = "0000fff1";
  30. }
  31. else if (Application.platform == RuntimePlatform.IPhonePlayer)
  32. {
  33. config.service = "fff0";
  34. config.characteristicWrite = "fff2";
  35. config.characteristicNotify = "fff1";
  36. }
  37. return config;
  38. }
  39. }
  40. }