How start new WPA device from code using any wpa_supplicant interface

274 views Asked by At

I need to open new WPA/WPA2 device from linux c code. Now I create it manualy by using wpa_supplicant

wpa_supplicant -iwlan0 -c connfig.conf -B
  • How I can to start it from my code (without using system() )?
  • What wpa_supplicant interface is intended for this ?

Maybe, do you have any example ? hanks in advance

2

There are 2 answers

0
Shachar Shemesh On

Assuming wpa_supplicant is already running, it has the "add_interface" command designed to do just that.

If it isn't already running, you will need to run it, either with system or with exec.

Shachar

0
neo On

You can probably use wpa_cli. wpa_cli is text-based frontend program for interacting with wpa_supplicant. Have a look here and here.