SocketMsgModel.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. //
  2. // SocketMsgModel.h
  3. // OneCable
  4. //
  5. // Created by KaRam Kim on 2017. 4. 20..
  6. // Copyright © 2017년 ntels. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "JDJSONModel.h"
  10. #define MSG_TYPE_LOGIN @"auth"
  11. #define MSG_TYPE_DEVICE_ALIVE @"device.alive"
  12. #define MSG_TYPE_AUTO_LOGIN @"auth.auto"
  13. #define MSG_TYPE_DEVICE_COMMAND @"device.command"
  14. #define MSG_TYPE_DEVICE_COMMAND_RES @"device.command.result"
  15. #define MSG_TYPE_NODE_COMMAND @"node.command"
  16. #define MSG_TYPE_NODE_COMMAND_RES @"node.command.result"
  17. #define MSG_TYPE_NODE_DELETE @"node.delete"
  18. #define MSG_TYPE_NODE_DELETE_RES @"node.delete.result"
  19. #define MSG_TYPE_NODE_REGIST_RES @"node.register.result"
  20. #define MSG_TYPE_NODE_PROFILE_UPDATE @"node.profile.update"
  21. #define MSG_TYPE_NODE_PROFILE_UPDATE_RES @"node.profile.update.result"
  22. #define MSG_TYPE_DEVICE_CONTENT @"device.content"
  23. #define MSG_TYPE_NODE_CONTENT @"node.content"
  24. #define MSG_TYPE_DEVICE_CONN @"device.conn"
  25. #define MSG_TYPE_FIRMWARE_UPGRADE @"firmware.upgrade"
  26. #define MSG_TYPE_FIRMWARE_UPGRADE_RESULT @"firmware.upgrade.result"
  27. #define MSG_TYPE_SOFTWARE_UPGRADE @"software.upgrade"
  28. #define MSG_TYPE_SOFTWARE_UPGRADE_RESULT @"software.upgrade.result"
  29. #define MSG_TYPE_NODES_RELOAD @"nodes.reload"
  30. #define CMD_TYPE_PAIRING_START @"pairing_start"
  31. #define CMD_TYPE_PAIRING_STOP @"pairing_stop"
  32. #define CMD_TYPE_UNPAIRING_START @"unpairing_start"
  33. #define CMD_TYPE_UNPAIRING_STOP @"pairing_stop"
  34. #define CMD_TYPE_FORCE_NODE_DEL @"unpairing_node"
  35. #define CMD_TYPE_CONTROL @"control"
  36. #define CMD_TYPE_STATE @"state"
  37. #define CONT_TYPE_PERIODIC @"periodic_data"
  38. #define CONT_TYPE_NONPERIODIC @"nonperiodic_data"
  39. #define CONT_TYPE_FAULT @"fault_data"
  40. #define CONT_TYPE_FAULT_CLEAR @"fault_clear_data"
  41. #define CONT_TYPE_LOB @"lob"
  42. #define CONT_TYPE_META @"meta"
  43. @interface SocketRequestModel : SocketModel
  44. @property (copy, nonatomic) NSDictionary *requestMsg;
  45. //-(void)setRequestId:(int)requestId;
  46. -(NSString *)getSendMessage;
  47. -(id)initWithMsgType:(NSString *)msgType;
  48. @end
  49. @interface SocketReponseModel : SocketModel
  50. @property (copy, nonatomic) NSString *commandId;
  51. @property (copy, nonatomic) NSString *commandStatus;
  52. @property (copy, nonatomic) NSString *commandType;
  53. @property (copy, nonatomic) NSString *requestTime;
  54. @property (copy, nonatomic) NSString *responseTime;
  55. @end
  56. @protocol CommandTyepModel;
  57. @interface CommandTypeModel : JDJSONModel
  58. @property (copy, nonatomic) NSString *commandclassId;
  59. @property (copy, nonatomic) NSString *value;
  60. @end
  61. @interface CommandModel : SocketReponseModel
  62. @property (copy, nonatomic) CommandTypeModel *responseValue;
  63. @property (copy, nonatomic) NSString *commandMessage;
  64. @end
  65. @protocol SoKDeviceModel;
  66. @interface SoKDeviceModel : SocketReponseModel
  67. @property (copy, nonatomic) NSString *deviceId;
  68. @property (copy, nonatomic) NSString *deviceManufacturer;
  69. @property (copy, nonatomic) NSString *deviceModelNumber;
  70. @property (copy, nonatomic) NSString *deviceSerialNumber;
  71. @property (copy, nonatomic) NSString *deviceProfileVersion;
  72. @property (copy, nonatomic) NSString *devicePassword;
  73. @property (copy, nonatomic) NSString *deviceKey;
  74. @end
  75. @protocol SoKDeviceWorkModel;
  76. @interface SoKDeviceWorkModel : SocketReponseModel
  77. @property (copy, nonatomic) NSString *work_type;
  78. @property (copy, nonatomic) NSString *work_result;
  79. @end
  80. @protocol SoKNodeModel;
  81. @interface SoKNodeModel : SoKDeviceModel
  82. @property (copy, nonatomic) NSString *nodeManufacturer;
  83. @property (copy, nonatomic) NSString *nodeModelNumber;
  84. @property (copy, nonatomic) NSString *nodeProfileVersion;
  85. @property (copy, nonatomic) NSString *nodeSerialNumber;
  86. @property (copy, nonatomic) NSString *nodeName;
  87. @property (copy, nonatomic) NSString *nodeId;
  88. @property (copy, nonatomic) NSString *prdName;
  89. @property (copy, nonatomic) NSString *prdUserName;
  90. @property (copy, nonatomic) NSString *delYn;
  91. @end
  92. @interface ContentModel : SoKNodeModel
  93. @property (copy, nonatomic) NSString *contentId;
  94. @property (copy, nonatomic) NSString *contentType ;
  95. @property (copy, nonatomic) NSString *contentValue;
  96. @property (copy, nonatomic) NSString *createTime;
  97. @property (copy, nonatomic) NSString *collectTime;
  98. @end
  99. @interface ContentDeviceModel : SocketModel
  100. @property (copy, nonatomic) NSString *deviceId;
  101. @property (copy, nonatomic) NSString *contentId;
  102. @property (copy, nonatomic) NSString *contentType;
  103. @property (copy, nonatomic) NSDictionary *contentValue;
  104. @property (copy, nonatomic) NSString *createTime;
  105. @property (copy, nonatomic) NSString *messageType;
  106. @property (copy, nonatomic) NSString *collectionTime;
  107. @end
  108. @interface DeviceConnectionModel : SocketModel
  109. @property (copy, nonatomic) NSString *deviceId;
  110. @property (copy, nonatomic) NSString *messageType;
  111. @property (copy, nonatomic) NSString *deviceConn;
  112. @property (copy, nonatomic) NSString *deviceConnLastDatetime;
  113. @end