Starting a C# BLE project

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am working on a windows service in C# that uses a Broadcomm radio.

I am attempting to convert over the necessary C++ code needed to get this project going.

When I attempted to reference btwleapi.dll in my project I pickedup the following error:

A reference to 'C:\...\Btwleapi.dll' could not be added.  Please make sure that the file is accessible, and that that it is a valid assembly or COM component.

I am working with version 6.5.1.2700 of the .dll

My primary question is, what is the right way to reference this DLL?

Is this only done with  DllImport attributes for each method?

It looks like btwleapi.dll is the main file that my software will need to interface with.

Is this correct?

If no, does anyone know what .dlls we need to focus on?

What kind of .dll is btwleapi?
(win32, MFC, CRL)?

By chance, does anyone have a C# version of btwleapis.h?

My thanks in advance.

When I tried to reference
btwleapi.dll in my C# project I picked up the error below:

Could not be added.  Please
make sure that the file is accessible, and that it is a valid assembly or COM
component.

Have you seen this kind of error
before?

0 Likes
1 Solution

Got it.  The only DLL that you need is BtwLeApi which comes with Broadcom's profile pack for Windows 7 (BTW 6.5.1).  The btwleapis.h header file which is included in Windows WICED Smart samples should have a reasonable description of the functionality.  Unfortunately WICED Smart SDK only includes C++ and does not include C#, VB, or Java script samples.  On Windows 8/8.1 this DLL is not required because all required functionality is included in standard Microsoft DLLs.

View solution in original post

8 Replies