1 /* 2 * Copyright (C) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_WIFI_HAL_CRPC_COMMON_H 17 #define OHOS_WIFI_HAL_CRPC_COMMON_H 18 19 #include "server.h" 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 /** 26 * @Description Parse the context to obtain data. Call the corresponding function 27 * RegisterEventCallback and assemble the function to obtain data. 28 * 29 * @param server - Pointer to the global structure of the communication server. 30 * @param context - Pointer to the global communication context structure of the server. 31 * @return int - 0 Success, -1 Failed. 32 */ 33 int RpcRegisterEventCallback(RpcServer *server, Context *context); 34 35 /** 36 * @Description Parse the context to obtain data. Call the corresponding function 37 * UnRegisterEventCallback and assemble the function to obtain data. 38 * 39 * @param server - Pointer to the global structure of the communication server. 40 * @param context - Pointer to the global communication context structure of the server. 41 * @return int - 0 Success, -1 Failed. 42 */ 43 int RpcUnRegisterEventCallback(RpcServer *server, Context *context); 44 45 /** 46 * @Description Parse the context to obtain data. Call the corresponding function 47 * NotifyClear and assemble the function to obtain data. 48 * 49 * @param server - Pointer to the global structure of the communication server. 50 * @param context - Pointer to the global communication context structure of the server. 51 * @return int - 0 Success, -1 Failed. 52 */ 53 int RpcNotifyClear(RpcServer *server, Context *context); 54 55 /** 56 * @Description Parse the context to obtain data. Call the corresponding function 57 * NotifyClear and assemble the function to obtain data. 58 * 59 * @param server - Pointer to the global structure of the communication server. 60 * @param context - Pointer to the global communication context structure of the server. 61 * @return int - 0 Success, -1 Failed. 62 */ 63 64 int RpcGetCommonCmd(RpcServer *server, Context *context); 65 66 /** 67 * @Description Parse the context to obtain data. Call the corresponding function 68 * NotifyClear and assemble the function to obtain data. 69 * 70 * @param server - Pointer to the global structure of the communication server. 71 * @param context - Pointer to the global communication context structure of the server. 72 * @return int - 0 Success, -1 Failed. 73 */ 74 75 int RpcChbaStart(RpcServer *server, Context *context); 76 77 /** 78 * @Description Parse the context to obtain data. Call the corresponding function 79 * NotifyClear and assemble the function to obtain data. 80 * 81 * @param server - Pointer to the global structure of the communication server. 82 * @param context - Pointer to the global communication context structure of the server. 83 * @return int - 0 Success, -1 Failed. 84 */ 85 86 int RpcChbaStop(RpcServer *server, Context *context); 87 88 #ifdef __cplusplus 89 } 90 #endif 91 #endif