Thank you for that! I have tried putting it in my code and have gotten an error ( second line ). The first line is to show the mac address was successfully obtained using the parameters from the connection
Code: Select all
I (63594) wOS: SERVICE_START_EVT, conn_id 0, remote e4:12:1d:a3:f2:2f:, is_conn 1
E (63594) BT: bta_dm_ble_update_conn_params error: Invalid connection bd_addr.
It was placed in the event handler under this case:
Code: Select all
case ESP_GATTS_CONNECT_EVT:
ESP_LOGI(GATTS_TAG, "SERVICE_START_EVT, conn_id %d, remote %02x:%02x:%02x:%02x:%02x:%02x:, is_conn %d\n",
param->connect.conn_id,
param->connect.remote_bda[0], param->connect.remote_bda[1], param->connect.remote_bda[2],
param->connect.remote_bda[3], param->connect.remote_bda[4], param->connect.remote_bda[5],
param->connect.is_connected);
gl_profile.conn_id = param->connect.conn_id;
uint8_t client_addr[6] = { param->connect.remote_bda[0], param->connect.remote_bda[1], param->connect.remote_bda[2], param->connect.remote_bda[3], param->connect.remote_bda[4], param->connect.remote_bda[5] };
gatt_perihperal_update_connection_params( client_addr );
break;
and finally here is the edited version of the function you gave me:
Code: Select all
void gatt_perihperal_update_connection_params(uint8_t* client_addr)
{
esp_ble_conn_update_params_t conn_params;
memcpy(conn_params.bda, client_addr, sizeof( 6 ) );
conn_params.min_int = 0x06;
conn_params.max_int = 0x40;
conn_params.latency = 0x00;
conn_params.timeout = 0x0C80; // Maximum value to test if timeout is the issue with Android
esp_ble_gap_update_conn_params(&conn_params);
}