zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.64k stars 2.35k forks source link

Transmission of messages via USB possible? #4091

Open carlosvalderrama opened 3 years ago

carlosvalderrama commented 3 years ago

Please use this template for reporting suspected bugs or requests for help.

Issue description

Is it possible to use libzmq for the communication between a USB host and device? If not, has this feature ever been under consideration?

Environment

bluca commented 3 years ago

No it is not possible, someone would need to add support for USB as a transport protocol for this to work. If you want to implement this, feel free to send a PR.

carlosvalderrama commented 3 years ago

Thanks @bluca for the prompt response. I trust you have set up some infrastructure and abstraction in the project in order to make such additions possible. Could you please give me some pointers to the code where the current transport protocols are implemented? I am completely new to the project, so thanks in advance for your help.

bluca commented 3 years ago

You can check how the websocket (WS) transport was added, there's a few new classes to implement it

eniv commented 2 years ago

Hi, I'm interested in something like that as well and was thinking to build on libusb. @carlosvalderrama, did you end up implementing something and have suggestions/tips ?

carlosvalderrama commented 2 years ago

@eniv No, sorry. We chose not to go along this route.

eniv commented 2 years ago

OK, Thank you.

MoreTore commented 1 year ago

Hi, I'm interested in something like that as well and was thinking to build on libusb. @eniv did you end up implementing something and have suggestions/tips ?

eniv commented 1 year ago

Hi @MoreTore, After more research I also ended up not going that route. The USB connection topology is more limited than LAN and therefore quite a few of ZMQ's communication patterns are not applicable. The ZMQ API is friendly and concise but for my use case it didn't justify forcing the ZMQ infrastructure for USB bulk data transfers.

gzzi commented 2 weeks ago

Hi all, a working solution is to do Ethernet over USB. We implemented it using RNDIS and was working fine.

MoreTore commented 2 weeks ago

Hi all, a working solution is to do Ethernet over USB. We implemented it using RNDIS and was working fine.

Yea that's what I did too. Just used Linux ECM and NCM drivers.