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

nRFGO services.c files with nRF8001 Arduino SDK

Hi, I have been using the nRF8001 Arduino SDK with nRF8001 chip. I wanted to set the data for the different services I'm using and thought I would go ahead and use the services.c file generated by nRFGO Studio. But the file that nRFGO Studio generates (and I have the latest 1.16.1 version) won't work with the Arduino SDK. The function calls in services.c to lib_aci.h functions are wrong. Is there any version of nRFGO Studio that could be used to generate a working services.c file?

Parents
  • Hello Runar, I tried running nrfgostudio using the bat file as you suggest. If I use codeGenVersion 1 as you show I only get a services.h file. And I have been using that services.h with my Arduino SDK code for a few months now. But I am adding code to set up other things like Device Information. And rather than writing my own functions to send data to the nRF8001 I thought I would use the functions that nrfstudio can generate and store in a services.c file when you use the codeGenVersion 2 option. But the problem is, the code in the services.c file does not work with the Arduino SDK. And there is no nrfgostudio option I could find to fix it. An example of the problems is that calls to lib_aci_set_local_data() need an aci_state pointer in the Arduino SDK version but not the non Arduino SDK version.

    For now I have renamed services.c to services.cpp (so that things like the bool variables work), added a function that can be called to pass in a pointer to the aci_state structure, and changed the function calls that require an aci_state pointer to have them. I can get the services code to compile and work that way.

    Is there some undocumented option to nrfgostudio to really generate a services.cpp file that would work with the Arduino SDK?

Reply
  • Hello Runar, I tried running nrfgostudio using the bat file as you suggest. If I use codeGenVersion 1 as you show I only get a services.h file. And I have been using that services.h with my Arduino SDK code for a few months now. But I am adding code to set up other things like Device Information. And rather than writing my own functions to send data to the nRF8001 I thought I would use the functions that nrfstudio can generate and store in a services.c file when you use the codeGenVersion 2 option. But the problem is, the code in the services.c file does not work with the Arduino SDK. And there is no nrfgostudio option I could find to fix it. An example of the problems is that calls to lib_aci_set_local_data() need an aci_state pointer in the Arduino SDK version but not the non Arduino SDK version.

    For now I have renamed services.c to services.cpp (so that things like the bool variables work), added a function that can be called to pass in a pointer to the aci_state structure, and changed the function calls that require an aci_state pointer to have them. I can get the services code to compile and work that way.

    Is there some undocumented option to nrfgostudio to really generate a services.cpp file that would work with the Arduino SDK?

Children
No Data
Related