Ios just contact, after a lot of examples, finally made a demo, receiving and processing of my data are written in the didUpdateValueForCharacteristic this method, according to the official documentation and reference case, as long as the bluetooth to send data changes will automatically trigger this method, but the question now is whether the data obtained from this method in some lag, led to the interface of the histogram display card, no real-time display (is has done the operation, a histogram for a long time will jump), directly in the console to print the received data, found that compared with android, receiving speed sent many times,
And because the receiving data lag, the agreement the scheduled data format to upset, could ever do bluetooth friend help! Thank you very much
CodePudding user response:
A thread, otherwise the card interfaceCodePudding user response:
Where is the thread needs to leave? DidUpdateValueForCharacteristic this way?CodePudding user response:
Do you later how to deal with, feel the problem now I talk to you about, I this is equipment every 3 s set of real-time data (there will be several frames to splice) for mobile phones, mobile phone will send instruction to equipment control, and then return to equipment, this time receiving instruction should be how to deal with a lot of data received at the same time?CodePudding user response:
This callback is not in the main thread, if you want to update the interface, you need to go back to the main thread to update the interface,