/* * 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"; /** 新增床旁交互Tcp类型 **/ inline static std::string SIGN_IN = "SIGN_IN"; inline static std::string POSITION = "POSITION"; inline static std::string COUNTDOWN = "COUNTDOWN"; inline static std::string ROOMCHECK = "ROOMCHECK"; inline static std::string SCREEN_TIP = "SCREEN_TIP"; inline static std::string AUTH = "AUTH"; }; 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"; inline static std::string SIP_RECONNECT = "SIP_RECONNECT"; }; class SosAction { public: inline static std::string CALL = "CALL"; inline static std::string CANCEL = "CANCEL"; inline static std::string ROOM_CALL = "ROOM_CALL"; }; 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 REBOOT = "REBOOT"; 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"; inline static std::string SERVER_CHANGE = "SERVER_CHANGE"; inline static std::string POWER_RESET = "POWER_RESET"; }; class DataAction { public: inline static std::string REFRESH = "REFRESH"; inline static std::string REMIND_OTHER = "REMIND_OTHER"; }; 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"; // sos呼叫 inline static std::string SOS_CANCEL = "SOS_CANCEL"; // sos取消 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 SignInAction { public: inline static std::string SIGN_IN = "SIGN_IN"; // 发起签到 inline static std::string SIGN_IN_SUCCESS = "SIGN_IN_SUCCESS"; // 签到成功 inline static std::string SIGN_IN_FAILED = "SIGN_IN_FAILED"; // 签到失败 }; class PositionAction { public: inline static std::string POSITION_START = "POSITION_START"; // 定位开始 inline static std::string POSITION_END = "POSITION_END"; // 结束定位 }; class CountdownAction { public: inline static std::string START = "START"; // 倒计时开始 inline static std::string END = "END"; // 倒计时结束 inline static std::string CANCEL = "CANCEL"; // 倒计时取消 }; class RoomCheckAction { public: inline static std::string START = "START"; // 巡房开始 inline static std::string END = "END"; // 巡房结束 }; class ScreenTipAction { public: inline static std::string START = "START"; // 提示语开始 inline static std::string QUIT = "QUIT"; // 提示语退出 }; class AuthAction { public: inline static std::string LOGIN = "LOGIN"; // 登录 inline static std::string LOGOUT = "LOGOUT"; // 退出登录 }; 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); void sendTcpModel(TcpModel tcpModel); #endif /* JNI_NET_TCP_MODEL_H_ */