3

Is there a serial port profile for BLE?

Guest gravatar image

asked 2013-06-10 22:40:28 +0100

updated 2013-08-01 11:03:18 +0100

Is there any equivalent to the SPP profile from Bluetooth Classic? I've always used this as a way to transmit custom data using Bluetooth, but I can't seem to find anything equivalent for BLE.

edit retag flag offensive close delete report spam

Comments

5 answers

Sort by ยป oldest newest most voted
3
olha gravatar image

answered 2013-06-10 22:45:51 +0100

updated 2014-02-19 09:43:12 +0100

No, there isn't really any SPP equivalent. However, with BLE, it is important to understand that all the profile and service support is entirely in the application space. This is opposed to the situation in Bluetooth Classic, where it seems to me that all profiles used in the application actually had to be natively supported by the stack used.

This means that with BLE, there isn't really a need for a serial port service to transmit custom data, since you can easily make your custom service, that is specially tailored for the data your application needs to transfer. This avoids the need for cramming all kinds of data into serial packages, and most often this leads to much cleaner data handling strategies and hence applications.

We're working on an application note explaining how to build a custom service for the S110, and I'll add a link here as soon as it's published. For now, I'd recommend taking a look at the battery service (ble_bas.c, ble_bas.h), and trying to understand it at least partially and building from there.

Edit: The application note is now out; nAN-36.

edit flag offensive delete publish link more

Comments

Thanks for your ultra fast reply. I'll take alook at it again. Could you also provide me with some hints on making a custom service (with custom data). I need to send around 1KB/sec, but I wasn't able to acheive this rate with my first BLE attempt. So I've moved to Gazelle, but BLE might be a better choice in the long run.

Guest ( 2013-06-24 14:35:27 +0100 )editconvert to answer

Ole Morten - thanks for the hints on how to setup the connection interval etc. I'm now able to control the connection rate, so the next step is to actually try and implement a custom service. When do you expect an example to be ready?

KPE ( 2013-06-24 19:49:13 +0100 )editconvert to answer

Unfortunately, I can't really give any promises on schedule yet, especially not now in the time of holidays and variants. In the mean time, this question, which I answered earlier may give some good hints: http://devzone.nordicsemi.com/index.php/what-is-the-most-efficient-way-to-transfer-data-over-ble The general tip is to structure things similar to the SDK services, make an init method that adds the service and all its characteristics, an event handler to handle events coming from the S110 and then all methods you need to do whatever is special for your service. As I said to the other person, the battery service is probably the simplest in the SDK, and should be a good starting point.

Ole Morten ( 2013-06-24 20:21:12 +0100 )editconvert to answer

Hi Ole. Any news on that services app note? ;)

sd ( 2013-07-16 15:15:14 +0100 )editconvert to answer

Very useful information. However - one of the reasons SPP is so attractive is on the host side (PC, smartphone,,): Here you don't need to use and know special libraries to get connected to SPP. Its the usually well known serial port library which is supported in all compilers and languages. Can you comment what is needed on the host side for this BLE solution? I know this may be too broad a scope to answer. Personally I am in Windows. Will this aspect be mentioned in the upcoming app note?

henning larsen ( 2013-07-31 21:44:09 +0100 )editconvert to answer

Sorry for the delay in answering this. Unfortunately no news on the schedule for the app note. As for your questions on host support, Henning, they may be better suited in a separate question. It won't be covered by the app-note. However, to answer it briefly most new OS-es from now seems to expose native GATT APIs, making it easy to connect to BLE devices and using their services. It won't give you a normal serial port, but APIs that still should be quite easy to use. This is applicable for Windows 8, iOS from version 5 and Android from 4.3.

Ole Morten ( 2013-08-02 14:05:54 +0100 )editconvert to answer

The application note is now out! Get it here: https://www.nordicsemi.com/eng/nordic/download_resource/24020/2/80193304

Ole Morten ( 2013-10-09 14:13:56 +0100 )editconvert to answer

Hello. Is there this application note for nRF52832 Development Kit?

Gokhan ( 2017-03-15 10:25:54 +0100 )editconvert to answer
2
Philip gravatar image

answered 2013-07-31 20:56:16 +0100

"application note explaining how to build a custom service for the S110"

This would be tremendously valuable. A basic example using the softdevice gatt functions would make this a lot easier. Although the BPS example is simple, it doesn't provide enough information to extrapolate the order of operations needed to setup the custom GATT details.

Any ETA? Shoot, a code snippit showing the services_init() function would probably be enough to help.

edit flag offensive delete publish link more
1

Unfortunately no ETA, but for an actual working example of a custom service you can take a look at the UART application available here: https://devzone.nordicsemi.com/index.php/nrf-uart-app#reply-402

Guest ( 2013-08-01 10:47:14 +0100 )editconvert to answer

Unfortunately no ETA, but for an actual working example of a custom service you can take a look at the UART application available here: https://devzone.nordicsemi.com/index.php/nrf-uart-app#reply-402

Bastiaan ( 2013-08-01 10:47:14 +0100 )editconvert to answer

Just for completeness, the application note mentioned is available here: https://www.nordicsemi.com/eng/content/download/34055/573345/file/nAN-36.zip

Bastiaan ( 2013-12-03 09:41:34 +0100 )editconvert to answer

Just for completeness, the application note mentioned is available here: https://www.nordicsemi.com/eng/content/download/34055/573345/file/nAN-36.zip

Guest ( 2013-12-03 09:41:34 +0100 )editconvert to answer
0
KPE gravatar image

answered 2013-06-24 21:08:25 +0100

Thanks again for your prompt replies - they are incredible helpful :-)

I'll try to extend the battery service and see if I can make something useful out of it.

edit flag offensive delete publish link more
0
olha gravatar image

answered 2013-06-24 14:15:44 +0100

oleg0x309 gravatar image

updated 2014-09-23 13:52:17 +0100

The primary factor deciding how fast the S110 will be able to send data is the connection interval. Please take a look on this: http://devzone.nordicsemi.com/index.php/what-is-connection-parameters To change it, the SDK includes a module called ble_conn_params, which will send update request based on the defines in the top of main.c of the application. It could be worth looking into. If you still can't make it work the way you want, I'd recommend you to create a new question, attaching your code so that we can take a look.

edit flag offensive delete publish link more
0
Guest gravatar image

answered 2013-06-24 14:10:26 +0100

roger chan gravatar image

updated 2016-04-08 05:21:04 +0100

I'm looking forward to this. I tried this approach, but I wasn't able to send data fast enough. It seems like there's a limit on the number of updates pr. second, and the max length of the data returned. I'd love to have an example that shows how to do custom services.

edit flag offensive delete publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

User menu

    or sign up

Recent questions

Question Tools

Stats

Asked: 2013-06-10 22:40:28 +0100

Seen: 35,053 times

Last updated: Aug 01 '13