I'd like to port a Linux C program to Java. This program controls a camera which is connected to the PC with a USB cable. The C code uses Linux SCSI Generic (sg).
Sample code from the C program:
#include <linux/../scsi/sg.h>
...
static int scsi_write(int sg_fd, uint8_t *cmd, uint32_t cmdLen,
uint8_t *buf, uint32_t bufLen) {
sg_io_hdr_t io;
int r;
memset(&io, 0, sizeof(io));
io.interface_id = 'S';
io.cmd_len = cmdLen;
...
r = ioctl(sg_fd, SG_IO, &io);
...
}
Is there a way to port this program to Java? I was searching for a cross-platform SCSI library written for Java, but found none. I was also searching for a JNI over SCSI/sg, also no luck.