petzval / btferret

Python and C Bluetooth Library
MIT License
122 stars 21 forks source link

Unable to connect BLE Server again after disconnecting. #41

Open ashoksharma842 opened 6 months ago

ashoksharma842 commented 6 months ago

In BLE server, callback,

else if(operation == LE_DISCONNECT) {
    // clientnode has just disconnected
    // uncomment next line to stop LE server when client disconnects
    // return(SERVER_EXIT);
    // otherwise LE server will continue and wait for another connection
    // or operations from other clients that are still connected
    printf("Disconnected\n");
    // return(SERVER_EXIT);
}

on commenting return(SERVER_EXIT), the server shows disconnected but it doesn't connect again. To connect again, binary needs restart.

petzval commented 6 months ago

I have not been able to reproduce your error. If I connect to the server, then disconnect, the server goes back into waiting mode and I can re-connect with no problem. Can you supply more details, it might be a problem with the client.