Thread
:
Writin to RFCOMM
View Single Post
didik.wahyono
2011-08-23 , 06:07
Posts: 49 | Thanked: 9 times | Joined on Oct 2010 @ Borneo
#
1
Gents,
I faced a problem when implementing bluetooth serial port to my N900. I managed to bind the serial port to rfcomm0, but when i open and write something, the data is physically transmitted after i close the file. Any idea how to send the data directly as soon as possible? Thanks in advance.
here is my code.
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow)
{
rfcomm = fopen("/dev/rfcomm0","a");
ui->setupUi(this);
}
void MainWindow:
n_pushButton_clicked()
{
fputc('H',rfcomm); // no data transmitted
}
MainWindow::~MainWindow()
{ fclose(rfcomm); // all accumulated data is transmitted after i call this routine
delete ui;
}
Quote & Reply
|
didik.wahyono
View Public Profile
Send a private message to didik.wahyono
Find all posts by didik.wahyono