Use C # To develop the. net cf Bluetooth communication module
In Windows Mobile Software Development,. Net is playing an increasingly important role. We can see a lot of software developed with. Net CF, which involves all aspects of daily applications. In the software development of smart devices, wireless interconnection is a very important part. We can see that infrared is the standard for almost all smart devices, bluetooth is also increasingly emerging on more and more smart devices. with hardware, it is clear that there must be corresponding software-related applications.
We also know that it is quite easy to use. net cf to develop infrared communication applications, because. net cf has a namespace System. Net. IrDA, which is the communication module used for infrared communication. However, there is no module for Bluetooth communication in. net cf, so it is still difficult to develop this module. Next, let's talk about how to use C # To develop the. net cf Bluetooth communication module.
I. Key Points
First of all, it is clear that the development cannot be completed only by understanding the C # development knowledge because of the driver hardware problem. We must understand the C ++ development knowledge. For the sake of simplicity, we do not want to use C ++ to write half-line code. All coding work uses C #. That is to say, only Visual Studio.net is used in the development environment, no other editor is required.
As a preparation for developing such driver hardware programs, you need to understand the basic knowledge of C ++, know what the header file is, and know how managed code interacts with non-hosted code. Because the core of this article is to illustrate how to develop the. net CF Bluetooth communication module, the above preparations are not described.
2. About Bluetooth
To develop a Bluetooth communication module, you must first know what Bluetooth communication is like. In my opinion, Bluetooth communication should be similar to the infrared communication module. Of course, from the developer's point of view, this should be the case after abstraction. Of course, there are many differences between Bluetooth and infrared communication, in the object-oriented design, I think many people will understand it better than me. Well, this is our basic idea. I have checked articles about Bluetooth development on the Internet. net CF development treats Bluetooth communication as a serial communication, which is also good, but I do not like it very much, because in this case, it is not developed for Bluetooth, in other words, during use, you need to manually enable Bluetooth, pairing, connection, establish a serial channel, and then enable application use. You also need to set the serial port in the application. for end users, this is very troublesome. In my opinion, this solution is simply named after Bluetooth communication ...... Let's not talk about it anymore.