Author Topic: Check if all sent bluetooth data where received  (Read 6346 times)

walkerbox

  • Guest
Check if all sent bluetooth data where received
« on: August 25, 2015, 04:16:19 PM »
Hello,
I'm sending a big byte array (byte[100000]) using Bluetooth server and client. My server gets OnData event several times, with following parts of my sent byte array. How could I detect whether all the data parts has been received? Is there any built in mechanism? I need to deserialize this whole byte array (byte[1000000]). I wish I get only one OnData event, with all the data. Could you please suggest any solution?

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Check if all sent bluetooth data where received
« Reply #1 on: August 25, 2015, 08:42:55 PM »
Hello,

You have to create internal buffer for your data and fill it when OnData event fires. Than check if all data is received - process it. If not, continue t fill your buffer. Also I recomend to send data with small size by splitting your array for small parts.

 

Sitemap 1 2 3 4 5 6 7