This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

In pc-ble-driver: which file you need to edit to add some custom logic

I have successfully manged to achieve serial communication between my PC (Windows) and nRF52 board by using the pc-ble-library and the pc-ble-library-js .

I can run without problems, npm test or node examples/heart_rate_monitor.js.

Let's say I want to now achieve following thing, an example, when I press one of the buttons on the board, the node.js app would log something like this: "you pressed the button 1"

which file I need to edit, that is where I need to write the code for that, and are there some tutorials/examples/suggestions on how to do it

to be more precise, I'm confused which file I need to edit for handling the logic for the board, and then how to build it, and flash it again etc

thanks

Parents
  • First, You need to modify serialization firmware, so the nRF5x would forward that kind of events. Second, you should modify communication protoocl of the driver, so there is a place for "your" messages (events?), that would not interfere with the rest of the protocol. Last, you have to modify driver on the pc side, so it will receive and interpret that kind of events. I cannot help you which files are responsible of those parts - You have to analyze structure of the firmware by yourself i think. Or maybe someone from Nordic will help you.

Reply
  • First, You need to modify serialization firmware, so the nRF5x would forward that kind of events. Second, you should modify communication protoocl of the driver, so there is a place for "your" messages (events?), that would not interfere with the rest of the protocol. Last, you have to modify driver on the pc side, so it will receive and interpret that kind of events. I cannot help you which files are responsible of those parts - You have to analyze structure of the firmware by yourself i think. Or maybe someone from Nordic will help you.

Children
Related