Author Topic: SPP Data Will Lose  (Read 21022 times)

nan805

  • Guest
SPP Data Will Lose
« on: October 23, 2008, 10:23:08 AM »
Hi

Good day.
If i get an incomplete SPP data from my BT device sent, how will i do?

For example
My Bluetooth device transmits a string of data like "4710609600025", and Here below the result is WCL received.

Read : 4710609600025
Read : 49600025
Read : 71060
Read : 4710609600025
Read : 4600025
Read : 710609
Read : 410609600025
Read : 7410609600025
Read : 74609600025
Read : 710400025
Read : 7106096

I didn't change any code of C++ Builder from the sample WCL provided.
I checked the receiving data code as below
void __fastcall TfmMain::wclClientData(TObject *Sender, PByte Buffer, int Size)
{
  meClientData->Text = meClientData->Text + String((PCHAR)Buffer);
}

The code procedure seems ok no problem, and My BT device is good to be received data when using general XP BT manager.

What am i going to do ?

Thanks
Nan

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: SPP Data Will Lose
« Reply #1 on: October 23, 2008, 12:27:02 PM »
Good day!

WCL does not lose data, otherwise it couldn't send the file. The result seems correct. WCL receivs data by parts.

nan805

  • Guest
Re: SPP Data Will Lose
« Reply #2 on: October 24, 2008, 04:03:01 AM »
Hi

Good day
What i mean by that is the sequential data incompletely.

A correct data received by WCL should be "4710609600025", But what i received will be like "49600025" then "71060".
It is about 60% the reading to be irregularity a sporadic situation, so i don't know what to do.

I know this could be the problem on transmitting device not WCL.
However,Why i purchase the WCL is going to replace XP bluetooth manager with the new WCL.
I wonder whether there is anything solution that can be adjusted, accessed to solve the irregular, sporadic situation of data.

To prove the situation which can be improved, I tried to use XP default Bluetooth manager, and the reading data is all correct with its sequence. Therefore, I thought WCL probably have a way of solution to improve the reading.

Thank you so much ;)
Nan

nan805

  • Guest
Re: SPP Data Will Lose
« Reply #3 on: October 24, 2008, 05:31:53 AM »
Hi

It is good news, and i figure it out why the SPP data is incomplete.
I found that the event of "wclClientData(TObject *Sender, PByte Buffer,int Size)" will run twice when a string of data incoming.

Thanks

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: SPP Data Will Lose
« Reply #4 on: October 24, 2008, 11:09:53 AM »
The OnData event may fire more than 1 time even there is one data packed from device. Because it is impossible to know the packet length sent from device. As soon as data arrived OnData fires.

 

Sitemap 1 2 3 4 5 6 7