I was able to find Edison on my Android phone through Wi-Fi direct by sending an invitation with a pin number. Is there a way for me to program a code in Arduino to accept the invitation by writing the pin number back? It works only if I use ssh and send an invitation with a p2p command but I'm trying to get it to work the other way around. Is this even possible?
I haven't seen a sketch like this but you could try to do it with system calls or with a Bluetooth library. For system calls you need to use system ("linux_command"), take a look at this thread: it may help you with this.
As you may know there isn't a Bluetooth library for the board but some other libraries have been tested and/or you could create your own in order to achieve this. (http://download.intel.com/support/Galileo-Edison_ShieldTestReport_330937-002.pdf Shields Test Report)
You can also try to change the configuration between the devices in order to not need a pin for the validation of the connection.
The goal of the project that I am working on is to use Wi-Fi Direct instead of Bluetooth. So let's say, I try to connect to the Edison through my Android phone and my phone sends an invitation with a pin number, how can I use a system call so that the Edison checks if an invitation has been received? I am hoping the invitation comes with both a MAC address and a pin number so that I can use the following p2p command to connect to my Android phone:
wpa_cli -ip2p-dev-wlan0 p2p_connect join
In short, what kind of system call should I use to check if the Edison has received the invitation?
I would like to use a pin to validate the connection for security purposes.
The system calls are used with Linux commands, for example you can use system("configure_edison –setup"); but you will not see the output of this on the Serial Monitor because you will be using different devices (/dev/tty*). What I suggest you to do is to create a script/sketch that will receive the invitation of the phone in order to save the address and pin into a file. Then, you can access the file and read the data.
If you want to use an Arduino sketch, I suggest you to look into the SD library for more information about how to manage files, there are some examples on the IDE that may give you an idea on how to start.