Develop Windows Mobile and PC programs based on 32feet.net for Broadcom (widcomm) stack Bluetooth devices

Source: Internet
Author: User
Background

Widcomm was the first company to write a Bluetooth stack for Windows and later acquired Broadcom. As he was the first, many bluetooth devices currently use Broadcom statck. The following describes how to use 32feet.net to develop Bluetooth devices based on Broadcom statck.

 

The example in this article is based on the development of file transfer through Bluetooth between Windows Mobile and PC, and Windows moible, wince. NET Compact framework for Bluetooth development 32feet.. net.

 

Reason

Thank you for your suggestions.ArticleThe reason. This article was written to solve the problem raised by Cui Jiang. I wrote a series of articles about Bluetooth development. Among the readers of these articles, many people have asked how to use widcomm stack for Bluetooth development. I have searched g.cn and Baidu and found that there are few articles in China on this aspect. So I have summarized my experience, this article may be difficult to understand. Please read the links under "further reading". These articles are relatively advanced articles. This article is a continuation of those articles and an advanced article. 

 

Driver Installation

This driver must be installed for Broadcom stack development.ProgramThe following uses XP as an example to describe how to install the Broadcom driver.

Insert the Bluetooth dongle of the Broadcom stack.

Insert the CD of the driver for installation.

After the installation, you can see the bluetooth device.

 

Download 32feet.net source code

Download the latest 32feet.net from codeplexCodeBecause the latest 32feet.net release does not support Broadcom stack, You need to download the build version. The latest build version is as follows:
Http://32feet.codeplex.com/SourceControl/ListDownloadableCommits.aspx

 

Broadcom stack native DLL

If Microsoft stack is used, 32feet.net can directly call Windows Embedded ce and the built-in btdrt. dll and bthutil. dll of Windows Mobile. However, the use of Broadcom stack is different. 32feet.net encapsulates native DLL to call the Broadcom driver. The source code package contains the built DLL.

Is the native DLL of the PC.

 

Is Windows Mobile's native DLL.

 

32feet.net Compilation

Open the solution under \ 32feet-61144 \ inthehand. net. personal_widcomm.

Compile inthehand. net. Personal. CF2 and inthehand. net. Personal. fx2 respectively to generate. Net Assembly inthehand. net. Personal. dll of 32feet.net.

 

Update of project reference

Update all references to the newly compiled inthehand. net. Personal. dll.

In order to save time, my example was modified based on the original article. For more information, see the development of file transfer through Bluetooth between Windows Mobile and PCs.

 

Modify to support Broadcom Stack

Modify the reference to inthehand. net. Personal. dll.

Note the call to set primaryradio. mode, because Broadcom (widcomm) stack does not support setting primaryradio. mode.

 
// Inthehand. net. Bluetooth. Fig. primaryradio. mode = inthehand. net. Bluetooth. radiomode. discoverable;

 

 

Deployment program PC

Unlike Microsoft stack, native DLL and its dependent DLL need not only to be deployed but also to be deployed. If you do not deploy these dependent DLL files, the program will throw an exception. This is the reason why Cui jiang's debugging failed.

I put all the dependent DLL into the source code package.

Windows Mobile

Windows Mobile is relatively simple, and the dependent DLL itself has been installed on the device.

You only need to deploy the application, inthehand.net. Personal. dll and 32feetwidcomm. dll.

 

Pairing a bluetooth device

Manual pairing is required when the program runs.

However, in Microsoft stack, you can use programs for pairing. For details, refer to Windows moible. wince uses. NET Compact framework to develop bluetooth device pairing.

 

Test the file transfer program based on Broadcom stack.

Both sides are Broadcom stack, but the server will throw an exception when receiving the obexlistener request, as shown below:

 
ObexlistenercontextOLC = listener. getcontext ();

 

Because Broadcom (widcomm) stack does not support sockets, Broadcom (widcomm) stack cannot be used as obexlistener. I replace obexlistener with Microsoft stack, and everything runs normally.

Source code: Http://files.cnblogs.com/procoder/BroadcomBluetoothObex.rar

To change to Microsoft stack, you only need to replace the inthehand. net. Personal. dll reference.

 

At the same time, I also developed a communication program with both ends of Broadcom stack on the basis of Windows moible and wince's 32feet. NET Compact framework for Bluetooth development.

Source code: http://files.cnblogs.com/procoder/BroadcomBluetooth.rar

At the same time, I found that if the server side is a Broadcom stack program, the program crashes and I changed to Microsoft stack to solve the problem again.

 

Suggestions on Broadcom stack (widcomm stack) development

32feet.net's support for Broadcom stack (widcomm stack) is incomplete. Reference this document for support: http://files.cnblogs.com/procoder/32feet-and-Widcomm-Broadcom.doc

 

I recommend that you do not need to use Broadcom stack (widcomm stack) unless you have to. Microsoft stack can solve many problems. This document describes how to install a non-Microsoft stack Device on Microsoft stack. See http://files.cnblogs.com/procoder/Belkin-F8T012-and-Microsoft-Stack.doc

 

 

Further reading

More articles about Bluetooth development are as follows:

Windows moible, Windows Embedded source tools for Bluetooth development using. NET Compact framework in Windows

Windows moible, WinCE uses. NET Compact framework for Bluetooth development 32feet. net

Windows moible, WinCE uses. NET Compact framework for Bluetooth development-Bluetooth virtual serial port (Bluetooth virtual serial port) (which can be used to convert Bluetooth GPS receiver into a serial port)

Windows moible, WinCE uses. NET Compact framework for Bluetooth device pairing Development

30 days of. Net [Windows Mobile applications]-day 02: Bluetooth Manager (simple Bluetooth Application)

Windows moible, WinCE uses. NET Compact framework for Bluetooth Broadcast Program Development

Development of file transfer through Bluetooth between Windows Mobile and PC

How to send large files via Bluetooth on Windows Mobile

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.