6 years, 7 months ago.


What is the best way to remotely execute a function on a nRF51822 using BLE protocol? Until now I didn't need it, just read and write data but in this case be able to remotely start the execution of a function (or a class method) would simplify my source code.

The function should return an int and accept 4 parameters.

Question relating to:

The nRF51822-mKIT is a low cost ARM mbed enabled development board for Bluetooth® Smart designs with the nRF51822 SoC. The kit gives access to all GPIO pins via pin headers …

1 Answer

6 years, 7 months ago.

Best solution might be an overstatement, but I can think of one: Have one Characteristic for the parameters that can only be written to (supports Write). The limitation is that the parameters should be fixed, and if there are several functions you would need an opcode. Then have another Characteristic for the result, which can notify or indicate. Group them in an RPC service.

Sounds good?

Yes, more or less it is what I tryed after the first answer because at the moment I need 3 functions with different parameters and two returning a value.

posted by Massimo Manca 15 Jun 2016

P.S. I posted the question in 2 different places in mbed.org so here yours is the 1st. Apart Simple BLE in the mbed BLE stack is there any support to RPC or similar? I mean a way to pass some parameters, execute a specific function and return a value. Returning a value could be done asynchronously and started from the device because the function can require no so little time to execute.

posted by Massimo Manca 15 Jun 2016

RPC is something you would normally add on top of a communication channel, BLE for example. So it would be at the level of a GATT profile. To my knowledge there is no standard RPC protocol in Bluetooth, just the building blocks for the communication.

posted by Eirik Midttun 15 Jun 2016