在接近PC时捕获设备? [英] Capture device as it approaches PC?

查看:54
本文介绍了在接近PC时捕获设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以检测到设备在我的PC附近,然后捕获设备ID(以及日期和时间),然后将记录记录到数据库中?蓝牙?   WiFi Direct?

Is there any way to sense that a device is within proximity of my PC, and then capture the device ID (and date and time) to then log a record in a database?  Bluetooth?  WiFi Direct?

我们正在寻求为我们的卡车车队创建内部商业解决方案-了解卡车何时到达每个地点.  我们不希望基于GPS的大型车队跟踪.只是一些简单的事情,例如每个位置的传感器都可以检测(并记录) 一辆卡车到了.

We're looking to create an internal commercial solution for our fleet of trucks -- to know when they arrive at each location.  We don't want big GPS-based fleet tracking.. just something simple like a sensor at each location detects (and logs) that a truck has arrived.

如果有帮助的话,我们都是基于.NET和C#的开发人员.

We're all .NET and C# based in our development if that helps.

感谢您的帮助.

推荐答案

嗨firc,

如果您使用蓝牙,请参考以下步骤.

If you use Bluetooth, please refer to the following steps.

1.将您的蓝牙设备与PC配对.

2.实施代码以检测配对的设备.
此链接说明了如何查找串行COM端口(包括BT设备)
应该可以修改代码,以便仅找到配对的BT设备.
使用WMI查找蓝牙配对的NXT

3.识别您的设备.

4.使用轮询查看列表中是否存在您的设备,并且该设备已连接.
轮询很容易实现,但是您应该在线程中进行,这样很容易中止.
如果API在设备出现或消失时提供事件,则最好使用事件,但我不知道是否有事件.你得自己读.

5.如果存在,请在数据库中记录一条记录.

此页面用于Windows 8蓝牙API.希望对您有所帮助.
蓝牙API

1. Pair your Bluetooth device with your PC.

2. Implement code to detect paired devices.
This link explains how to find Serial COM ports (including BT devices)
It should be possible to modify the code so you can find paired BT devices only.
Finding Bluetooth paired NXTs with WMI

3. Identify your device.

4. Use polling to see if your device exist in the list or not and is connected.
Polling is easy to implement, but you should do it in a thread so it can be easily aborted.
If the API provides events when devices appears or disappears it is preferable to use the events but I don't know if there is any. You have to read for yourself.

5. If exists, log a record in a database.

This page is for Windows 8 Bluetooth API. I hope it will be helpful.
Bluetooth API

最诚挚的问候,

吴可乐


这篇关于在接近PC时捕获设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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