1/* 2 * Copyright (c) 2023 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/** 17 * @addtogroup WPA 18 * @{ 19 * 20 * @brief Provides APIs for the upper-layer WLAN service. 21 * 22 * You can use the APIs to enable or disable a WLAN hotspot, scan for hotspots, connect to a WLAN hotspot, 23 * manage WLAN chips, network devices, and power, and apply for, release, and move network data buffers. 24 * 25 * @since 3.2 26 * @version 1.0 27 */ 28 29/** 30 * @file IWpaInterface.idl 31 * 32 * @brief Provides APIs to enable or disable a WLAN hotspot, scan for hotspots, connect to or disconnect from a WLAN hotspot, 33 * set the country code, and manage network devices. 34 * 35 * @since 3.2 36 * @version 1.0 37 */ 38 39/** 40 * @brief Defines the package path of the Wpa module interface. 41 * 42 * @since 3.2 43 * @version 1.0 44 */ 45 46package ohos.hdi.wlan.wpa.v1_0; 47 48import ohos.hdi.wlan.wpa.v1_0.WpaTypes; 49import ohos.hdi.wlan.wpa.v1_0.IWpaCallback; 50 51/** 52 * @brief Defines an interface for the upper-layer WLAN service. 53 * 54 * @since 4.1 55 * @version 1.0 56 */ 57 58 interface IWpaInterface { 59 /** 60 * @brief Creates a channel between the HAL and the wpa supplicant and obtains the driver network interface card (NIC) 61 * information. This function must be called after an <b>IWiFi</b> instance is created. 62 * 63 * @return Returns <b>0</b> if the operation is successful. 64 * @return Returns a negative value if the operation fails. 65 * 66 * @since 4.1 67 * @version 1.0 68 */ 69 Start(); 70 71 /** 72 * @brief Destroys the channel between the HAL and wpa supplicant. This function must be called before an <b>IWiFi</b> 73 * instance is destroyed. 74 * 75 * @return Returns <b>0</b> if the operation is successful. 76 * @return Returns a negative value if the operation fails. 77 * 78 * @since 4.1 79 * @version 1.0 80 */ 81 Stop(); 82 83 /** 84 * @brief Add interface in wpa supplicant. 85 * 86 * @param ifName indicates the interface that needs to be added(such as: wlan0 or wlan2). 87 * @param confName indicates the config file(such as: /data/service/el1/public/wifi/wpa_supplicant/wpa_supplicant.conf). 88 * 89 * @return Returns <b>0</b> if the operation is successful. 90 * @return Returns a negative value if the operation fails. 91 * 92 * @since 4.1 93 * @version 1.0 94 */ 95 AddWpaIface([in] String ifName, [in] String confName); 96 97 /** 98 * @brief Remove interface in wpa supplicant. 99 * 100 * @param ifName indicates the interface that needs to be removed(such as: wlan0 or wlan2). 101 * 102 * @return Returns <b>0</b> if the operation is successful. 103 * @return Returns a negative value if the operation fails. 104 * 105 * @since 4.1 106 * @version 1.0 107 */ 108 RemoveWpaIface([in] String ifName); 109 110 /** 111 * @brief Scan in wpa supplicant. 112 * 113 * @param ifName Indicates the NIC name. 114 * 115 * @return Returns <b>0</b> if the operation is successful. 116 * @return Returns a negative value if the operation fails. 117 * 118 * @since 4.1 119 * @version 1.0 120 */ 121 Scan([in] String ifName); 122 123 /** 124 * @brief Scan Result in wpa supplicant. 125 * 126 * @param ifName Indicates the NIC name. 127 * @param resultBuf Indicates Scan Result obtained. 128 * 129 * @return Returns <b>0</b> if the operation is successful. 130 * @return Returns a negative value if the operation fails. 131 * 132 * @since 4.1 133 * @version 1.0 134 */ 135 ScanResult([in] String ifName, [out] unsigned char[] resultBuf); 136 137 /** 138 * @brief Add nework in wpa supplicant. 139 * 140 * @param ifName Indicates the NIC name. 141 * @param networkId Indicates the network ID added. 142 * 143 * @return Returns <b>0</b> if the operation is successful. 144 * @return Returns a negative value if the operation fails. 145 * 146 * @since 4.1 147 * @version 1.0 148 */ 149 AddNetwork([in] String ifName, [out] int networkId); 150 151 /** 152 * @brief Remove nework in wpa supplicant. 153 * 154 * @param ifName Indicates the NIC name. 155 * @param networkId Indicates the network ID Remove. 156 * 157 * @return Returns <b>0</b> if the operation is successful. 158 * @return Returns a negative value if the operation fails. 159 * 160 * @since 4.1 161 * @version 1.0 162 */ 163 RemoveNetwork([in] String ifName, [in] int networkId); 164 165 /** 166 * @brief Disable nework in wpa supplicant. 167 * 168 * @param ifName Indicates the NIC name. 169 * @param networkId Indicates the network ID Disable. 170 * 171 * @return Returns <b>0</b> if the operation is successful. 172 * @return Returns a negative value if the operation fails. 173 * 174 * @since 4.1 175 * @version 1.0 176 */ 177 DisableNetwork([in] String ifName, [in] int networkId); 178 179 /** 180 * @brief Set Network in wpa supplicant. 181 * 182 * @param ifName Indicates the NIC name. 183 * @param networkId Indicates the network ID Set 184 * @param name Indicates the name to set 185 * @param value Indicates the value to set 186 * 187 * @return Returns <b>0</b> if the operation is successful. 188 * @return Returns a negative value if the operation fails. 189 * 190 * @since 4.1 191 * @version 1.0 192 */ 193 SetNetwork([in] String ifName, [in] int networkId, [in] String name, [in] String value); 194 195 /** 196 * @brief List Networks in wpa supplicant. 197 * 198 * @param ifName Indicates the NIC name. 199 * @param mode Indicates wifiNetworkInfo obtained. 200 * 201 * @return Returns <b>0</b> if the operation is successful. 202 * @return Returns a negative value if the operation fails. 203 * 204 * @since 4.1 205 * @version 1.0 206 */ 207 ListNetworks([in] String ifName, [out] struct HdiWifiWpaNetworkInfo[] networkInfo); 208 209 /** 210 * @brief Select nework in wpa supplicant. 211 * 212 * @param ifName Indicates the NIC name. 213 * @param networkId Indicates the network ID Select. 214 * 215 * @return Returns <b>0</b> if the operation is successful. 216 * @return Returns a negative value if the operation fails. 217 * 218 * @since 4.1 219 * @version 1.0 220 */ 221 SelectNetwork([in] String ifName, [in] int networkId); 222 223 /** 224 * @brief Enable nework in wpa supplicant. 225 * 226 * @param ifName Indicates the NIC name. 227 * @param networkId Indicates the network ID Enable. 228 * 229 * @return Returns <b>0</b> if the operation is successful. 230 * @return Returns a negative value if the operation fails. 231 * 232 * @since 4.1 233 * @version 1.0 234 */ 235 EnableNetwork([in] String ifName, [in] int networkId); 236 237 /** 238 * @brief Reconnect in wpa supplicant. 239 * 240 * @param ifName Indicates the NIC name. 241 * @return Returns <b>0</b> if the operation is successful. 242 * @return Returns a negative value if the operation fails. 243 * 244 * @since 4.1 245 * @version 1.0 246 */ 247 Reconnect([in] String ifName); 248 249 /** 250 * @brief Disconnect in wpa supplicant. 251 * 252 * @param ifName Indicates the NIC name. 253 * 254 * @return Returns <b>0</b> if the operation is successful. 255 * @return Returns a negative value if the operation fails. 256 * 257 * @since 4.1 258 * @version 1.0 259 */ 260 Disconnect([in] String ifName); 261 262 /** 263 * @brief Save config in wpa supplicant. 264 * 265 * @param ifName Indicates the NIC name. 266 * 267 * @return Returns <b>0</b> if the operation is successful. 268 * @return Returns a negative value if the operation fails. 269 * 270 * @since 4.1 271 * @version 1.0 272 */ 273 SaveConfig([in] String ifName); 274 275 /** 276 * @brief Set PowerSave in wpa supplicant. 277 * 278 * @param ifName Indicates the NIC name. 279 * @param enable Indicates whether set powerSave . 280 * 281 * @return Returns <b>0</b> if the operation is successful. 282 * @return Returns a negative value if the operation fails. 283 * 284 * @since 4.1 285 * @version 1.0 286 */ 287 SetPowerSave([in] String ifName, [in] int enable); 288 289 /** 290 * @brief Auto connect in wpa supplicant. 291 * 292 * @param ifName Indicates the NIC name. 293 * @param enable Indicates whether auto connect . 294 * 295 * @return Returns <b>0</b> if the operation is successful. 296 * @return Returns a negative value if the operation fails. 297 * 298 * @since 4.1 299 * @version 1.0 300 */ 301 AutoConnect([in] String ifName, [in] int enable); 302 303 /** 304 * @brief get Wifi Status in wpa supplicant. 305 * 306 * @param ifName Indicates the NIC name. 307 * @param mode Indicates wifiStatus obtained. 308 * 309 * @return Returns <b>0</b> if the operation is successful. 310 * @return Returns a negative value if the operation fails. 311 * 312 * @since 4.1 313 * @version 1.0 314 */ 315 WifiStatus([in] String ifName, [out] struct HdiWpaCmdStatus wifiStatus); 316 317 /** 318 * @brief set WpsPbcMode in wpa supplicant. 319 * 320 * @param ifName Indicates the NIC name. 321 * @param wpsParam Indicates wifiStatus obtained. 322 * 323 * @return Returns <b>0</b> if the operation is successful. 324 * @return Returns a negative value if the operation fails. 325 * 326 * @since 4.1 327 * @version 1.0 328 */ 329 WpsPbcMode([in] String ifName, [in] struct HdiWifiWpsParam wpsParam); 330 331 /** 332 * @brief set Wifi Status in wpa supplicant. 333 * 334 * @param ifName Indicates the NIC name. 335 * @param wpsParam Indicates wifiStatus obtained. 336 * 337 * @return Returns <b>0</b> if the operation is successful. 338 * @return Returns a negative value if the operation fails. 339 * 340 * @since 4.1 341 * @version 1.0 342 */ 343 WpsPinMode([in] String ifName, [in] struct HdiWifiWpsParam wpsParam, [out] int pinCode); 344 345 /** 346 * @brief Cancel Wps in wpa supplicant. 347 * 348 * @param ifName Indicates the NIC name. 349 * @return Returns <b>0</b> if the operation is successful. 350 * @return Returns a negative value if the operation fails. 351 * 352 * @since 4.1 353 * @version 1.0 354 */ 355 WpsCancel([in] String ifName); 356 357 /** 358 * @brief get countrycode in wpa supplicant. 359 * 360 * @param ifName Indicates the NIC name. 361 * @param countrycode Indicates the country code obtained. 362 * 363 * @return Returns <b>0</b> if the operation is successful. 364 * @return Returns a negative value if the operation fails. 365 * 366 * @since 4.1 367 * @version 1.0 368 */ 369 GetCountryCode([in] String ifName, [out] String countrycode); 370 371 /** 372 * @brief get Network in wpa supplicant. 373 * 374 * @param ifName Indicates the NIC name. 375 * @param networkId Indicates the network ID of parameter 376 * @param param Indicates the param 377 * @param value Indicates the value obtained. 378 * 379 * @return Returns <b>0</b> if the operation is successful. 380 * @return Returns a negative value if the operation fails. 381 * 382 * @since 4.1 383 * @version 1.0 384 */ 385 GetNetwork([in] String ifName, [in] int networkId, [in] String param, [out] String value); 386 387 /** 388 * @brief clear block list in wpa supplicant. 389 * 390 * @param ifName Indicates the NIC name. 391 * 392 * @return Returns <b>0</b> if the operation is successful. 393 * @return Returns a negative value if the operation fails. 394 * 395 * @since 4.1 396 * @version 1.0 397 */ 398 BlocklistClear([in] String ifName); 399 400 /** 401 * @brief Set SuspendMode in wpa supplicant. 402 * 403 * @param ifName Indicates the NIC name. 404 * @param mode Indicates to set Suspend . 405 * 406 * @return Returns <b>0</b> if the operation is successful. 407 * @return Returns a negative value if the operation fails. 408 * 409 * @since 4.1 410 * @version 1.0 411 */ 412 SetSuspendMode([in] String ifName, [in] int mode); 413 414 /** 415 * @brief Registers a callback to listen for asynchronous events. 416 * 417 * @param cbFunc Indicates the callback to register. 418 * @param ifName Indicates the NIC name. 419 * 420 * @return Returns <b>0</b> if the operation is successful. 421 * @return Returns a negative value if the operation fails. 422 * 423 * @since 4.1 424 * @version 1.0 425 */ 426 RegisterEventCallback([in] IWpaCallback cbFunc, [in] String ifName); 427 428 /** 429 * @brief Unregisters a callback. 430 * 431 * @param cbFunc Indicates the callback to unregister. 432 * @param ifName Indicates the NIC name. 433 * 434 * @return Returns <b>0</b> if the operation is successful. 435 * @return Returns a negative value if the operation fails. 436 * 437 * @since 4.1 438 * @version 1.0 439 */ 440 UnregisterEventCallback([in] IWpaCallback cbFunc, [in] String ifName); 441 442 /** 443 * @brief Get ConnectionCapabilities in wpa supplicant. 444 * 445 * @param ifName Indicates the NIC name. 446 * @param connectionCap Indicates connectionCap obtained. 447 * 448 * @return Returns <b>0</b> if the operation is successful. 449 * @return Returns a negative value if the operation fails. 450 * 451 * @since 4.1 452 * @version 1.0 453 */ 454 GetConnectionCapabilities([in] String ifName, [out] struct ConnectionCapabilities connectionCap); 455 456 /** 457 * @brief Get whether Probe Requests are being sent for this network (hidden). 458 * 459 * @param ifName Indicates the NIC name. 460 * @param enabled true if set, false otherwise. 461 * 462 * @return Returns <b>0</b> if the operation is successful. 463 * @return Returns a negative value if the operation fails. 464 * 465 * @since 4.1 466 * @version 1.0 467 */ 468 GetScanSsid([in] String ifName, [out] int enable); 469 470 /** 471 * @brief Get passphrase in wpa supplicant. 472 * 473 * @param ifName Indicates the NIC name. 474 * @param psk the psk value set. 475 * 476 * @return Returns <b>0</b> if the operation is successful. 477 * @return Returns a negative value if the operation fails. 478 * 479 * @since 4.1 480 * @version 1.0 481 */ 482 GetPskPassphrase([in] String ifName, [out] String psk); 483 484 /** 485 * @brief Get raw psk in wpa supplicant. 486 * 487 * @param ifName Indicates the NIC name. 488 * @param psk the psk value set. 489 * 490 * @return Returns <b>0</b> if the operation is successful. 491 * @return Returns a negative value if the operation fails. 492 * 493 * @since 4.1 494 * @version 1.0 495 */ 496 GetPsk([in] String ifName, [out] unsigned char[] psk); 497 498 /** 499 * @brief Get WEP key in wpa supplicant. 500 * 501 * @param ifName Indicates the NIC name. 502 * @param keyIdx Index of wep key to be fetched 503 * @param wepKey the wep Key value set. 504 * 505 * @return Returns <b>0</b> if the operation is successful. 506 * @return Returns a negative value if the operation fails. 507 * 508 * @since 4.1 509 * @version 1.0 510 */ 511 GetWepKey([in] String ifName, [in] int keyIdx, [out] unsigned char[] wepKey); 512 513 /** 514 * @brief Get default Tx key index in wpa supplicant. 515 * 516 * @param ifName Indicates the NIC name. 517 * @param keyIdx the keyIdx valu value set. 518 * 519 * @return Returns <b>0</b> if the operation is successful. 520 * @return Returns a negative value if the operation fails. 521 * 522 * @since 4.1 523 * @version 1.0 524 */ 525 GetWepTxKeyIdx([in] String ifName, [out] int keyIdx); 526 527 /** 528 * @brief Get whether RequirePmf is enabled for this network. 529 * 530 * @param ifName Indicates the NIC name. 531 * @param enabled true if set, false otherwise. 532 * 533 * @return Returns <b>0</b> if the operation is successful. 534 * @return Returns a negative value if the operation fails. 535 * 536 * @since 4.1 537 * @version 1.0 538 */ 539 GetRequirePmf([in] String ifName, [out] int enable); 540 541 /** 542 * @brief Set CountryCode in wpa supplicant. 543 * 544 * @param ifName Indicates the NIC name. 545 * @param countrycode Indicates the country code to set 546 * 547 * @return Returns <b>0</b> if the operation is successful. 548 * @return Returns a negative value if the operation fails. 549 * 550 * @since 4.1 551 * @version 1.0 552 */ 553 SetCountryCode([in] String ifName,[in] String countrycode); 554 555 /** 556 * Set the postfix to be used for P2P SSID's. 557 * 558 * @param ifName Indicates the NIC name. 559 * @param postfix name String to be appended to SSID. 560 * 561 * @return Returns <b>0</b> if the operation is successful. 562 * @return Returns a negative value if the operation fails. 563 */ 564 P2pSetSsidPostfixName([in] String ifName, [in] String name); 565 566 /** 567 * @brief set Wps Device Type for p2p. 568 * 569 * @param ifName Indicates the NIC name. 570 * @param type Indicates the wpa device type of parameter. 571 * 572 * @return Returns <b>0</b> if the operation is successful. 573 * @return Returns a negative value if the operation fails. 574 * 575 * @since 4.1 576 * @version 1.0 577 */ 578 P2pSetWpsDeviceType([in] String ifName, [in] String type); 579 580 /** 581 * @brief set Wps config methods for p2p. 582 * 583 * @param ifName Indicates the NIC name. 584 * @param methods Indicates the Wps config methods of parameter. 585 * 586 * @return Returns <b>0</b> if the operation is successful. 587 * @return Returns a negative value if the operation fails. 588 * 589 * @since 4.1 590 * @version 1.0 591 */ 592 P2pSetWpsConfigMethods([in] String ifName, [in] String methods); 593 594 /** 595 * @brief the Maximum idle time in seconds for P2P groups. 596 * 597 * @param ifName Indicates the NIC name. 598 * @param time Indicates the Maximum idle time of parameter. 599 * 600 * @return Returns <b>0</b> if the operation is successful. 601 * @return Returns a negative value if the operation fails. 602 * 603 * @since 4.1 604 * @version 1.0 605 */ 606 P2pSetGroupMaxIdle([in] String ifName, [in] int time); 607 608 /** 609 * @brief Enable/Disable Wifi Display for p2p. 610 * 611 * @param ifName Indicates the NIC name. 612 * @param enable 1 to enable, 0 to disable. 613 * 614 * @return Returns <b>0</b> if the operation is successful. 615 * @return Returns a negative value if the operation fails. 616 * 617 * @since 4.1 618 * @version 1.0 619 */ 620 P2pSetWfdEnable([in] String ifName, [in] int enable); 621 622 /** 623 * @brief Set Persistent Reconnect for p2p. 624 * 625 * @param ifName Indicates the NIC name. 626 * @param status Indicates the Persistent Reconnect status of parameter. 627 * 628 * @return Returns <b>0</b> if the operation is successful. 629 * @return Returns a negative value if the operation fails. 630 * 631 * @since 4.1 632 * @version 1.0 633 */ 634 P2pSetPersistentReconnect([in] String ifName, [in] int status); 635 636 /** 637 * @brief set Wps Secondary Device Type for p2p. 638 * 639 * @param ifName Indicates the NIC name. 640 * @param type Indicates the wpa Secondary device type of parameter. 641 * 642 * @return Returns <b>0</b> if the operation is successful. 643 * @return Returns a negative value if the operation fails. 644 * 645 * @since 4.1 646 * @version 1.0 647 */ 648 P2pSetWpsSecondaryDeviceType([in] String ifName, [in] String type); 649 650 /** 651 * @brief setup Wps pbc for p2p. 652 * 653 * @param ifName Indicates the NIC name. 654 * @param address Indicates the BSSID of the AP of parameter. 655 * 656 * @return Returns <b>0</b> if the operation is successful. 657 * @return Returns a negative value if the operation fails. 658 * 659 * @since 4.1 660 * @version 1.0 661 */ 662 P2pSetupWpsPbc([in] String ifName, [in] String address); 663 664 /** 665 * @brief setup Wps pin for p2p. 666 * 667 * @param ifName Indicates the NIC name. 668 * @param address Indicates the BSSID of the AP of parameter. 669 * @param pin 8 digit pin to be used. 670 * @param result Indicates the status of the operation. 671 * 672 * @return Returns <b>0</b> if the operation is successful. 673 * @return Returns a negative value if the operation fails. 674 * 675 * @since 4.1 676 * @version 1.0 677 */ 678 P2pSetupWpsPin([in] String ifName, [in] String address, [in] String pin, [out] String result); 679 680 /** 681 * @brief Turn on/off power save mode for the interface. 682 * 683 * @param ifName Indicates the NIC name. 684 * @param enable Indicate if power save is to be turned on/off. 685 * 686 * @return Returns <b>0</b> if the operation is successful. 687 * @return Returns a negative value if the operation fails. 688 */ 689 P2pSetPowerSave([in] String ifName, [in] int enable); 690 691 /** 692 * @brief Set Device Name for p2p. 693 * 694 * @param ifName Indicates the NIC name. 695 * @param name Indicates Device Name of parameter. 696 * 697 * @return Returns <b>0</b> if the operation is successful. 698 * @return Returns a negative value if the operation fails. 699 * 700 * @since 4.1 701 * @version 1.0 702 */ 703 P2pSetDeviceName([in] String ifName, [in] String name); 704 705 /** 706 * @brief set Wifi Display device config for p2p. 707 * 708 * @param ifName Indicates the NIC name. 709 * @param config Indicates device config of parameter. 710 * 711 * @return Returns <b>0</b> if the operation is successful. 712 * @return Returns a negative value if the operation fails. 713 * 714 * @since 4.1 715 * @version 1.0 716 */ 717 P2pSetWfdDeviceConfig([in] String ifName, [in] String config); 718 719 /** 720 * @brief set Random Mac for p2p. 721 * 722 * @param ifName Indicates the NIC name. 723 * @param networkId Indicates the network ID Enable. 724 * 725 * @return Returns <b>0</b> if the operation is successful. 726 * @return Returns a negative value if the operation fails. 727 * 728 * @since 4.1 729 * @version 1.0 730 */ 731 P2pSetRandomMac([in] String ifName, [in] int networkId); 732 733 /** 734 * @brief Start Find for p2p. 735 * 736 * @param ifName Indicates the NIC name. 737 * @param timeout Indicates Max time to be spent is peforming discovery. 738 * 739 * @return Returns <b>0</b> if the operation is successful. 740 * @return Returns a negative value if the operation fails. 741 * 742 * @since 4.1 743 * @version 1.0 744 */ 745 P2pStartFind([in] String ifName, [in] int timeout); 746 747 /** 748 * @brief Configure Extended Listen Timing for p2p. 749 * 750 * @param ifName Indicates the NIC name. 751 * @param enable Indicates if to enable it. 752 * @param period Indicates Period in milliseconds. 753 * @param enable Indicates Interval in milliseconds. 754 * 755 * @return Returns <b>0</b> if the operation is successful. 756 * @return Returns a negative value if the operation fails. 757 * 758 * @since 4.1 759 * @version 1.0 760 */ 761 P2pSetExtListen([in] String ifName, [in] int enable, [in] int period, [in] int interval); 762 763 /** 764 * @brief Set P2P Listen channel. 765 * 766 * @param ifName Indicates the NIC name. 767 * @param channel Indicates the Wifi channel. 768 * @param regClass Indicates the channel set of the AP indicated by this BSSID. 769 * 770 * @return Returns <b>0</b> if the operation is successful. 771 * @return Returns a negative value if the operation fails. 772 * 773 * @since 4.1 774 * @version 1.0 775 */ 776 P2pSetListenChannel([in] String ifName, [in] int channel, [in] int regClass); 777 778 /** 779 * @brief Send P2P provision discovery request to the specified peer. 780 * 781 * @param ifName Indicates the NIC name. 782 * @param peerBssid Indicates MAC address of the device to send discovery. 783 * @param mode Indicates Provisioning mode of parameter. 784 * 785 * @return Returns <b>0</b> if the operation is successful. 786 * @return Returns a negative value if the operation fails. 787 * 788 * @since 4.1 789 * @version 1.0 790 */ 791 P2pProvisionDiscovery([in] String ifName, [in] String peerBssid, [in] int mode); 792 793 /** 794 * @brief Set up a P2P group owner manually. 795 * 796 * @param ifName Indicates the NIC name. 797 * @param isPersistent Indicates Used to request a persistent group to be formed. 798 * @param networkId Indicates the network ID Enable. 799 * @param freq Indicates the freq of p2p group. 800 * 801 * @return Returns <b>0</b> if the operation is successful. 802 * @return Returns a negative value if the operation fails. 803 * 804 * @since 4.1 805 * @version 1.0 806 */ 807 P2pAddGroup([in] String ifName, [in] int isPersistent, [in] int networkId, [in] int freq); 808 809 /** 810 * @brief add service for p2p. 811 * 812 * @param ifName Indicates the NIC name. 813 * @param info Indicates P2p Service Info. 814 * 815 * @return Returns <b>0</b> if the operation is successful. 816 * @return Returns a negative value if the operation fails. 817 * 818 * @since 4.1 819 * @version 1.0 820 */ 821 P2pAddService([in] String ifName, [in] struct HdiP2pServiceInfo info); 822 823 /** 824 * @brief Remove service for p2p. 825 * 826 * @param ifName Indicates the NIC name. 827 * @param info Indicates P2p Service Info. 828 * 829 * @return Returns <b>0</b> if the operation is successful. 830 * @return Returns a negative value if the operation fails. 831 * 832 * @since 4.1 833 * @version 1.0 834 */ 835 P2pRemoveService([in] String ifName, [in] struct HdiP2pServiceInfo info); 836 837 /** 838 * @brief Stop an ongoing P2P service discovery. 839 * 840 * @param ifName Indicates the NIC name. 841 * 842 * @return Returns <b>0</b> if the operation is successful. 843 * @return Returns a negative value if the operation fails. 844 * 845 * @since 4.1 846 * @version 1.0 847 */ 848 P2pStopFind([in] String ifName); 849 850 /** 851 * @brief Flush P2P peer table and state. 852 * 853 * @param ifName Indicates the NIC name. 854 * 855 * @return Returns <b>0</b> if the operation is successful. 856 * @return Returns a negative value if the operation fails. 857 * 858 * @since 4.1 859 * @version 1.0 860 */ 861 P2pFlush([in] String ifName); 862 863 /** 864 * @brief This command can be used to flush all services from the device. 865 * 866 * @param ifName Indicates the NIC name. 867 * 868 * @return Returns <b>0</b> if the operation is successful. 869 * @return Returns a negative value if the operation fails. 870 * 871 * @since 4.1 872 * @version 1.0 873 */ 874 P2pFlushService([in] String ifName); 875 876 /** 877 * @brief Remove Network for p2p. 878 * 879 * @param ifName Indicates the NIC name. 880 * @param networkId Indicates the network ID Enable. 881 * 882 * @return Returns <b>0</b> if the operation is successful. 883 * @return Returns a negative value if the operation fails. 884 * 885 * @since 4.1 886 * @version 1.0 887 */ 888 P2pRemoveNetwork([in] String ifName, [in] int networkId); 889 890 /** 891 * @brief set group config for p2p. 892 * 893 * @param ifName Indicates the NIC name. 894 * @param networkId Indicates the network ID Enable. 895 * @param name Indicates the group config name of parameter. 896 * @param value Indicates the group config value of parameter. 897 * 898 * @return Returns <b>0</b> if the operation is successful. 899 * @return Returns a negative value if the operation fails. 900 * 901 * @since 4.1 902 * @version 1.0 903 */ 904 P2pSetGroupConfig([in] String ifName, [in] int networkId, [in] String name, [in] String value); 905 906 /** 907 * @brief set group config for p2p. 908 * 909 * @param ifName Indicates the NIC name. 910 * @param peerAddress MAC address of the device to invite. 911 * @param goBssid MAC address of the group owner device. 912 * @param ifName Indicates the NIC name. 913 * 914 * @return Returns <b>0</b> if the operation is successful. 915 * @return Returns a negative value if the operation fails. 916 * 917 * @since 4.1 918 * @version 1.0 919 */ 920 P2pInvite([in] String ifName, [in] String peerBssid, [in] String goBssid); 921 922 /** 923 * @brief set group config for p2p. 924 * 925 * @param ifName Indicates the NIC name. 926 * @param networkId Indicates the network ID Enable. 927 * @param bssid MAC address of the device to reinvoke. 928 * 929 * @return Returns <b>0</b> if the operation is successful. 930 * @return Returns a negative value if the operation fails. 931 * 932 * @since 4.1 933 * @version 1.0 934 */ 935 P2pReinvoke([in] String ifName, [in] int networkId,[in] String bssid); 936 937 /** 938 * @brief get the device address. 939 * 940 * @param ifName Indicates the NIC name. 941 * @param deviceAddress Indicates the device address info. 942 * 943 * @return Returns <b>0</b> if the operation is successful. 944 * @return Returns a negative value if the operation fails. 945 * 946 * @since 4.1 947 * @version 1.0 948 */ 949 P2pGetDeviceAddress([in] String ifName, [out] String deviceAddress); 950 951 /** 952 * @brief Schedule a P2P service discovery request. 953 * 954 * @param ifName Indicates the NIC name. 955 * @param reqService Indicates device mac address of the peer device. 956 * @param replyDisc Indicates service discovery sequence. 957 * 958 * @return Returns <b>0</b> if the operation is successful. 959 * @return Returns a negative value if the operation fails. 960 * 961 * @since 4.1 962 * @version 1.0 963 */ 964 P2pReqServiceDiscovery([in] String ifName, [in] struct HdiP2pReqService reqService,[out] String replyDisc); 965 966 /** 967 * @brief Cancel a previous service discovery request. 968 * 969 * @param ifName Indicates the NIC name. 970 * @param id Identifier for the request to cancel. 971 * 972 * @return Returns <b>0</b> if the operation is successful. 973 * @return Returns a negative value if the operation fails. 974 * 975 * @since 4.1 976 * @version 1.0 977 */ 978 P2pCancelServiceDiscovery([in] String ifName, [in] String id); 979 980 /** 981 * @brief the resp of server discovery for p2p 982 * 983 * @param ifName Indicates the NIC name. 984 * @param info Indicates resp info of server discovery. 985 * 986 * @return Returns <b>0</b> if the operation is successful. 987 * @return Returns a negative value if the operation fails. 988 * 989 * @since 4.1 990 * @version 1.0 991 */ 992 P2pRespServerDiscovery([in] String ifName, [in] struct HdiP2pServDiscReqInfo info); 993 994 /** 995 * @brief Start P2P group formation with a discovered P2P peer. 996 * 997 * @param ifName Indicates the NIC name. 998 * @param info Indicates all msg of the device to connect to. 999 * @param replyPin Pin generated, if |provisionMethod| uses one of the enerated |PIN*| methods. 1000 * 1001 * @return Returns <b>0</b> if the operation is successful. 1002 * @return Returns a negative value if the operation fails. 1003 * 1004 * @since 4.1 1005 * @version 1.0 1006 */ 1007 P2pConnect([in] String ifName, [in] struct HdiP2pConnectInfo info, [out] String replyPin); 1008 1009 /** 1010 * @brief Start P2P group formation with a discovered P2P peer. 1011 * 1012 * @param ifName Indicates the NIC name. 1013 * @param info Indicates all msg of the device to connect to. 1014 * @param replyPin Pin generated, if |provisionMethod| uses one of the enerated |PIN*| methods. 1015 * 1016 * @return Returns <b>0</b> if the operation is successful. 1017 * @return Returns a negative value if the operation fails. 1018 * 1019 * @since 4.1 1020 * @version 1.0 1021 */ 1022 P2pHid2dConnect([in] String ifName, [in] struct HdiHid2dConnectInfo info); 1023 1024 /** 1025 * @brief Set service discovery mode for p2p 1026 * 1027 * @param ifName Indicates the NIC name. 1028 * @param mode Indicates the service discovery mode of parameter. 1029 * 1030 * @return Returns <b>0</b> if the operation is successful. 1031 * @return Returns a negative value if the operation fails. 1032 * 1033 * @since 4.1 1034 * @version 1.0 1035 */ 1036 P2pSetServDiscExternal([in] String ifName, [in] int mode); 1037 1038 /** 1039 * @brief remove group for p2p 1040 * 1041 * @param ifName Indicates the NIC name. 1042 * @param groupName Indicates the group name of p2p. 1043 * 1044 * @return Returns <b>0</b> if the operation is successful. 1045 * @return Returns a negative value if the operation fails. 1046 * 1047 * @since 4.1 1048 * @version 1.0 1049 */ 1050 P2pRemoveGroup([in] String ifName, [in] String groupName); 1051 1052 /** 1053 * @brief Cancel Connect for p2p 1054 * 1055 * @param ifName Indicates the NIC name. 1056 * @return Returns <b>0</b> if the operation is successful. 1057 * @return Returns a negative value if the operation fails. 1058 * 1059 * @since 4.1 1060 * @version 1.0 1061 */ 1062 P2pCancelConnect([in] String ifName); 1063 1064 /** 1065 * @brief Get Group Config for p2p 1066 * 1067 * @param ifName Indicates the NIC name. 1068 * @param networkId Indicates the network ID Enable. 1069 * @param param Indicates the group config name. 1070 * @param value Indicates the group config value. 1071 * 1072 * @return Returns <b>0</b> if the operation is successful. 1073 * @return Returns a negative value if the operation fails. 1074 * 1075 * @since 4.1 1076 * @version 1.0 1077 */ 1078 P2pGetGroupConfig([in] String ifName, [in] int networkId, [in] String param, [out] String value); 1079 1080 /** 1081 * @brief Add a Network for p2p 1082 * 1083 * @param ifName Indicates the NIC name. 1084 * @param networkId Indicates the network ID Enable. 1085 * 1086 * @return Returns <b>0</b> if the operation is successful. 1087 * @return Returns a negative value if the operation fails. 1088 * 1089 * @since 4.1 1090 * @version 1.0 1091 */ 1092 P2pAddNetwork([in] String ifName, [out] int networkId); 1093 1094 /** 1095 * @brief Gets the capability of the group which the device is member of. 1096 * 1097 * @param ifName Indicates the NIC name. 1098 * @param bssid Indicates MAC address of the peer. 1099 * @param info Indicates Structure for saving device information. 1100 * 1101 * @return Returns <b>0</b> if the operation is successful. 1102 * @return Returns a negative value if the operation fails. 1103 * 1104 * @since 4.1 1105 * @version 1.0 1106 */ 1107 P2pGetPeer([in] String ifName, [in] String bssid, [out] struct HdiP2pDeviceInfo info); 1108 1109 /** 1110 * @brief Gets the capability of the group which the device is member of. 1111 * 1112 * @param ifName Indicates the NIC name. 1113 * @param bssid Indicates MAC address of the peer. 1114 * @param cap Indicates capabilityMask Combination of |P2pGroupCapabilityMask| values. 1115 * 1116 * @return Returns <b>0</b> if the operation is successful. 1117 * @return Returns a negative value if the operation fails. 1118 * 1119 * @since 4.1 1120 * @version 1.0 1121 */ 1122 P2pGetGroupCapability([in] String ifName, [in] String bssid, [out] int cap); 1123 1124 /** 1125 * @brief List all network information. 1126 * 1127 * @param ifName Indicates the NIC name. 1128 * @param infoList Indicates Structure for saving network information. 1129 * 1130 * @return Returns <b>0</b> if the operation is successful. 1131 * @return Returns a negative value if the operation fails. 1132 * 1133 * @since 4.1 1134 * @version 1.0 1135 */ 1136 P2pListNetworks([in] String ifName, [out] struct HdiP2pNetworkList infoList); 1137 1138 /** 1139 * @brief save config for p2p. 1140 * 1141 * @param ifName Indicates the NIC name. 1142 * @return Returns <b>0</b> if the operation is successful. 1143 * @return Returns a negative value if the operation fails. 1144 * 1145 * @since 4.1 1146 * @version 1.0 1147 */ 1148 P2pSaveConfig([in] String ifName); 1149 1150 /** 1151 * @brief Reassociate in wpa supplicant. 1152 * 1153 * @param ifName Indicates the NIC name. 1154 * 1155 * @return Returns <b>0</b> if the operation is successful. 1156 * @return Returns a negative value if the operation fails. 1157 * 1158 * @since 4.1 1159 * @version 1.0 1160 */ 1161 Reassociate([in] String ifName); 1162 1163 /** 1164 * @brief STA CMD in wpa supplicant. 1165 * 1166 * @param ifName Indicates the NIC name. 1167 * @param cmd Indicates command of Sta from WifiHal 1168 * Example: If CMD is "SET external_sim 1", then 1169 * the final result is "external_sim=1". 1170 * 1171 * @return Returns <b>0</b> if the operation is successful. 1172 * @return Returns a negative value if the operation fails. 1173 * 1174 * @since 4.1 1175 * @version 1.0 1176 */ 1177 StaShellCmd([in] String ifName, [in] String cmd); 1178 1179 /** 1180 * @brief wpa vendor ext process cmd. 1181 * 1182 * @param ifName Indicates the NIC name. 1183 * 1184 * @return Returns <b>0</b> if the operation is successful. 1185 * @return Returns a negative value if the operation fails. 1186 * 1187 * @since 4.1 1188 * @version 1.0 1189 */ 1190 VendorProcessCmd([in] String ifname, [in] String cmd); 1191 1192 }