Comments (5)
What's the use case behind this? Typically you have very specific devices
to talk to and they often need to be managed independently even if they are
performing the same tasks.
On Mon, Aug 29, 2016, 5:33 PM Ewan Valentine [email protected]
wrote:
Hi there,
I have the following range loop, I'm attempting to write a file output to
each device. Is this possible?for _, dev := range devs {
// Once the device has been selected from ListDevices, it is opened
// and can be interacted with.conf, err := dev.ActiveConfig() if err != nil { log.Fatalf("Cannot get active config: %s", err) } write, err := dev.OpenEndpoint(conf, uint8(0), uint8(0), uint8(2)|uint8(usb.ENDPOINT_DIR_OUT)) if err != nil { log.Fatalf("Failed to open write endpoint: %s", err) } write.Write([]byte("test"))
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#20, or mute the thread
https://github.com/notifications/unsubscribe-auth/AATqpf5KB_LR8rSkIIRLgBKW-HHz_y0zks5qk3pKgaJpZM4JwCKB
.
from gousb.
I'm attempting to listen for new USB storage devices being attached, and transferring a file to them once detected. Is there a way of return the device path, perhaps, with this library? I couldn't see anything like that from the docs. I think I might have to try something different. I get what you mean about devices needing to be managed independently.
from gousb.
Are you planning on speaking the USB Mass Storage protocol to the device
raw and do the filesystem emulation yourself? I would imagine that it
would be far more robust to let the OS manage and auto-mount devices and
then write the file to the filesystem.
On Wed, Aug 31, 2016, 3:16 AM Ewan Valentine [email protected]
wrote:
I'm attempting to listen for new USB storage devices being attached, and
transferring a file to them once detected. Is there a way of return the
device path, perhaps, with this library? I couldn't see anything like that
from the docs. I think I might have to try something different. I get what
you mean about devices needing to be managed independently.—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
#20 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AATqpXyYnBp5qU1ovbu-zd34WepXCtrgks5qlVSGgaJpZM4JwCKB
.
from gousb.
Yeah that's probably the best solution, I mean to let the OS handle all of that. But in order to handle it through the OS, I need to know the location of the new storage device. So I can use this library to figure out if there's a new device plugged in, but I don't know how to get the filepath for that device then. If that makes sense?
from gousb.
As far as I know there's no way to get that from the device itself, you
need the kernel for that. I'd suggest watching the directories your OS
uses for auto mounting, watching dmesg, maybe there are some /sys or /proc
files that could help. You might also be able to plug into udev or similar.
On Wed, Aug 31, 2016, 6:12 AM Ewan Valentine [email protected]
wrote:
Yeah that's probably the best solution, I mean to let the OS handle all of
that. But in order to handle it through the OS, I need to know the location
of the new storage device. So I can use this library to figure out if
there's a new device plugged in, but I don't know how to get the filepath
for that device then. If that makes sense?—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
#20 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AATqpQ-5eCrpHc22A_Rh1d419SaTGDfdks5qlX3VgaJpZM4JwCKB
.
from gousb.
Related Issues (18)
- Using with Homebrew's libusb HOT 12
- GPL use of xbox.go HOT 1
- Paths are hardcoded in usb.go HOT 1
- Embedded libusb? HOT 7
- Partial data on timeouts HOT 7
- Any examples for writing to devices? HOT 3
- read systematic timeouts HOT 9
- Race condition when closing Context
- Link in short description returns a 404 HOT 1
- Flexible array members (in libusb.h) not supported on arm-linux-gnueabihf (Raspberry Pi 3) with gcc 5.4 HOT 21
- xfer_callback panic HOT 5
- Appveyor build HOT 14
- Deprecation notice HOT 1
- Endpoint problem HOT 11
- How to link libusb on mac if I want to release a program without "brew install libusb" HOT 1
- Segfault if more than one usb context created HOT 8
- libusbx HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gousb.