NordicSemiconductor / ble-sdk-arduino

MIT License
249 stars 97 forks source link

services.c generated from RFStudio have wrong signature #6

Closed pfried closed 10 years ago

pfried commented 10 years ago

The services.c file which is generated from the nRFGo Studio has the wrong signature, since:

The function lib_aci_is_pipe_available only has the Pipe Number as a parameter like in thie example:

if (lib_aci_is_pipe_available(PIPE_GENERIC_GENERICSENSOR1_TX))

but the function in the lib_aci file expects:

lib_aci_is_pipe_available(aci_state_t *aci_stat, uint8_t pipe)

I think this is an error, since auto-generated files should always be compatible with the library otherwise they are nice as a template but do generate compile errors.

Skjerve commented 10 years ago

Services.c is not used in ble_sdk_arduino. Use the bat file that is part of the examples to generate the services.h file. Example: ("%NRFGOSTUDIOPATH%\nrfgostudio.exe" -nrf8001 -g UART_over_BLE.xml -codeGenVersion 1 -o .)

pfried commented 10 years ago

Well if it is not used why is it generated? I ported the driver to atmels xmega controllers and basically i have to recode all the stuff which is in services.c , if it was signature compatible I could use it.

Skjerve commented 10 years ago

This file was used in the 8051 based SDK that is hosted on our webpage. When porting this SDK to the Arduino platform we removed this interface and the dispatcher and replaced it with the command and event queue you can see in the arduino sdk. This was done based on feedback from our customers and to make the Arduino SDK easy to port. With nRFgo studio there are several options when generating this files. If you look at the latest version of nRFgo studio the default option is not to generate the sercvices.c file. Of course, as you say, if you want to use the services.c file with the arduino SDK you would have to recode it, but this was not intended from our side. However if we get multiple requests from customers that want to use this we will consider adding/updating it. Right now it is there for the previous SDK.