SocketMsgModel.h 5.1 KB

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