You can find instruction on how to manually set SPP from Linux in Bluetooth communication using Java? or if you are interested in running SPP-loopback.py, you can find instructions on how to do it in How to run SPP-loopback.py on Edison.
If what you want to do is to start the SPP connection with an Arduino IDE sketch, then your best option would be to make system calls from your code in order to get the expected behavior.
Thanksfor the reply. Can you help me out to how to call spp from arduino sketch? I need to send and receive data over bluetooth to my arduino sketch.
I would first make Bluetooth to be set automatically on boot, you can learn how to do it with this guide: Automatically connect to a device through Bluetooth. Then I would create a shell script that set everything up for SPP manually. It should look like the following:
#!/bin/sh sdptool add --channel=22 SP rfcomm watch /dev/rfcomm0 22 > /dev/null & bluetoothctl << EOF discoverable on quit EOF sleep 1 cat /dev/rfcomm0 > /dev/ttyGS0
Then you will have to make that shell script executable with the command chmod +x YOUR_SCRIPT.sh. Finally you should be able to run this shell script from your Arduino code with a system call like the following:
You should then see the SPP output on the Arduino Serial Monitor.
Is there a way that you could do this so that the SPP output is on the Intel XDK console?
Where exactly do you want the messages to appear? Could you please give me an example of how you would like to receive the messages?