I am creating a program which connects to the WIFI via the network’s name and password. I’m able to do it with the system call of the command nmcli dev wifi connect <mySSID> password <myPassword>
, but I’m not sure that this is the best way of doing this.
For example, how can I handle the incorrect password case? Checking the CERR of the command output isn’t really the solution.
I would like to avoid using the system calls. Is there a way of doing this with usual programming, and preferably not very difficult?