自动重新连接到蓝牙设备 [英] Automatic reconnection to bluetooth device

查看:193
本文介绍了自动重新连接到蓝牙设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够与bt设备建立连接并在重启和关闭后保持其连接,以便winform应用程序可以在重启和关闭后重新连接到bt设备。 
事情是我之前从未使用过bt设备,我真的需要你的帮助才能做到这一点。



我需要这个winform应用程序才能连接到bt设备在第一次连接后自动自动,除非您告诉应用程序连接到另一台bt设备。我做了一些研究,找到了一种连接到bt设备的方法,在你点击一个按钮后,这是一个很大的改进,而不是在c#中不了解bt连接。现在我需要找到一种方法让设备重新连接到windows pc中的winform应用程序,以便它可以在应用程序中自动使用,无需用户交互。



我的尝试:



http://stackoverflow.com/questions/16553997/ c-sharp-console-application-talking-to-arduino-via-bluetooth

解决方案

你的问题与BlueTooth没什么关系,但与保持应用程序中的状态,将该状态序列化为文件或其他存储(保存),反序列化以及确保设备与您的代码维护状态匹配的一切有关。



没有人会更具体,你肯定没有得到任何代码样本。



你将不得不研究状态机,数据结构,蓝牙通信,并希望您的设备支持您想要做的事情。

I want to be able to establish a connection with a bt device and maintain its connectivity even after reboot and shutdown, so that the winform app can reconnect to the bt device after reboot and shutdown.
The thing is I have never worked with bt devices before and I really need your help to do this.


I need this winform app to connect to a bt device automatically after it has been connected the first time, utomatically, unless you tell the app to connect to another bt device. I made some research and found a way to connect to a bt device, after you click a button, which is a great improvement over not knowing anything about bt connections in c#. Now I need to find a way to make the device reconnect to the winform app in a windows pc, so that it is available for use in the app automatically, without user interaction.

What I have tried:

http://stackoverflow.com/questions/16553997/c-sharp-console-application-talking-to-arduino-via-bluetooth

解决方案

Your "question" has very little to do with BlueTooth, but everything to do with maintaining a state inside your application, serializing that state to a file or other storage (saving), deserializing it, and making sure the device matches up with the state your code is maintaining.

Nobody is going to be more specific and you definitely are not getting any code samples for this.

YOU are going to have to study state machines, data structures, BlueTooth communication, and hopefully your device supports what you want to do to.


这篇关于自动重新连接到蓝牙设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆