I believe you need to use the p2p_listen, I'd suggest you t read the Intel® Edison Products — Intel® Edison Wi-Fi User Guide on section 6 it explains Wi-Fi direct feature of Edison, and the available commands for it, I believe that document might help you.
I went through the guide for connecting, isnt p2p_listen is to receive data? I am not sure of it .
Guide only talks of establishing connection, i have no idea how to send file or their respective commands FROM EDISON..
I am wondering if i need to install any other software to use FTP on Wifi-Direct.
New to these stuff, hence learning and trying out
Sorry, you're right, I misunderstood your question (I thought you were trying to do the opposite), I believe the information in the two following links will help you, there's a deep explanation on the functions of the P2P commands, and also examples of how to use them:
However if you don't need to transfer your file with P2P, you could use SCP, more info about SCP:
I will try out SCP.
Currently, i am trying this.
Since we have a connection established and the ip of the peer known, im using socket programming to establish TCP or FTP to transmit data/file. I havent tried it yet, but i am hoping this would work.
What are your thoughts on this?
I successfully managed to transfer files through Wi-Fi direct using SFTP, I followed the Intel® Edison Wi-Fi User Guide to create a basic P2P connection and then I set up a P2P connection with PIN as autonomous GO.
I used SFTP to transfer files from one Edison to another, you can get the openssh-sftp package (the one that I used) from AlexT's repo. I'd suggest you to install it before trying to set up the W-Fi Direct connection. Once installed it is very easy to use, you could check sftp(1): secure file transfer program - Linux man page to learn more about it.
To sum up all you have to do to transfer files from one Edison to another is to access the SFTP interactive mode by typing a line like "sftp user@host" (the user being the user of the Edison and the host being the IP address of the Edison), then you will be able to see the files on the other device, and you will be able to copy them to your original Edison by typing the line "get DESIREDFILE".
Ill try it also!