Based on this tutorial - I can programmatically ( C++ ) setup one XBee S6B WiFi module in soft Access Point mode:
This question sheds light how to do a scan:
Basically, issue an ATAS command to find nearby SSIDs. So I can find my XBee in Access Point mode.
I can see in this command table how to check the status of a network join attempt:
Basically you issue an ATAI command to see the status.
But how do I "initiate" a connection. I can see that ATID sets the SSID for the client ( non-access point ) module. But how do I tell it to "Connect" now. The Access Point will be passwordless.