/* * tcp_model.h * * Created on: 2022年10月6日 * Author: Allen */ #ifndef JNI_NET_TCP_MODEL_H_ #define JNI_NET_TCP_MODEL_H_ #include #include "net.h" #include "json/json.h" class TcpType{ public: inline static std::string OTHER = "OTHER"; inline static std::string VOICE = "VOICE"; inline static std::string SOS = "SOS"; inline static std::string REINFORCE = "REINFORCE"; inline static std::string EVENT = "EVENT"; inline static std::string DEVICE = "DEVICE"; inline static std::string DATA = "DATA"; inline static std::string TIME = "TIME"; inline static std::string SIDE = "SIDE"; inline static std::string CALLBACK = "CALLBACK"; }; class VoiceAction { public: inline static std::string CALL = "CALL"; inline static std::string ACCEPT = "ACCEPT"; inline static std::string REJECT = "REJECT"; inline static std::string CALLING = "CALLING"; inline static std::string TRANSFER = "TRANSFER"; inline static std::string HANDOFF = "HANDOFF"; inline static std::string CANCEL = "CANCEL"; inline static std::string SUCCESS = "SUCCESS"; inline static std::string FAILED = "FAILED"; inline static std::string CANCEL_BY_DOOR = "CANCEL_BY_DOOR"; }; class SosAction { public: inline static std::string CALL = "CALL"; inline static std::string CANCEL = "CANCEL"; }; class EventAction { public: inline static std::string KEY_CLICK = "KEY_CLICK"; // 按键事件 inline static std::string RESPONSE = "RESPONSE"; // 响应 inline static std::string RECEIVED = "RECEIVED"; inline static std::string CANCEL = "CANCEL"; inline static std::string CANCEL_CONFIRM = "CANCEL_CONFIRM"; inline static std::string COMPLETED = "COMPLETED"; inline static std::string NO_TARGET = "NO_TARGET"; inline static std::string NO_MATCH = "NO_MATCH"; }; class DeviceAction { public: inline static std::string RESTART = "RESTART"; inline static std::string CONNECT = "CONNECT"; inline static std::string APP_UPDATE = "APP_UPDATE"; inline static std::string DEVICE_REFRESH = "DEVICE_REFRESH"; inline static std::string SYSTEM_SETTING = "SYSTEM_SETTING"; }; class DataAction { public: inline static std::string REFRESH = "REFRESH"; }; class ReinforceAction { public: inline static std::string CALL="CALL"; inline static std::string RESPONSED="RESPONSED"; }; class TimeAction { public: inline static std::string SYNC = "SYNC"; }; class SideAction { public: inline static std::string CALL = "CALL"; // 护理 inline static std::string ACCEPT = "ACCEPT"; // 护理 inline static std::string CANCEL = "CANCEL"; // 护理 inline static std::string SOS_CALL = "SOS_CALL"; // 护理 inline static std::string SOS_CANCEL = "SOS_CANCEL"; // 护理 inline static std::string NURSING = "NURSING"; // 护理 inline static std::string NURSING_END = "NURSING_END"; // 护理结束 }; class CallbackAction { public: inline static std::string ACK = "ACK"; // 反馈 inline static std::string SUCCESS = "SUCCESS"; // 同步 inline static std::string FAILED = "FAILED"; // 失败 }; class TcpAction{ VoiceAction voiceAction; }; struct TcpModel{ std::string tid; std::string type; std::string action; int from_id; int to_id; std::string data = ""; Json::Value json = NULL; }; std::string getTcpModelString(TcpModel model); TcpModel getTcpModel(byte* inBytes); #endif /* JNI_NET_TCP_MODEL_H_ */