SmartOS/TokenNet/DeviceMessage.h

54 lines
1.1 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __DeviceMessage_H__
#define __DeviceMessage_H__
#include "Message\MessageBase.h"
#include "Net\Net.h"
enum class DeviceAtions
{
// <summary>信息列表。请求ID列表响应设备信息列表</summary>
List,
// <summary>更新。请求设备信息列表响应ID列表</summary>
Update,
// <summary>注册。请求设备信息列表响应ID列表</summary>
Register,
// <summary>上线。请求响应ID列表</summary>
Online,
// <summary>下线。请求响应ID列表</summary>
Offline,
// <summary>删除。请求响应ID列表</summary>
Delete,
};
// 设备消息
class DeviceMessage : public MessageBase
{
public:
ByteArray HardID; // 硬件ID
ByteArray Key; // 登录密码
ByteArray Salt; // 加盐
IPEndPoint Local; // 内网地址
bool Reply; // 是否响应
// 初始化消息各字段为0
DeviceMessage();
// 从数据流中读取消息
virtual bool Read(Stream& ms);
// 把消息写入数据流中
virtual void Write(Stream& ms) const;
// 显示消息内容
#if DEBUG
virtual String& ToStr(String& str) const;
#endif
};
#endif