#include "table.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
void Input_handler(int sig)
{
qDebug("Receive a signal from globalmem:%d!\n",sig);
}
void Table::Myfcntl()
{
int fd, oflags;
struct ::sigaction action;
fd = ::open("/dev/globalmem", O_RDWR, S_IRUSR | S_IWUSR);
if (fd != - 1)
{
::signal(SIGIO,Input_handler); //error: argument of type 'void (Table::)(int)' does not match 'void (*)(int)'
::fcntl(fd, F_SETOWN, getpid());
oflags = ::fcntl(fd, F_GETFL);
::fcntl(fd, F_SETFL, oflags | FASYNC);
}
else
{
qDebug("Open device failed.\n");
}
}
Table::Table( )
: QTableWidget()
{
setWindowTitle(tr("Table"));
}
Table::~Table()
{
}
小弟写了个串口驱动,打算用异步通知来通知QT引用程序。
下面红色处出现错误,这个引用程序已经在linux中用arm-linux-gcc生成的引用程序在6410上试过了,可以使用。但是移植到QT中就出错了,不知道该怎么处理;请高手指点,小弟感激不尽!
QQ:252501870