alarmchannel.h 999 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef ALARMCHANNEL_H
  2. #define ALARMCHANNEL_H
  3. #include <QObject>
  4. #include <QTcpSocket>
  5. class SuObject {
  6. public:
  7. explicit SuObject(QString iotId="", QString istId="", quint16 type=0){
  8. IoTId = iotId;
  9. ISTId = istId;
  10. DevType = type;
  11. }
  12. QString iotId(){
  13. return IoTId;
  14. }
  15. QString istId(){
  16. return ISTId;
  17. }
  18. quint16 type(){
  19. return DevType;
  20. }
  21. private:
  22. QString IoTId;
  23. QString ISTId;
  24. quint16 DevType;
  25. };
  26. class AlarmChannel : public QObject
  27. {
  28. Q_OBJECT
  29. public:
  30. explicit AlarmChannel(QObject *parent = 0, QString ip="", quint16 port=0, QString termId="", QString termKey="");
  31. signals:
  32. void getData(QString data);
  33. void SoClose();
  34. public slots:
  35. void onConnected();
  36. void onTextMessageReceived();
  37. void onStatusChanged(QAbstractSocket::SocketState sta);
  38. private:
  39. QTcpSocket *so;
  40. QString Ip;
  41. quint16 Port;
  42. QString TermId;
  43. QString TermKey;
  44. };
  45. #endif // ALARMCHANNEL_H