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_SUPPLICANT_H 17 #define OHOS_WIFI_HAL_CRPC_SUPPLICANT_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 * StartSupplicant 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 RpcStartSupplicant(RpcServer *server, Context *context); 34 35 /** 36 * @Description Parse the context to obtain data. Call the corresponding function 37 * StopSupplicant 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 RpcStopSupplicant(RpcServer *server, Context *context); 44 45 /** 46 * @Description Parse the context to obtain data. Call the corresponding function 47 * ConnectSupplicant 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 RpcConnectSupplicant(RpcServer *server, Context *context); 54 55 /** 56 * @Description Parse the context to obtain data. Call the corresponding function 57 * DisconnectSupplicant 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 int RpcDisconnectSupplicant(RpcServer *server, Context *context); 64 65 /** 66 * @Description Parse the context to obtain data. Call the corresponding function 67 * RequestToSupplicant and assemble the function to obtain data. 68 * 69 * @param server - Pointer to the global structure of the communication server. 70 * @param context - Pointer to the global communication context structure of the server. 71 * @return int - 0 Success, -1 Failed. 72 */ 73 int RpcRequestToSupplicant(RpcServer *server, Context *context); 74 75 /** 76 * @Description Parse the context to obtain data. Call the corresponding function 77 * SetPowerSave and assemble the function to obtain data. 78 * 79 * @param server - Pointer to the global structure of the communication server. 80 * @param context - Pointer to the global communication context structure of the server. 81 * @return int - 0 Success, -1 Failed. 82 */ 83 int RpcSetPowerSave(RpcServer *server, Context *context); 84 85 /** 86 * @Description Parse the context to obtain data. Call the corresponding function 87 * WpaSetCountryCode and assemble the function to obtain data. 88 * 89 * @param server - Pointer to the global structure of the communication server. 90 * @param context - Pointer to the global communication context structure of the server. 91 * @return int - 0 Success, -1 Failed. 92 */ 93 int RpcWpaSetCountryCode(RpcServer *server, Context *context); 94 95 /** 96 * @Description Parse the context to obtain data. Call the corresponding function 97 * WpaGetCountryCode and assemble the function to obtain data. 98 * 99 * @param server - Pointer to the global structure of the communication server. 100 * @param context - Pointer to the global communication context structure of the server. 101 * @return int - 0 Success, -1 Failed. 102 */ 103 int RpcWpaGetCountryCode(RpcServer *server, Context *context); 104 105 #ifdef __cplusplus 106 } 107 #endif 108 #endif