constant.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package constant
  2. const (
  3. RoleAdmin = 1
  4. RoleNormal = 0
  5. DefaultPassword = "e10adc3949ba59abbe56e057f20f883e" //系统默认密码123456
  6. FilterNameECG = "BW-ECG*"
  7. FilterNameEEG = "MIND*"
  8. FilterNameALL = "BW-ECG*,MIND*"
  9. BindUserInfoCmdPrefix = "e841aa" //绑定用户信息指令头
  10. SetTimeCmdPrefix = "e840"
  11. StartCollectCmdPrefix = "e823"
  12. StartTransCmd = "e82001363380"
  13. StopTransCmd = "0xe826"
  14. StopCollectCmd = "0xe822"
  15. // EcgDefaultAge ECG默认用户信息
  16. EcgDefaultAge = 20 //年龄默认值20
  17. EcgDefaultHeight = 170
  18. EcgDefaultWeight = 65
  19. MaxNameByteLength = 12
  20. DefaultPlaceHolder = "00"
  21. // MessageTypeDeviceScanned websocket 消息类型 扫描到设备
  22. MessageTypePayload = "payload"
  23. MessageTypeDeviceScanned = "device"
  24. MessageTypeEEGData = "eegData"
  25. MessageTypeECGData = "ecgData"
  26. MessageTypeCloseScan = "closeScan"
  27. MessageTypeStartScan = "startScan"
  28. MessageTypeFilter = "filter"
  29. MessageTypeSUUID = "suuid"
  30. MessageTypeConnect = "connect"
  31. MessageTypeDisConnect = "disConnect"
  32. MessageTypeConnectList = "connectedList"
  33. MessageTypeWNP = "wnp"
  34. // DefaultKey 3des
  35. DefaultKey = "240262447423713749922240"
  36. DefaultIv = "12345678"
  37. TopicConnectSub = "/connect_packet/connect1_subscribe"
  38. /*V2指令*/
  39. CmdStopScan = "[{\"cmd\":\"AT+SCAN=\",\"s\":\"0\"}]"
  40. CmdStartScan = "[{\"cmd\":\"AT+SCAN=\",\"s\":\"1\"}]"
  41. CmdSetUUID = "[{\"cmd\":\"AT+SUUID=\",\"total\":\"1\"},{\"a\":\"FFF0\"}]"
  42. Success = "SUCCESS"
  43. //v2 payload case
  44. PayloadScan = "SCAN" //扫描|关闭扫描响应
  45. PayloadFLT = "FLT" //设置过滤
  46. PayloadSUUID = "SUUID" //设置服务UUID
  47. PayloadConnect = "CONNECT" //连接设备
  48. PayloadDisConnect = "DISSCONNECT" //断开连接设备
  49. PayloadQuenue = "QUENUE" //已连接设备
  50. PayloadCNB = "CNB" //连接个数
  51. PayloadNotify = "NOTIFY"
  52. PayloadWNP = "WNP"
  53. )