daniel garcia
unread,Jun 21, 2012, 1:10:53 PM6/21/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message as abuse
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to linux...@googlegroups.com
Buenas tardes a todos, tengo un problema obteniendo un valor de un driver que implemente desde QT, yp ingreso el siguiente codigo:
void MainWindow::read2 (char arg) {
extern "C" {
int dato2;
int fileNum, bytes;
unsigned char buf[40];
size_t nbytes;
ssize_t bytes_read;
nbytes = sizeof(int);
fileNum = open("/dev/irq", O_RDWR);
write(fileNum, arg, 1);
read(fileNum, buf, nbytes);
read(fileNum, buf, nbytes);
dato2 = *((int*)(buf));
driverclose(fileNum);
}
ui->verticalSlider->setText(setValue(dato));
}
Ya que si lo coloco sin extern "C" no identifica la funcion write no las funciones con las que me comunico con el driver, si alguien me puede colaborar no importa que el codigo sea diferente mientras yo pueda obtener el codigo desde el driver para usarlo en QT.
Agradezco de antemano su atencion