Xojo and Bluetooth

Greetings, folks -

I am mostly an embedded device developer. You can see what I do at www.orelectronics.net I’m working on the next generation of my main product and I want to add Bluetooth (actually BLE) to it. The tasks would be data streaming (at modest equivalent baud rates - 38kbaud or less) and a terminal-like interface for configuration. I don’t know much about Bluetooth yet. On my semi-ancient Mac running High Sierra, I see Bluetooth appearing as a serial port. This will need to work cross-platform, ultimately including Android and iOS if possible.

Can anyone give me some hints about the high-level side of this so that I can do the embedded-side (not even sure which should be host and which should be client) somewhat intelligently? What software interface would be used and would it be the same for Windows, Mac, etc?

Probably have not asked the right questions, here, because I really don’t know what to ask. Will try to fill in, in response to postings, as I am able.

Many thanks
Jim Wagner
Oregon Research Electronics

This much I can tell you… BlueTooth communications with Swift (for iOS, macOS and AppleTV) is almost a no-brainer… There is no set “BAUD” rate… I believe the two devices negotiate that automatically.

Thanks, Dave -

How does an application access SWIFT?


an application doesn’t “access” Swift… Swift is a programing language, just like Xojo is a programming language… But at this point in time only for Apple Platformed devices.

OK, is there some useful starting point for SWIFT?


not to be smug… but Google is your friend

just remember however, if Windows and/or Android are hard requirements, then Swift isn’t your answer at the moment

Well, Windows is, though I am not adverse to having two implementations. But, isn’t that what Xojo is supposed to help with?

I’ll try the main Xojo forum, also, and see if I can get any bites there. Anyone else, here?

Many thanks

MBS has a plugin for that.



I do lots of embedded too.

what limited stuff I used Bluetooth on was very easy, serial port to serial port is almost too easy, no baud rate or connection to worry about, the serial settings are only to connect to the actual driver, on air its entirely transparent and only any data you send is transferred, it just appears at the other end.
I have done this module to module with a PIC as the data source and module to a Mac, with just a terminal on the Mac.

in Xojo there is no need to use any driver, just connect to the Bluetooth port with a serial port and its perfect immediately.
works on all platforms, I even have an android phone talking to my iMac.

bluetooth is bit of a red herring as its just the transport layer, if I understand your question correctly.


Classic Bluetooth (Serial = SPP profile) is not accessible to “regular” developers in iOS. You need to be part of a program named MFi.

BLE is available. On Android, both types of Bluetooth are accessible.

Thanks, everyone. This goes a ways toward the learning. In the regular Xojo forum, the standard solution seems to be MBS. doj (Mark), could I correspond with you off-forum? wagnejam99 at comcast dot net

Appreciate your input and suggestions!


I have explored the MBS BLE stuff and it seems to work very well

Note that Bluetooth Low Energy (BLE) is significantly different than a more traditional Bluetooth device - the way you connect to it, communicate with it, manage connection to the device, etc.

My company is currently in the final phases of developing a Xojo-based solution which communicates with a BLE device we’ve developed. I’m happy to try to answer any questions you may run into.

Thanks for your responses. For prototyping, I am going to try an RN4870. There seems to be a fair amount of example code for the embedded end and several code examples for the “smart” end. For BLE, with my Mac, it looks like opening a serial port. At this stage, I just need to demonstrate that my embedded hardware and software is capable of supporting BLE. The “for real” implementation is out, a ways.

I’d be very interested to hear if this is true. With our BLE implementation, there are no serial ports involved at all.

Will be able to report in a couple of weeks.

Switch to B4X. You won’t regret it. So much more capable. The IDE itself is worth switching. I ditched Xojo and simply cannot find any reason to go back.

For what it worths, the confusion likely came because Dave spoke about Swift and you talked about Xojo; those are 2 programming languages, not tied together, and only Xojo, among these two, can produce Windows executables.