|
2011-08-24
, 12:07
|
Posts: 466 |
Thanked: 661 times |
Joined on Jan 2009
|
#2
|
The Following User Says Thank You to jackburton For This Useful Post: | ||
|
2011-08-24
, 13:30
|
|
Posts: 77 |
Thanked: 49 times |
Joined on Apr 2010
@ Italy
|
#3
|
The Following User Says Thank You to djdas For This Useful Post: | ||
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;
}