This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PC SW connection to device throw BLE USB dongle

Hi,

I am developing a PC SW that connects to nRF52840 device throw a BLE USB dongle(another nRF52840)

How I can tell from PC that a device is connected\disconnected to the dongle ?

Lets say in connection I can let the device send to PC a connection message, this way the PC can recognize a new device connected to the dongle.

But in disconnection situation this is a problem, since my dongle shall connect to more than one device.

How I can solve his ?

Another question:

what is the more accepted way to let the user chose from PC to what device to send the command to, sins more than one device connected to the dongle, what is the protocol !?

I will be glad if there is an example of it

BR

JK

  • Hi

    I assume you need to make a user interface of some kind that gets data via the USB on your Dongle. Maybe modifying the usbd_ble_uart example to send data to your computer whenever it connects to/disconnects from a device. As you want multiple devices to be recognized I suggest you include the device name or UUID of the connected device in the data sent to the PC, so you are able to tell the various devices apart from one another.

    what is the more accepted way to let the user chose from PC to what device to send the command to, sins more than one device connected to the dongle, what is the protocol !?

     I'm not sure what you mean by this question, can you please clarify?

    Best regards,

    Simon

  • Hi,

    thank you for you reply.

    I tried the usbd_ble_uart woth a pc serial port app on PC ( windows 10) and it didn't work.

    first the PC recognize the device as serial device, and after I installed the usb driver it recognize it as  nRF52 USB CDC BLE Demo(COM4), then I tried with Hercules and it doesn't work.

    Please help me with this, this USB issue thing wasn't expected !!

    what is the more accepted way to let the user chose from PC to what device to send the command to, sins more than one device connected to the dongle, what is the protocol !?

     I'm not sure what you mean by this question, can you please clarify?

    My PC app shall send\receive command\reply from two devices that connected throw BLE to the BLE USB dongle that connected to the PC throw USB.

    I want to let the user choose to what device from the two to send the command. the two devices is the same, they are not different, but every device work in a different room.

    How can I let the dongle send the command only to the required device and not to both !?

    BR

    JK

  • Hi

    Please check out this thread, which explains the usbd_ble_uart application a bit better. Our SDK doesn't support HCI, which is what most BLE Dongles use to communicate with computers, which is likely why you're having trouble communicating with your PC.

    As for choosing what device you want to communicate with, I suggest you differentiate them by either UUID or device name and send commands to just one device name that way. So you will have to input what device you want to send a command to when executing the said command.

    Best regards,

    Simon

  • Hi,

    Thank you for you reply.

    another question under the same subject please:

    my project shall allow two devices to connect to one dongle.

    what is more recommended ? the dongle should be as a central or as a peripheral ?

    I believe that there is  advantages and disadvantages to both cases.

    BR

    JK

  • That depends on what the two devices it is supposed to connect to are. Both should indeed work, so you should make your decision on what tasks you want the Dongle to do, as well as the connected devices. Based on the information you have already provided I'd suggest looking at using the Dongle as a central.

    Best regards,

    Simon

Related