Reply
Posts: 3
Registered: ‎07-03-2017

PC as host for BLE in NCP mode

i am trying to make my PC as host for BLE in NCP mode. i am using visual studio 2013 for making application in C on window 8 platform. i have implemented BGAPI. but i am getting one error in main.c on BGLIB_DEFINE();

error: type containing an unknown size array is not allowed.

and also in line:  extern struct gecko_cmd_packet gecko_queue[BGLIB_QUEUE_LEN]; in gecko_bglib.h

error: type containing an unknown size array is not allowed.
 

Posts: 94
Registered: ‎04-26-2016

Re: PC as host for BLE in NCP mode

Hi,

    Have you tried using our 'empty' example here?

C:\SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v1.1\app\bluetooth_2.4\examples_ncp_host\empty

the makefile provided is written for GCC, but you could adapt it for the Microsoft compiler if you want to.

 

/Steve

Posts: 3
Registered: ‎07-03-2017

Re: PC as host for BLE in NCP mode

same code as you have mentioned, i have tried in visual studio. but getting same error as mentioned above.

Posts: 94
Registered: ‎04-26-2016

Re: PC as host for BLE in NCP mode

I got it to build in the 2017 version of Visual Studio. The only change I had to make was to change usleep(50000) to sleep(1). This is a fairly long delay, 1000 ms instead of 50 ms so it would be better to find another delay method.

 

So my suggestion is to either upgrade to the later Visual Studio, or use GCC since that is what the example is written for.

 

 

Posts: 94
Registered: ‎04-26-2016

Re: PC as host for BLE in NCP mode

[ Edited ]
 
Posts: 3
Registered: ‎07-03-2017

Re: PC as host for BLE in NCP mode

Thanks for the reply. But unfortunately, i can not update my visual studio 2013 to VS2017. i would appreciate, if the solution can be found for VS2013.