Capture device as it approaches PC? RRS feed

  • Question

  • Hi,

    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?

    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.

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

    Thanks for any help.

    Friday, May 26, 2017 10:33 PM

All replies

  • Hi fiverc,

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

    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

    Best regards,

    Cole Wu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 29, 2017 2:21 AM
  • Or if you want to save the trouble of having to pair each of the device in trucks to each PC:


    Monday, May 29, 2017 3:02 AM