Chintak Sheth

Q: 2-way Bluetooth communication between iOS and Ubuntu

I am working on a project for where I need to send messages (`string`) from iOS (client) to an Ubuntu (server). The communication needs to be two-way, i.e. iOS makes a request to the server and the server will respond with some data. The server needs to perform some actions based on the request and hence it may not be able to respond immediately.

 

It could be argued that this can be accomplished by extending the heart rate monitor example. Total of 3 characteristics needed for any service - 1 on the client and 2 on the server:

  • First, the client can set the value of a Characteristic on the server (which corresponds to initiating a request).
  • Second, once the data processing is done and the data is available on the 2nd Characteristic of the server, the server can set the value of the Characteristic on the client (corresponding to an acknowledgement).
  • Third, the client can then read off the string message one byte at a time till some code corresponding to end of message (say ESC or ASCII 27) is reached.

 

Is this design suitable? If yes, then can you provide link to writing custom services on iOS and Ubuntu? Any other ways of accomplishing this?

iPhone 5s, iOS 8.4, null

Posted on Aug 13, 2015 2:40 AM

Close

Q: 2-way Bluetooth communication between iOS and Ubuntu

  • All replies
  • Helpful answers