I am in the middle of a project, where I want to use the integrated bluetooth device on a Raspberry Pi 3 running Jessie and an Android phone to communicate with each other. It is important to notice that the RPi will be in a location, where it is not possible to connect a screen or keyboard to it. So I wont be able to pair the phone and RPi beforehand.
I am writing a program in c++ which will under normal circumstances use a 3G USB dongle to communicate with a server. The phone can then extract the data from the server. If the 3G connection goes down, I want to use bluetooth as a failsafe. Therefore I need to be able to do the listening for bluetooth devices and take care of the bluetooth communication from within my c++ program. Is this possible? If yes, I would appreciate an example or a hint to where I can find any information regarding this.
I have found a lot of guides, where you need to pair the phone and RPi beforehand. But this is not what i want.
I don't care about security.
Thanks in advance :)