Cross platform bluetooth development solutions - bluetooth

I made a little heart rate monitor app with Unity, but trying to ship it to Windows, the bluetooth part isn't cross platform.
Are there existing cross platform (mac/windows, linux too would be nice but not a dealbreaker) bluetooth solutions?

Unfortunately there isn't a "pure" cross-platform solution where you can write one application that works across multiple platforms. This is because the underlying stack for different OSes/platforms is different because the hardware is different for them. The closest thing to a cross-platform solution might be Xamarin as theoretically you can write an application that works for Android/iOS/Windows. Have a look at the links below:-
Developing Cross-platform BLE Apps
ble.net: cross platform BLE library
BLE on Xamarin Cross-platform
The smart BLE Guide: Add BLE to your app with Qt and Flego

Related

Comparison Zephyr vs SoftDevice

I am looking for a comparison of the Zephyr vs SoftDevice for BLE applications. There is a lot of talk on the internet about it, but nothing concrete. Has anyone used both stacks on the same SOC for the same app and can talk about the differences?
I am not sure if you mean the differnce between Zephyr and nRF Connect SDK (i.e. network core) or if you mean Zephyr vs Nordic SDK (i.e. Writing applications in Zephyr RTOS vs normal C applications) but I'll try to cover all scenarios. I've been using nordic devices for over a decade now and this is my input regarding the difference:-
Nordic SDK with SoftDevice
This is Nordic Semiconductor's proprietary software development kit (SDK) that includes a SoftDevice (a pre-compiled binary that implements the Bluetooth Low Energy stack) and a set of libraries for programming the nRF devices. The Nordic SDK with SoftDevice provides a high-level, easy-to-use API for Bluetooth development on the a variety of nordic devices including the nRF51 and nRF52. It also includes additional features, such as power management, security, and device management. The SDK + SoftDevice is what Nordic first released with their chips all the way back when they started BLE development. You can find out more about Nordic's SDK and softdevice in this very comprehensive guide by Nordic.
Pure Zephyr RTOS
Zephyr is an open-source RTOS that supports a wide range of hardware platforms (including Nordic's nRF devices). It is based on a small kernel that is designed for embedded systems. The beauty of the Zephyr OS is that it is open source and also includes all the modern-day RTOS functionalities such as multi-threading, interrupt servicing, memory allocation and more. Furthermore it has numerous libraries and applications for many embedded chips and external hardware (full list of supported HW can be found here). You can find out more in Zephyr's documentation here.
Some nordic devices such as the nRF51 and nRF52 now allow you to write applications in either Zephyr RTOS or using the previously mentioned SDK+softdevice. However, active development on the SDK+softdevice has stopped and Nordic have fully migrated to using Zephyr RTOS + nRF Connect SDK (the final option below).
When using Zephyr with nRF devices, you have one of two options: 1) Softdevice Controller, and 2) Zephyr BLE controller. Option (1) will be described in the section below. Option (2) is a full open source BLE controller which includes both the upper and lower implementation to make it possible to support multiple HW platforms. In other words, one of the main advantages of using this option is that you can switch from an nordic device to another BLE device with minimal changes to your application. You can find more about this here.
nRF Connect SDK based on Zephyr and using Nordic's SoftDevice
Finally, the nRF Connect SDK is a software development kit based on the open-source Zephyr RTOS (described above), but with some additions from Nordic. These additions include more documentation, libraries (e.g. Firmware Over the Air Upgrade - FOTA, and CryptoCell libraries), and generally more support from Nordic. This SDK also includes Nordic's own softdevice, which is tried and tested and qualified via Nordic. You can find more about nordic's nRF Connect SDK here.
To conclude, if I had to give a final recommendation, I would say go for nRF Connect SDK (especially if you are sure that you will use nRF for the lifetime of your product) - as this way you'll end up getting all of the advantages of using the Zephyr RTOS plus the advantages of having Nordic's reliable software and libraries. On the other hand if your goal is to have your application fully open sourced or if you think you might migrate to another HW platform in the future, "pure" Zephyr RTOS
is the better option. The old Nordic SDK + softdevice isn't a consideration given that it is now outdated and support for it has effectively stopped.
Some other useful links:-
nRF Connect SDK vs (vanilla) Zephyr
nRF Connect SDK (Zephyr) vs standalone nRF5 SDK
Zephyr tutorial: BLE development
nRF Connect SDK BLE tutorial part 1
BLE with Zephyr on an NRF52

What language/libraries best for BLE connectivity?

Operating system: MacOS
Just for some context on what I am trying to do, I have an Ikea standing desk which has bluetooth. I am able to control the desk with a built in app. I want to create a server running on a raspberry pi that connects to desk and controls it, I then want to create an Alexa skill which will control the desk by calling the server endpoints.
What's the best language/library you would suggest I use? Ideally something that would run on MacOS and Ubuntu.
I don't know anything about BLE yet which is why it is hard for me to find a good answer. If you have resources, books or tutorials that will help me get running with BLE please recommend them.
My use case:
Get desk to go up
Get desk to go down
Get current position of desk
If you want to write one app that works for both MacOS and Ubuntu then as ukBaz said, python and Bleak are your best options. If you want to use the native way of writing BLE apps for each OS, then you can use CoreBluetooth on MacOS and BlueZ on Ubuntu. The advantage of the former is that you can get an application up and running quickly, and the advantage of the latter is that you will find a lot more resources and advanced functionality.
Below are some resources that can help you in your development:-
Theoretical Bluetooth:
Bluetooth Low Energy: A Primer
Getting Started with Bluetooth Low Energy
Ellisys Bluetooth Series
CoreBluetooth
Getting Started with CoreBluetooth
Ultimate Guide to Apple's CoreBluetooth
iOS App Full Example
BlueZ
Configuring Bluetooth devices with bluetoothctl
Ubuntu: Accessing GATT services
Python
Ikea IDÅSEN desk API and CLI
Idasen controller example
Using Python for Bluetooth

Bluetooth mesh simulator

I am working on a project that involves Bluetooth Mesh Network (based on BLE) that was standardized with Bluetooth version 5.0. I am searching for a suitable simulator for at least some of the following solutions.
Mesh message delivery (Flooding)
Ability to simulate an environment (Path loss, multipath fading)
Can someone help me find a simulator as the one explained above?
Probably the best easy and cheap option is the nRF Mesh app for Android/iOS devices. It might not be advanced to do full simulation but you'll find most of what you need to get started and then you can tweak things or expand from there manually.
More information is available here:-
nRF Mesh app features
The ultimate Bluetooth mesh tutorial (Part 5)
A developer's guide for proving mesh interoperability

node.js BLE API for windows requires external dongle

I'm developping a node.js electron app and I need to decide if our Hardware will feature BLE or standard Bluetooth.
I found a couple of APIs (bleno & noble) for this purpose. However for Windows OS both of these require me to use an additional bluetooth usb adapter (used WinUSB & Zadig).
To put it bluntly, is there any way to communicate with a BLE device on a Windows OS using node.js without using an external dongle?
It seems like standard bluetooth is just way less of a hassle. Thanks!
Found a package which solves this issue using a UWP-to-noble bridge:
https://www.npmjs.com/package/noble-winrt
It works just like noble but supports BLE connectivity on Windows without the need for a dongle and complicated driver set-ups!
I was able to easily integrate it on Electron as well, problem solved! :)
The official Bluetooth API on Windows is built for Windows Runtime, https://learn.microsoft.com/en-us/microsoft-edge/windows-runtime. It supports Javascript but I'm not sure if you need a specific js environment. If you don't get that working, you should write or use a native binding for node.js.

Which mobile operating systems support J2ME?

I've been tasked with using WURFUL to determine whether or not a mobile browser is capable of downloading a J2ME app developed by my company.
I first thought I could use the "device_os" tag and filter by that, however, I'm unsure what the complete list of J2ME OS's are... any ideas?
I've been told there are no MIDP requirements, and that the application will run on any J2ME-supported handset (with two specific resolutions, which I already know how to query)
Thanks in advance.
There is no way to know all the OSes that support J2ME. Mainly because most feature handset comes with a proprietary OS which probably you have never seen before. It is a better idea try to identify the handset model and decide if it supports J2ME or not.
Another thing is, you may want to know which JSRs are supported by a specific handset. I do not know your application but probably you are using some optional JSRs that are not supported by some handsets although they have basic J2ME support.
Java ME SDK 3.0 includes a database of supported devices. Also there are other web sites that provides these kind of information. One example to those would be this J2ME Handsets web site.
If you are fine with just covering a large range of phones, you should include Symbian S60, S40, Windows Mobile, Blackberry and Android.
Symbian
Win Mob
Android
Almost every Sonyericsson phones
IMHO you don't have to worry about how many handsets support j2me because majority of the phones support it.
At least Symbian and Android.

Resources