lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /** |
| 2 | * @file poc_msg.h |
| 3 | * @brief ¶¨ÒåPOCºǫ́·þÎñÓëMMI½»»¥µÄÏûÏ¢½Ó¿Ú |
| 4 | * |
| 5 | * Copyright (C) 2019 Sanechips Technology Co., Ltd. |
| 6 | * @author |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #ifndef __POC_MSG_H |
| 15 | #define __POC_MSG_H |
| 16 | /******************************************************************************* |
| 17 | * Include header files * |
| 18 | ******************************************************************************/ |
| 19 | /* Include "app/include/message.h". */ |
| 20 | #include "message.h" |
| 21 | |
| 22 | /******************************************************************************* |
| 23 | * Macro definitions * |
| 24 | ******************************************************************************/ |
| 25 | #define POC_SVR_PRINT 0 |
| 26 | #define SVRPOC "[PTT]" |
| 27 | #define POC_PRINT "[PTT]" |
| 28 | #if POC_SVR_PRINT |
| 29 | #define POC_SVR_LOG(format, ...) \ |
| 30 | do { \ |
| 31 | slog(POC_PRINT,SLOG_NORMAL,format,##__VA_ARGS__ );\ |
| 32 | } while(0) |
| 33 | |
| 34 | #define POC_SVR_LOG_ERR(format, ...) \ |
| 35 | do { \ |
| 36 | slog(POC_PRINT,SLOG_ERR,format,##__VA_ARGS__ );\ |
| 37 | } while(0) |
| 38 | #else |
| 39 | #define POC_SVR_LOG(format, ...) \ |
| 40 | do { \ |
| 41 | printf(format,##__VA_ARGS__); \ |
| 42 | } while(0) |
| 43 | |
| 44 | #define POC_SVR_LOG_ERR(format, ...) \ |
| 45 | do { \ |
| 46 | printf(format,##__VA_ARGS__); \ |
| 47 | } while(0) |
| 48 | #endif |
| 49 | |
| 50 | /*×î´óÃû³Æ³¤¶È*/ |
| 51 | #define SVRPOC_NAME_LENTH_MAX 32 |
| 52 | /*×î´ó×éÊýÄ¿*/ |
| 53 | #define SVRPOC_GROUP_NUMBER_MAX 32 |
| 54 | /*×î´ó³ÉÔ±ÊýÄ¿*/ |
| 55 | #define SVRPOC_MEMBERS_NUMBER_MAX 32 |
| 56 | |
| 57 | /*Îı¾ÐÅÏ¢×î´ó³¤¶È*/ |
| 58 | #define SVRPOC_TEXT_INFO_MAX 256 |
| 59 | |
| 60 | /*ÉÏËÍÏûÏ¢¶¨Òå*/ |
| 61 | #define SVRPOC_BASE MSG_CMD_POCSVR_BASE |
| 62 | |
| 63 | #define SVRPOC_INIT_CHECK_REQ (SVRPOC_BASE + 1) |
| 64 | #define SVRPOC_INIT_CHECK_RSP (SVRPOC_BASE + 2) |
| 65 | |
| 66 | #define SVRPOC_USER_LOGIN_REQ (SVRPOC_BASE + 3) |
| 67 | #define SVRPOC_USER_LOGIN_RSP (SVRPOC_BASE + 4) |
| 68 | |
| 69 | #define SVRPOC_USER_LOGOUT_REQ (SVRPOC_BASE + 5) |
| 70 | #define SVRPOC_USER_LOGOUT_RSP (SVRPOC_BASE + 6) |
| 71 | |
| 72 | #define SVRPOC_GET_GROUPLIST_REQ (SVRPOC_BASE + 7) |
| 73 | #define SVRPOC_GET_GROUPLIST_RSP (SVRPOC_BASE + 8) |
| 74 | |
| 75 | #define SVRPOC_GET_MEMBERS_REQ (SVRPOC_BASE + 9) |
| 76 | #define SVRPOC_GET_MEMBERS_RSP (SVRPOC_BASE + 10) |
| 77 | |
| 78 | #define SVRPOC_SEARCH_MEMBERS_REQ (SVRPOC_BASE + 11) |
| 79 | #define SVRPOC_SEARCH_MEMBERS_RSP (SVRPOC_BASE + 12) |
| 80 | |
| 81 | #define SVRPOC_GET_FRIENDS_REQ (SVRPOC_BASE + 13) |
| 82 | #define SVRPOC_GET_FRIENDS_RSP (SVRPOC_BASE + 14) |
| 83 | |
| 84 | #define SVRPOC_SEARCH_FRIENDS_REQ (SVRPOC_BASE + 15) |
| 85 | #define SVRPOC_SEARCH_FRIENDS_RSP (SVRPOC_BASE + 16) |
| 86 | |
| 87 | |
| 88 | #define SVRPOC_GET_USERINFO_REQ (SVRPOC_BASE + 17) |
| 89 | #define SVRPOC_GET_USERINFO_RSP (SVRPOC_BASE + 18) |
| 90 | |
| 91 | #define SVRPOC_GET_LOCATION_INFO_REQ (SVRPOC_BASE + 19) |
| 92 | #define SVRPOC_GET_LOCATION_INFO_RSP (SVRPOC_BASE + 20) |
| 93 | |
| 94 | #define SVRPOC_GET_ACCOUNT_INFO_REQ (SVRPOC_BASE + 21) |
| 95 | #define SVRPOC_GET_ACCOUNT_INFO_RSP (SVRPOC_BASE + 22) |
| 96 | |
| 97 | #define SVRPOC_HARDWARE_UPGRADE_REQ (SVRPOC_BASE + 23) |
| 98 | #define SVRPOC_HARDWARE_UPGRADE_RSP (SVRPOC_BASE + 24) |
| 99 | |
| 100 | #define SVRPOC_JOIN_GROUP_REQ (SVRPOC_BASE + 25) |
| 101 | #define SVRPOC_JOIN_GROUP_RSP (SVRPOC_BASE + 26) |
| 102 | |
| 103 | #define SVRPOC_JOIN_TEMPORARY_GROUP_REQ (SVRPOC_BASE + 27) |
| 104 | #define SVRPOC_JOIN_TEMPORARY_GROUP_RSP (SVRPOC_BASE + 28) |
| 105 | |
| 106 | #define SVRPOC_GET_MIC_REQ (SVRPOC_BASE + 29) |
| 107 | #define SVRPOC_GET_MIC_RSP (SVRPOC_BASE + 30) |
| 108 | |
| 109 | #define SVRPOC_RELEASE_MIC_REQ (SVRPOC_BASE + 31) |
| 110 | #define SVRPOC_RELEASE_MIC_RSP (SVRPOC_BASE + 32) |
| 111 | |
| 112 | #define SVRPOC_USER_ACTIVITY_REQ (SVRPOC_BASE + 33) |
| 113 | #define SVRPOC_USER_ACTIVITY_RSP (SVRPOC_BASE + 34) |
| 114 | |
| 115 | #define SVRPOC_GET_ONLINE_MEMBERS_REQ (SVRPOC_BASE + 35) |
| 116 | #define SVRPOC_GET_ONLINE_MEMBERS_RSP (SVRPOC_BASE + 36) |
| 117 | |
| 118 | #define SVRPOC_PTT_PUSH_REQ (SVRPOC_BASE + 37) |
| 119 | #define SVRPOC_PTT_PUSH_RSP (SVRPOC_BASE + 38) |
| 120 | |
| 121 | #define SVRPOC_PTT_RELEASE_REQ (SVRPOC_BASE + 39) |
| 122 | #define SVRPOC_PTT_RELEASE_RSP (SVRPOC_BASE + 40) |
| 123 | |
| 124 | #define SVRPOC_PTT_IS_MEMBER_LOST_REQ (SVRPOC_BASE + 41) |
| 125 | #define SVRPOC_PTT_IS_MEMBER_LOST_RSP (SVRPOC_BASE + 42) |
| 126 | |
| 127 | #define SVRPOC_SCAN_MEMBER_STATE_REQ (SVRPOC_BASE + 43) |
| 128 | #define SVRPOC_SCAN_MEMBER_STATE_RSP (SVRPOC_BASE + 44) |
| 129 | |
| 130 | #define SVRPOC_USER_LIFE_INIT_REQ (SVRPOC_BASE + 45) |
| 131 | #define SVRPOC_USER_LIFE_INIT_RSP (SVRPOC_BASE + 46) |
| 132 | |
| 133 | #define SVRPOC_ENTER_SELECT_GROUP_REQ (SVRPOC_BASE + 47) |
| 134 | #define SVRPOC_ENTER_SELECT_GROUP_RSP (SVRPOC_BASE + 48) |
| 135 | |
| 136 | #define SVRPOC_ENTER_SELECT_MEMBER_REQ (SVRPOC_BASE + 49) |
| 137 | #define SVRPOC_ENTER_SELECT_MEMBER_RSP (SVRPOC_BASE + 50) |
| 138 | |
| 139 | #define SVRPOC_ENTER_SELECT_PLAY_GROUP_REQ (SVRPOC_BASE + 51) |
| 140 | #define SVRPOC_ENTER_SELECT_PLAY_GROUP_RSP (SVRPOC_BASE + 52) |
| 141 | |
| 142 | #define SVRPOC_SELECT_MEMBER_UP_REQ (SVRPOC_BASE + 53) |
| 143 | #define SVRPOC_SELECT_MEMBER_UP_RSP (SVRPOC_BASE + 54) |
| 144 | |
| 145 | #define SVRPOC_SELECT_MEMBER_DOWN_REQ (SVRPOC_BASE + 55) |
| 146 | #define SVRPOC_SELECT_MEMBER_DOWN_RSP (SVRPOC_BASE + 56) |
| 147 | |
| 148 | #define SVRPOC_EXIT_SELECT_MEMBER_REQ (SVRPOC_BASE + 57) |
| 149 | #define SVRPOC_EXIT_SELECT_MEMBER_RSP (SVRPOC_BASE + 58) |
| 150 | |
| 151 | #define SVRPOC_EXIT_SELECT_GROUP_REQ (SVRPOC_BASE + 59) |
| 152 | #define SVRPOC_EXIT_SELECT_GROUP_RSP (SVRPOC_BASE + 60) |
| 153 | |
| 154 | #define SVRPOC_ENTER_SELECT_GROUP_UP_REQ (SVRPOC_BASE + 61) |
| 155 | #define SVRPOC_ENTER_SELECT_GROUP_UP_RSP (SVRPOC_BASE + 62) |
| 156 | |
| 157 | #define SVRPOC_ENTER_SELECT_GROUP_DOWN_REQ (SVRPOC_BASE + 63) |
| 158 | #define SVRPOC_ENTER_SELECT_GROUP_DOWN_RSP (SVRPOC_BASE + 64) |
| 159 | |
| 160 | #define SVRPOC_ENTER_TTS_PLAY_USER_NAME_REQ (SVRPOC_BASE + 65) |
| 161 | #define SVRPOC_ENTER_TTS_PLAY_USER_NAMEP_RSP (SVRPOC_BASE + 66) |
| 162 | |
| 163 | #define SVRPOC_USER_TEMP_CALL_WITH_NO_GID_REQ (SVRPOC_BASE + 67) |
| 164 | #define SVRPOC_USER_TEMP_CALL_WITH_NO_GID_RSP (SVRPOC_BASE + 68) |
| 165 | |
| 166 | |
| 167 | /******************************************************************************* |
| 168 | * Type definitions * |
| 169 | ******************************************************************************/ |
| 170 | /*ͨÓÃÏìÓ¦½á¹û*/ |
| 171 | struct svr_poc_comm_result{ |
| 172 | int result;/*0²Ù×÷³É¹¦£»·Ç0²Ù×÷ʧ°Ü*/ |
| 173 | }; |
| 174 | |
| 175 | /*Óû§ÐÅÏ¢*/ |
| 176 | struct svr_poc_user_info{ |
| 177 | char userName[SVRPOC_NAME_LENTH_MAX];/*Óû§Ãû*/ |
| 178 | unsigned int uid ;/*Óû§id*/ |
| 179 | unsigned int currentGid;/*µ±Ç°×éid*/ |
| 180 | char groupName[SVRPOC_NAME_LENTH_MAX];/*µ±Ç°×éÃû*/ |
| 181 | unsigned char isOnline;/*ÊÇ·ñÔÚÏß*/ |
| 182 | }; |
| 183 | |
| 184 | /*Ⱥ×éÐÅÏ¢*/ |
| 185 | struct svr_poc_group{ |
| 186 | unsigned int gid;/*×éid*/ |
| 187 | char name[SVRPOC_NAME_LENTH_MAX];/*×éÃû*/ |
| 188 | unsigned int n_members;/*³ÉÔ±ÊýÄ¿*/ |
| 189 | unsigned char has_type;/*ÊÇ·ñÓÐÀàÐÍ*/ |
| 190 | unsigned int type; /*0´úÂëÖÐдËÀµÄ,1ºǫ́ÉèÖõÄ,ÁÙʱ´´½¨µÄ*/ |
| 191 | }; |
| 192 | |
| 193 | /* |
| 194 | *²éѯȺ×éµÄÏìÓ¦ |
| 195 | */ |
| 196 | struct svr_poc_group_ack{ |
| 197 | int result;/*0²Ù×÷³É¹¦£»·Ç0²Ù×÷ʧ°Ü*/ |
| 198 | unsigned int n_groups;/*·µ»Ø¸ÃÕ˺ÅËùÔÚµÄËùÓÐȺ×éÐÅÏ¢*/ |
| 199 | struct svr_poc_group groups[SVRPOC_GROUP_NUMBER_MAX]; |
| 200 | }; |
| 201 | |
| 202 | struct svr_poc_member{ |
| 203 | /* |
| 204 | *User ID,¿ÉÒÔÖ÷¶¯Éϱ¨ÆäËûÓû§ÐÅÏ¢ |
| 205 | */ |
| 206 | unsigned int uid; |
| 207 | /* |
| 208 | *Õ˺ÅÃû³Æ |
| 209 | */ |
| 210 | char name[SVRPOC_NAME_LENTH_MAX]; |
| 211 | /* |
| 212 | *ÊÇ·ñÔÚÏß |
| 213 | */ |
| 214 | unsigned char has_online; |
| 215 | }; |
| 216 | |
| 217 | /*×é³ÉÔ±ÐÅÏ¢*/ |
| 218 | struct svr_poc_group_members{ |
| 219 | unsigned int gid;/*×éid*/ |
| 220 | /* |
| 221 | *ËùÓиÃȺ×éÄÚÔÚÏßÓû§IDÐÅÏ¢ |
| 222 | */ |
| 223 | unsigned int n_ingroups; |
| 224 | unsigned int ingroups[SVRPOC_MEMBERS_NUMBER_MAX]; |
| 225 | /* |
| 226 | *ËùÓиÃȺ×éÄÚÀëÏßÓû§IDÐÅÏ¢ |
| 227 | */ |
| 228 | unsigned int n_outgroups; |
| 229 | unsigned int outgroups[SVRPOC_MEMBERS_NUMBER_MAX]; |
| 230 | /* |
| 231 | *¸ÃȺ×éÄÚËùÓÐÓû§ÐÅÏ¢ |
| 232 | */ |
| 233 | unsigned int n_members;/*³ÉÔ±ÊýÄ¿*/ |
| 234 | struct svr_poc_member members[SVRPOC_MEMBERS_NUMBER_MAX]; |
| 235 | }; |
| 236 | |
| 237 | /* |
| 238 | *²éѯȺ×éÄÚÓû§ÐÅÏ¢µÄÇëÇóµÄÏìÓ¦ |
| 239 | */ |
| 240 | struct svr_poc_group_members_ack{ |
| 241 | int result;/*0²Ù×÷³É¹¦£»·Ç0²Ù×÷ʧ°Ü*/ |
| 242 | unsigned int n_members;/*³ÉÔ±ÊýÄ¿*/ |
| 243 | struct svr_poc_group_members members; |
| 244 | }; |
| 245 | |
| 246 | struct svr_poc_search_member_ack { |
| 247 | int result;/*0²Ù×÷³É¹¦£»·Ç0²Ù×÷ʧ°Ü*/ |
| 248 | struct svr_poc_member member; |
| 249 | }; |
| 250 | |
| 251 | struct svr_poc_get_location_ack { |
| 252 | int result;/*0²Ù×÷³É¹¦£»·Ç0²Ù×÷ʧ°Ü*/ |
| 253 | char location[SVRPOC_TEXT_INFO_MAX]; |
| 254 | }; |
| 255 | |
| 256 | struct svr_poc_get_account_info_ack { |
| 257 | int result;/*0²Ù×÷³É¹¦£»·Ç0²Ù×÷ʧ°Ü*/ |
| 258 | char ip[SVRPOC_NAME_LENTH_MAX]; |
| 259 | char dns[SVRPOC_NAME_LENTH_MAX]; |
| 260 | char username[SVRPOC_NAME_LENTH_MAX]; |
| 261 | }; |
| 262 | |
| 263 | #endif /*__POC_MSG_H*/ |