Netty and a character device file?

43 views
Skip to first unread message

Rogan Dawes

unread,
Jan 14, 2017, 11:53:04 PM1/14/17
to Netty discussions
Hi folks,

I'm thinking of using netty to multiplex traffic from network sockets over a character device, like a serial port. Does netty support file access in this way?

Regards

Rogan

Norman Maurer

unread,
Jan 16, 2017, 3:24:49 AM1/16/17
to ne...@googlegroups.com
Not sure what exactly you are asking about but netty supports serial ports:



Bye,
Norman

--
You received this message because you are subscribed to the Google Groups "Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netty+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netty/CAOYdKdg2-JdtcEmQrGwza8Ys5EE5xS3%2BH1VZAAO1WyppoyLoBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Rogan Dawes

unread,
Jan 16, 2017, 3:34:39 AM1/16/17
to ne...@googlegroups.com
Hi Norman,

So, I'm not really using a serial port, but rather a HID Gadget. I used the serial port as an example that may be more familiar to folks, but I can see I may have confused issues more than helped.

My HID Gadget reads and writes 64-byte reports to the USB host on the other end of the cable, and it is this that I am trying to accomplish using Netty.

Looking at the RXTX implementation, it seems like I need to implement a new FileChannel or similar, that can read a file, and fire appropriate events when the read succeeds, and similarly for writes.

Thanks for the pointer!

Rogan




Rogan Dawes

unread,
Feb 8, 2017, 4:12:56 PM2/8/17
to Netty discussions, ro...@dawes.za.net
Ok, so I implemented a FileChannel based on OioByteChannel, and it seems to work reasonably well.

My only problem is that I am required to read and write in chunks of 64 bytes from the device, and I cannot see how to influence the size of the ByteBuf used when reading or writing, passed to OioByteChannel.doReadBytes(ByteBuf) and OioByteChannel.doWriteBytes(ByteBuf).

Any more hints?

Thanks!

Rogan
Reply all
Reply to author
Forward
0 new messages