123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- /*
- * tcp_model.h
- *
- * Created on: 2022年10月6日
- * Author: Allen
- */
- #ifndef JNI_NET_TCP_MODEL_H_
- #define JNI_NET_TCP_MODEL_H_
- #include <string>
- #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";
- };
- 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 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";
- };
- 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"; // 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_ */
|