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_BASE_H 17 #define OHOS_WIFI_HAL_CRPC_BASE_H 18 19 #include "server.h" 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 /** 26 * @Description Read int array 27 * 28 * @param context - read context 29 * @param size - the array's size 30 * @return int* - return int array 31 */ 32 int *ReadIntArray(Context *context, int size); 33 34 /** 35 * @Description Read string array 36 * 37 * @param context - read context 38 * @param size - the array's size 39 * @return char** - return string array 40 */ 41 char **ReadCharArray(Context *context, int size); 42 43 /** 44 * @Description Parse the context to obtain data. Call the corresponding function 45 * GetName and assemble the function to obtain data. 46 * 47 * @param server - Pointer to the global structure of the communication server. 48 * @param context - Pointer to the global communication context structure of the server. 49 * @return int - 0 Success, -1 Failed. 50 */ 51 int RpcGetName(RpcServer *server, Context *context); 52 53 /** 54 * @Description Parse the context to obtain data. Call the corresponding function 55 * GetType and assemble the function to obtain data. 56 * 57 * @param server - Pointer to the global structure of the communication server. 58 * @param context - Pointer to the global communication context structure of the server. 59 * @return int - 0 Success, -1 Failed. 60 */ 61 int RpcGetType(RpcServer *server, Context *context); 62 63 #ifdef __cplusplus 64 } 65 #endif 66 #endif