This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

handling BLE disconnect/reconnect in C# app

Hi, I have a C# app connecting to 51822 devices, doing data/firmware download. When I try to send erase page command (before write), erase works, but there is a disconnect; Why? Also, why can't the central and peripheral stay connected reliably during this 2+ mins continuous download? If they do disconnect (for whatever reason, remote disconnected / peripheral going out of range)I get a OnDisconnected() call back, but my main function attempting data download loses control; giving me no chance to recover/reconnect and finish rest data. I set Slave Latency=0, connection interval 15 msec, Supervision time-out 9000 msec; hope that's ok? Is there a C# example code on how to handle gracefully disconnect/reconnect?

Thanks!

Related