|
|
@@ -36,7 +36,7 @@ esp_err_t esp_ble_gatts_app_register(uint16_t app_id)
|
|
|
msg.sig = BTC_SIG_API_CALL;
|
|
|
msg.pid = BTC_PID_GATTS;
|
|
|
msg.act = BTC_GATTS_ACT_APP_REGISTER;
|
|
|
- arg.app_uuid = app_id;
|
|
|
+ arg.app_reg.app_id = app_id;
|
|
|
|
|
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
}
|
|
|
@@ -50,7 +50,7 @@ esp_err_t esp_ble_gatts_app_unregister(esp_gatt_if_t gatt_if)
|
|
|
msg.sig = BTC_SIG_API_CALL;
|
|
|
msg.pid = BTC_PID_GATTS;
|
|
|
msg.act = BTC_GATTS_ACT_APP_UNREGISTER;
|
|
|
- arg.gatt_if = gatt_if;
|
|
|
+ arg.app_unreg.gatt_if = gatt_if;
|
|
|
|
|
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
}
|
|
|
@@ -64,9 +64,9 @@ esp_err_t esp_ble_gatts_create_service(esp_gatt_if_t gatt_if,
|
|
|
msg.sig = BTC_SIG_API_CALL;
|
|
|
msg.pid = BTC_PID_GATTS;
|
|
|
msg.act = BTC_GATTS_ACT_CREATE_SERVICE;
|
|
|
- arg.gatt_if = gatt_if;
|
|
|
- arg.num_handle = num_handle;
|
|
|
- memcpy(&arg.service_id, service_id, sizeof(esp_gatt_srvc_id_t));
|
|
|
+ arg.create_srvc.gatt_if = gatt_if;
|
|
|
+ arg.create_srvc.num_handle = num_handle;
|
|
|
+ memcpy(&arg.create_srvc.service_id, service_id, sizeof(esp_gatt_srvc_id_t));
|
|
|
|
|
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
}
|
|
|
@@ -80,8 +80,8 @@ esp_err_t esp_ble_gatts_add_include_service(uint16_t service_handle, uint16_t in
|
|
|
msg.sig = BTC_SIG_API_CALL;
|
|
|
msg.pid = BTC_PID_GATTS;
|
|
|
msg.act = BTC_GATTS_ACT_ADD_INCLUDE_SERVICE;
|
|
|
- arg.service_handle = service_handle;
|
|
|
- arg.included_service_handle = included_service_handle;
|
|
|
+ arg.add_incl_srvc.service_handle = service_handle;
|
|
|
+ arg.add_incl_srvc.included_service_handle = included_service_handle;
|
|
|
|
|
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
}
|
|
|
@@ -96,10 +96,10 @@ esp_err_t esp_ble_gatts_add_char(uint16_t service_handle, esp_bt_uuid_t *char_
|
|
|
msg.sig = BTC_SIG_API_CALL;
|
|
|
msg.pid = BTC_PID_GATTS;
|
|
|
msg.act = BTC_GATTS_ACT_ADD_CHAR;
|
|
|
- arg.service_handle = service_handle;
|
|
|
- arg.perm = perm;
|
|
|
- arg.property = property;
|
|
|
- memcpy(&arg.uuid, char_uuid, sizeof(esp_bt_uuid_t));
|
|
|
+ arg.add_char.service_handle = service_handle;
|
|
|
+ arg.add_char.perm = perm;
|
|
|
+ arg.add_char.property = property;
|
|
|
+ memcpy(&arg.add_char.char_uuid, char_uuid, sizeof(esp_bt_uuid_t));
|
|
|
|
|
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
}
|
|
|
@@ -115,9 +115,9 @@ esp_err_t esp_ble_gatts_add_char_descr (uint16_t service_handle,
|
|
|
msg.sig = BTC_SIG_API_CALL;
|
|
|
msg.pid = BTC_PID_GATTS;
|
|
|
msg.act = BTC_GATTS_ACT_ADD_CHAR_DESCR;
|
|
|
- arg.service_handle = service_handle;
|
|
|
- arg.perm = perm;
|
|
|
- memcpy(&arg.descr_uuid, descr_uuid, sizeof(esp_bt_uuid_t));
|
|
|
+ arg.add_descr.service_handle = service_handle;
|
|
|
+ arg.add_descr.perm = perm;
|
|
|
+ memcpy(&arg.add_descr.descr_uuid, descr_uuid, sizeof(esp_bt_uuid_t));
|
|
|
|
|
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
}
|
|
|
@@ -130,7 +130,7 @@ esp_err_t esp_ble_gatts_delete_service(uint16_t service_handle)
|
|
|
msg.sig = BTC_SIG_API_CALL;
|
|
|
msg.pid = BTC_PID_GATTS;
|
|
|
msg.act = BTC_GATTS_ACT_DELETE_SERVICE;
|
|
|
- arg.service_handle = service_handle;
|
|
|
+ arg.delete_srvc.service_handle = service_handle;
|
|
|
|
|
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
}
|
|
|
@@ -143,7 +143,7 @@ esp_err_t esp_ble_gatts_start_service(uint16_t service_handle)
|
|
|
msg.sig = BTC_SIG_API_CALL;
|
|
|
msg.pid = BTC_PID_GATTS;
|
|
|
msg.act = BTC_GATTS_ACT_START_SERVICE;
|
|
|
- arg.service_handle = service_handle;
|
|
|
+ arg.start_srvc.service_handle = service_handle;
|
|
|
|
|
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
}
|
|
|
@@ -156,7 +156,7 @@ esp_err_t esp_ble_gatts_stop_service(uint16_t service_handle)
|
|
|
msg.sig = BTC_SIG_API_CALL;
|
|
|
msg.pid = BTC_PID_GATTS;
|
|
|
msg.act = BTC_GATTS_ACT_STOP_SERVICE;
|
|
|
- arg.service_handle = service_handle;
|
|
|
+ arg.stop_srvc.service_handle = service_handle;
|
|
|
|
|
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
}
|
|
|
@@ -171,13 +171,13 @@ esp_err_t esp_ble_gatts_send_indicate(uint16_t conn_id, uint16_t attr_handle,
|
|
|
msg.sig = BTC_SIG_API_CALL;
|
|
|
msg.pid = BTC_PID_GATTS;
|
|
|
msg.act = BTC_GATTS_ACT_SEND_INDICATE;
|
|
|
- arg.conn_id = conn_id;
|
|
|
- arg.attr_handle = attr_handle;
|
|
|
- arg.value_len = value_len;
|
|
|
- arg.need_confirm = need_confirm;
|
|
|
- memcpy(&arg.value, value, value_len);
|
|
|
+ arg.send_ind.conn_id = conn_id;
|
|
|
+ arg.send_ind.attr_handle = attr_handle;
|
|
|
+ arg.send_ind.need_confirm = need_confirm;
|
|
|
+ arg.send_ind.value_len = value_len;
|
|
|
+ arg.send_ind.value = value;
|
|
|
|
|
|
- return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
+ return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), btc_gatts_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
}
|
|
|
|
|
|
esp_err_t esp_ble_gatts_send_response(uint16_t conn_id, uint32_t trans_id,
|
|
|
@@ -189,12 +189,12 @@ esp_err_t esp_ble_gatts_send_response(uint16_t conn_id, uint32_t trans_id,
|
|
|
msg.sig = BTC_SIG_API_CALL;
|
|
|
msg.pid = BTC_PID_GATTS;
|
|
|
msg.act = BTC_GATTS_ACT_SEND_RESPONSE;
|
|
|
- arg.conn_id = conn_id;
|
|
|
- arg.trans_id = trans_id;
|
|
|
- arg.status = status;
|
|
|
- memcpy(&arg.rsp, rsp, sizeof(esp_gatt_rsp_t));
|
|
|
+ arg.send_rsp.conn_id = conn_id;
|
|
|
+ arg.send_rsp.trans_id = trans_id;
|
|
|
+ arg.send_rsp.status = status;
|
|
|
+ arg.send_rsp.rsp = rsp;
|
|
|
|
|
|
- return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
+ return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), btc_gatts_arg_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
}
|
|
|
|
|
|
esp_err_t esp_ble_gatts_open(esp_gatt_if_t gatt_if, esp_bd_addr_t remote_bda, bool is_direct)
|
|
|
@@ -205,9 +205,9 @@ esp_err_t esp_ble_gatts_open(esp_gatt_if_t gatt_if, esp_bd_addr_t remote_bda, bo
|
|
|
msg.sig = BTC_SIG_API_CALL;
|
|
|
msg.pid = BTC_PID_GATTS;
|
|
|
msg.act = BTC_GATTS_ACT_OPEN;
|
|
|
- arg.gatt_if = gatt_if;
|
|
|
- arg.is_direct = is_direct;
|
|
|
- memcpy(&arg.remote_bda, remote_bda, sizeof(esp_bd_addr_t));
|
|
|
+ arg.open.gatt_if = gatt_if;
|
|
|
+ arg.open.is_direct = is_direct;
|
|
|
+ memcpy(&arg.open.remote_bda, remote_bda, sizeof(esp_bd_addr_t));
|
|
|
|
|
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
}
|
|
|
@@ -220,7 +220,7 @@ esp_err_t esp_ble_gatts_close(uint16_t conn_id)
|
|
|
msg.sig = BTC_SIG_API_CALL;
|
|
|
msg.pid = BTC_PID_GATTS;
|
|
|
msg.act = BTC_GATTS_ACT_CLOSE;
|
|
|
- arg.conn_id = conn_id;
|
|
|
+ arg.close.conn_id = conn_id;
|
|
|
|
|
|
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
|
|
|
}
|