It seems that the handle value got upon ESP_SPP_SRV_OPEN_EVT is not always the same as the handle upon ESP_SPP_CLOSE_EVT.
Code: Select all
case ESP_SPP_SRV_OPEN_EVT:
ESP_LOGI(TAG, "srv_open: %d", param->srv_open.handle);
break;
case ESP_SPP_CLOSE_EVT:
ESP_LOGI(TAG, "close: %d", param->close.handle);
break;