SocketMsgModel.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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_FIRMWARE_UPGRADE @"firmware.upgrade"
  25. #define MSG_TYPE_FIRMWARE_UPGRADE_RESULT @"firmware.upgrade.result"
  26. #define MSG_TYPE_SOFTWARE_UPGRADE @"software.upgrade"
  27. #define MSG_TYPE_SOFTWARE_UPGRADE_RESULT @"software.upgrade.result"
  28. #define MSG_TYPE_NODES_RELOAD @"nodes.reload"
  29. #define CMD_TYPE_PAIRING_START @"pairing_start"
  30. #define CMD_TYPE_PAIRING_STOP @"pairing_stop"
  31. #define CMD_TYPE_UNPAIRING_START @"unpairing_start"
  32. #define CMD_TYPE_UNPAIRING_STOP @"pairing_stop"
  33. #define CMD_TYPE_FORCE_NODE_DEL @"unpairing_node"
  34. #define CMD_TYPE_CONTROL @"control"
  35. #define CMD_TYPE_STATE @"state"
  36. #define CONT_TYPE_PERIODIC @"periodic_data"
  37. #define CONT_TYPE_NONPERIODIC @"nonperiodic_data"
  38. #define CONT_TYPE_FAULT @"fault_data"
  39. #define CONT_TYPE_FAULT_CLEAR @"fault_clear_data"
  40. #define CONT_TYPE_LOB @"lob"
  41. #define CONT_TYPE_META @"meta"
  42. @interface SocketRequestModel : SocketModel
  43. @property (copy, nonatomic) NSDictionary *requestMsg;
  44. //-(void)setRequestId:(int)requestId;
  45. -(NSString *)getSendMessage;
  46. -(id)initWithMsgType:(NSString *)msgType;
  47. @end
  48. @interface SocketReponseModel : SocketModel
  49. @property (copy, nonatomic) NSString *commandId;
  50. @property (copy, nonatomic) NSString *commandStatus;
  51. @property (copy, nonatomic) NSString *commandType;
  52. @property (copy, nonatomic) NSString *requestTime;
  53. @property (copy, nonatomic) NSString *responseTime;
  54. @end
  55. @protocol CommandTyepModel;
  56. @interface CommandTypeModel : JDJSONModel
  57. @property (copy, nonatomic) NSString *commandclassId;
  58. @property (copy, nonatomic) NSString *value;
  59. @end
  60. @interface CommandModel : SocketReponseModel
  61. @property (copy, nonatomic) CommandTypeModel *responseValue;
  62. @property (copy, nonatomic) NSString *commandMessage;
  63. @end
  64. @protocol SoKDeviceModel;
  65. @interface SoKDeviceModel : SocketReponseModel
  66. @property (copy, nonatomic) NSString *deviceId;
  67. @property (copy, nonatomic) NSString *deviceManufacturer;
  68. @property (copy, nonatomic) NSString *deviceModelNumber;
  69. @property (copy, nonatomic) NSString *deviceSerialNumber;
  70. @property (copy, nonatomic) NSString *deviceProfileVersion;
  71. @property (copy, nonatomic) NSString *devicePassword;
  72. @property (copy, nonatomic) NSString *deviceKey;
  73. @end
  74. @protocol SoKNodeModel;
  75. @interface SoKNodeModel : SoKDeviceModel
  76. @property (copy, nonatomic) NSString *nodeManufacturer;
  77. @property (copy, nonatomic) NSString *nodeModelNumber;
  78. @property (copy, nonatomic) NSString *nodeProfileVersion;
  79. @property (copy, nonatomic) NSString *nodeSerialNumber;
  80. @property (copy, nonatomic) NSString *nodeName;
  81. @property (copy, nonatomic) NSString *nodeId;
  82. @property (copy, nonatomic) NSString *prdName;
  83. @property (copy, nonatomic) NSString *prdUserName;
  84. @property (copy, nonatomic) NSString *delYn;
  85. @end
  86. @interface ContentModel : SoKNodeModel
  87. @property (copy, nonatomic) NSString *contentId;
  88. @property (copy, nonatomic) NSString *contentType ;
  89. @property (copy, nonatomic) NSString *contentValue;
  90. @property (copy, nonatomic) NSString *createTime;
  91. @property (copy, nonatomic) NSString *collectTime;
  92. @end