HandHeldLegend / HOJA-LIB-ESP32

An API project to emulate various retro and modern controllers on ESP32.
Other
56 stars 12 forks source link

Added state checks before starting NS core #13

Closed JPZV closed 1 year ago

JPZV commented 1 year ago

This fixes some ESP_ERR_INVALID_STATE when trying to start the Nintendo Switch Core without a proper stop. This is useful if someone wants to re-use the BT instance after a connection error/disconnection/no device found edge-case.

Without those checks, the ESP would crash or the core wouldn't be re-started again

mitchellcairns commented 1 year ago

Howdy, the current implementation will be depreciated soon in leu of using the new Bluetooth utility. (See functions util_bluetooth_init and util_bluetooth_register_app). These both have more comprehensive protections. There is no util_bluetooth_deinit for now but it's coming.

mitchellcairns commented 1 year ago

This fixes some ESP_ERR_INVALID_STATE when trying to start the Nintendo Switch Core without a proper stop. This is useful if someone wants to re-use the BT instance after a connection error/disconnection/no device found edge-case.

Without those checks, the ESP would crash or the core wouldn't be re-started again

See the latest commit: NS retool finished