petzval / btferret

Python and C Bluetooth Library
MIT License
126 stars 22 forks source link

Unable to connect BLE Server again after disconnecting. #41

Open ashoksharma842 opened 7 months ago

ashoksharma842 commented 7 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 7 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.