I have a program that finds a peer and connects to it (arduino with hc-05 bluetooth module). I wrote a function that receives data from this bluetooth.
private async void read() { try { uint bytesRead = await dataReader.LoadAsync(sizeof(uint)); if (bytesRead > 0) { uint strLenght = (uint)dataReader.ReadUInt32(); bytesRead = await dataReader.LoadAsync(strLenght); if (bytesRead > 0) { String message = dataReader.ReadString(strLenght); messageTextBlock.Text = message.ToString(); read(); } } } catch (Exception ex) { messageTextBlock.Text = ex.Message; } } But it does not work. What could be the error, or can use another method?