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_STA_H 17 #define OHOS_WIFI_HAL_CRPC_STA_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 * Start 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 RpcStart(RpcServer *server, Context *context); 34 35 /** 36 * @Description Parse the context to obtain data. Call the corresponding function 37 * Stop 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 RpcStop(RpcServer *server, Context *context); 44 45 /** 46 * @Description Parse the context to obtain data. Call the corresponding function 47 * StartScan 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 RpcStartScan(RpcServer *server, Context *context); 54 55 /** 56 * @Description Parse the context to obtain data. Call the corresponding function 57 * GetScanInfos 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 RpcGetScanInfos(RpcServer *server, Context *context); 64 65 /** 66 * @Description Parse the context to obtain data. Call the corresponding function 67 * StartPnoScan 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 RpcStartPnoScan(RpcServer *server, Context *context); 74 75 /** 76 * @Description Parse the context to obtain data. Call the corresponding function 77 * StopPnoScan 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 RpcStopPnoScan(RpcServer *server, Context *context); 84 85 /** 86 * @Description Parse the context to obtain data. Call the corresponding function 87 * Connect 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 RpcConnect(RpcServer *server, Context *context); 94 95 /** 96 * @Description Parse the context to obtain data. Call the corresponding function 97 * Reconnect 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 RpcReconnect(RpcServer *server, Context *context); 104 105 /** 106 * @Description Parse the context to obtain data. Call the corresponding function 107 * Reassociate and assemble the function to obtain data. 108 * 109 * @param server - Pointer to the global structure of the communication server. 110 * @param context - Pointer to the global communication context structure of the server. 111 * @return int - 0 Success, -1 Failed. 112 */ 113 int RpcReassociate(RpcServer *server, Context *context); 114 115 /** 116 * @Description Parse the context to obtain data. Call the corresponding function 117 * Disconnect and assemble the function to obtain data. 118 * 119 * @param server - Pointer to the global structure of the communication server. 120 * @param context - Pointer to the global communication context structure of the server. 121 * @return int - 0 Success, -1 Failed. 122 */ 123 int RpcDisconnect(RpcServer *server, Context *context); 124 125 /** 126 * @Description Parse the context to obtain data. Call the corresponding function 127 * GetStaCapabilities and assemble the function to obtain data. 128 * 129 * @param server - Pointer to the global structure of the communication server. 130 * @param context - Pointer to the global communication context structure of the server. 131 * @return int - 0 Success, -1 Failed. 132 */ 133 int RpcGetStaCapabilities(RpcServer *server, Context *context); 134 135 /** 136 * @Description Parse the context to obtain data. Call the corresponding function 137 * GetDeviceMacAddress and assemble the function to obtain data. 138 * 139 * @param server - Pointer to the global structure of the communication server. 140 * @param context - Pointer to the global communication context structure of the server. 141 * @return int - 0 Success, -1 Failed. 142 */ 143 int RpcGetDeviceMacAddress(RpcServer *server, Context *context); 144 145 /** 146 * @Description Parse the context to obtain data. Call the corresponding function 147 * GetFrequencies and assemble the function to obtain data. 148 * 149 * @param server - Pointer to the global structure of the communication server. 150 * @param context - Pointer to the global communication context structure of the server. 151 * @return int - 0 Success, -1 Failed. 152 */ 153 int RpcGetFrequencies(RpcServer *server, Context *context); 154 155 /** 156 * @Description Parse the context to obtain data. Call the corresponding function 157 * SetAssocMacAddr and assemble the function to obtain data. 158 * 159 * @param server - Pointer to the global structure of the communication server. 160 * @param context - Pointer to the global communication context structure of the server. 161 * @return int - 0 Success, -1 Failed. 162 */ 163 int RpcSetAssocMacAddr(RpcServer *server, Context *context); 164 165 /** 166 * @Description Parse the context to obtain data. Call the corresponding function 167 * SetScanningMacAddress and assemble the function to obtain data. 168 * 169 * @param server - Pointer to the global structure of the communication server. 170 * @param context - Pointer to the global communication context structure of the server. 171 * @return int - 0 Success, -1 Failed. 172 */ 173 int RpcSetScanningMacAddress(RpcServer *server, Context *context); 174 175 /** 176 * @Description Parse the context to obtain data. Call the corresponding function 177 * DeauthLastRoamingBssid and assemble the function to obtain data. 178 * 179 * @param server - Pointer to the global structure of the communication server. 180 * @param context - Pointer to the global communication context structure of the server. 181 * @return int - 0 Success, -1 Failed. 182 */ 183 int RpcDeauthLastRoamingBssid(RpcServer *server, Context *context); 184 185 /** 186 * @Description Parse the context to obtain data. Call the corresponding function 187 * GetSupportFeature and assemble the function to obtain data. 188 * 189 * @param server - Pointer to the global structure of the communication server. 190 * @param context - Pointer to the global communication context structure of the server. 191 * @return int - 0 Success, -1 Failed. 192 */ 193 int RpcGetSupportFeature(RpcServer *server, Context *context); 194 195 /** 196 * @Description Parse the context to obtain data. Call the corresponding function 197 * RunCmd and assemble the function to obtain data. 198 * 199 * @param server - Pointer to the global structure of the communication server. 200 * @param context - Pointer to the global communication context structure of the server. 201 * @return int - 0 Success, -1 Failed. 202 */ 203 int RpcRunCmd(RpcServer *server, Context *context); 204 205 /** 206 * @Description Parse the context to obtain data. Call the corresponding function 207 * SetWifiTxPower and assemble the function to obtain data. 208 * 209 * @param server - Pointer to the global structure of the communication server. 210 * @param context - Pointer to the global communication context structure of the server. 211 * @return int - 0 Success, -1 Failed. 212 */ 213 int RpcSetWifiTxPower(RpcServer *server, Context *context); 214 215 /** 216 * @Description Parse the context to obtain data. Call the corresponding function 217 * RemoveNetwork and assemble the function to obtain data. 218 * 219 * @param server - Pointer to the global structure of the communication server. 220 * @param context - Pointer to the global communication context structure of the server. 221 * @return int - 0 Success, -1 Failed. 222 */ 223 int RpcRemoveNetwork(RpcServer *server, Context *context); 224 225 /** 226 * @Description Parse the context to obtain data. Call the corresponding function 227 * AddNetwork and assemble the function to obtain data. 228 * 229 * @param server - Pointer to the global structure of the communication server. 230 * @param context - Pointer to the global communication context structure of the server. 231 * @return int - 0 Success, -1 Failed. 232 */ 233 int RpcAddNetwork(RpcServer *server, Context *context); 234 235 /** 236 * @Description Parse the context to obtain data. Call the corresponding function 237 * EnableNetwork and assemble the function to obtain data. 238 * 239 * @param server - Pointer to the global structure of the communication server. 240 * @param context - Pointer to the global communication context structure of the server. 241 * @return int - 0 Success, -1 Failed. 242 */ 243 int RpcEnableNetwork(RpcServer *server, Context *context); 244 245 /** 246 * @Description Parse the context to obtain data. Call the corresponding function 247 * DisableNetwork and assemble the function to obtain data. 248 * 249 * @param server - Pointer to the global structure of the communication server. 250 * @param context - Pointer to the global communication context structure of the server. 251 * @return int - 0 Success, -1 Failed. 252 */ 253 int RpcDisableNetwork(RpcServer *server, Context *context); 254 255 /** 256 * @Description Parse the context to obtain data. Call the corresponding function 257 * SetNetwork and assemble the function to obtain data. 258 * 259 * @param server - Pointer to the global structure of the communication server. 260 * @param context - Pointer to the global communication context structure of the server. 261 * @return int - 0 Success, -1 Failed. 262 */ 263 int RpcSetNetwork(RpcServer *server, Context *context); 264 265 /** 266 * @Description Parse the context to obtain data. Call the corresponding function 267 * SaveNetworkConfig and assemble the function to obtain data. 268 * 269 * @param server - Pointer to the global structure of the communication server. 270 * @param context - Pointer to the global communication context structure of the server. 271 * @return int - 0 Success, -1 Failed. 272 */ 273 int RpcSaveNetworkConfig(RpcServer *server, Context *context); 274 275 /** 276 * @Description Parse the context to obtain data. Call the corresponding function 277 * StartWpsPbcMode and assemble the function to obtain data. 278 * 279 * @param server - Pointer to the global structure of the communication server. 280 * @param context - Pointer to the global communication context structure of the server. 281 * @return int - 0 Success, -1 Failed. 282 */ 283 int RpcStartWpsPbcMode(RpcServer *server, Context *context); 284 285 /** 286 * @Description Parse the context to obtain data. Call the corresponding function 287 * StartWpsPinMode and assemble the function to obtain data. 288 * 289 * @param server - Pointer to the global structure of the communication server. 290 * @param context - Pointer to the global communication context structure of the server. 291 * @return int - 0 Success, -1 Failed. 292 */ 293 int RpcStartWpsPinMode(RpcServer *server, Context *context); 294 295 /** 296 * @Description Parse the context to obtain data. Call the corresponding function 297 * StopWps and assemble the function to obtain data. 298 * 299 * @param server - Pointer to the global structure of the communication server. 300 * @param context - Pointer to the global communication context structure of the server. 301 * @return int - 0 Success, -1 Failed. 302 */ 303 int RpcStopWps(RpcServer *server, Context *context); 304 305 /** 306 * @Description Parse the context to obtain data. Call the corresponding function 307 * GetRoamingCapabilities and assemble the function to obtain data. 308 * 309 * @param server - Pointer to the global structure of the communication server. 310 * @param context - Pointer to the global communication context structure of the server. 311 * @return int - 0 Success, -1 Failed. 312 */ 313 int RpcGetRoamingCapabilities(RpcServer *server, Context *context); 314 315 /** 316 * @Description Parse the context to obtain data. Call the corresponding function 317 * SetRoamConfig and assemble the function to obtain data. 318 * 319 * @param server - Pointer to the global structure of the communication server. 320 * @param context - Pointer to the global communication context structure of the server. 321 * @return int - 0 Success, -1 Failed. 322 */ 323 int RpcSetRoamConfig(RpcServer *server, Context *context); 324 325 /** 326 * @Description Parse the context to obtain data. Call the corresponding function 327 * WpaGetNetwork and assemble the function to obtain data. 328 * 329 * @param server - Pointer to the global structure of the communication server. 330 * @param context - Pointer to the global communication context structure of the server. 331 * @return int - 0 Success, -1 Failed. 332 */ 333 int RpcWpaGetNetwork(RpcServer *server, Context *context); 334 335 /** 336 * @Description Parse the context to obtain data. Call the corresponding function 337 * WpaAutoConnect and assemble the function to obtain data. 338 * 339 * @param server - Pointer to the global structure of the communication server. 340 * @param context - Pointer to the global communication context structure of the server. 341 * @return int - 0 Success, -1 Failed. 342 */ 343 int RpcWpaAutoConnect(RpcServer *server, Context *context); 344 345 /** 346 * @Description Parse the context to obtain data. Call the corresponding function 347 * WpaBlocklistClear and assemble the function to obtain data. 348 * 349 * @param server - Pointer to the global structure of the communication server. 350 * @param context - Pointer to the global communication context structure of the server. 351 * @return int - 0 Success, -1 Failed. 352 */ 353 int RpcWpaBlocklistClear(RpcServer *server, Context *context); 354 355 /** 356 * @Description Parse the context to obtain data. Call the corresponding function 357 * GetNetworkList and assemble the function to obtain data. 358 * 359 * @param server - Pointer to the global structure of the communication server. 360 * @param context - Pointer to the global communication context structure of the server. 361 * @return int - 0 Success, -1 Failed. 362 */ 363 int RpcGetNetworkList(RpcServer *server, Context *context); 364 365 /** 366 * @Description Parse the context to obtain data. Call the corresponding function 367 * GetConnectSignalInfo and assemble the function to obtain data. 368 * 369 * @param server - Pointer to the global structure of the communication server. 370 * @param context - Pointer to the global communication context structure of the server. 371 * @return int - 0 Success, -1 Failed. 372 */ 373 int RpcGetConnectSignalInfo(RpcServer *server, Context *context); 374 375 /** 376 * @Description Send suspend mode to wpa 377 * 378 * @param mode - true for suspend mode, false for resume mode. 379 * @return int - 0 Success, -1 Failed. 380 */ 381 int RpcSetSuspendMode(RpcServer *server, Context *context); 382 383 /** 384 * @Description Send power mode to wpa 385 * 386 * @param mode - true for power mode, false for resume mode. 387 * @return int - 0 Success, -1 Failed. 388 */ 389 int RpcSetPowerMode(RpcServer *server, Context *context); 390 #ifdef __cplusplus 391 } 392 #endif 393 #endif