Wireless Communication Library Support Forum

Frameworks => Bluetooth Framework => Topic started by: walkerbox on August 25, 2015, 04:16:19 PM

Title: Check if all sent bluetooth data where received
Post by: walkerbox 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?
Title: Re: Check if all sent bluetooth data where received
Post by: Mike Petrichenko 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.