3#include <kindlebt/compat_ace_shims.h>
10#include <kindlebt/compat_ace_implementations.h>
21 static getSessionForCallback_fn_t old_api = NULL;
22 static getSessionForTask_fn_t new_api = NULL;
23 static bool initialized =
false;
26 new_api = (getSessionForTask_fn_t)dlsym(RTLD_DEFAULT,
"getSessionForTask");
28 old_api = (getSessionForCallback_fn_t)dlsym(RTLD_DEFAULT,
"getSessionForCallback");
36 return old_api(task->callback_id);
39 log_error(
"[%s()]: couldn't match any of the expected getSessionFor* symbols", __func__);
44typedef status_t (*aceBt_bleRegisterGattClient_tn_t)(
51 static aceBt_bleRegisterGattClient_tn_t new_api = NULL;
54 static bool initialized =
false;
58 (aceBt_bleRegisterGattClient_tn_t)dlsym(RTLD_DEFAULT,
"aceBt_bleRegisterGattClient");
64 return new_api(session_handle, callbacks, app_id);
66 return pre5170_bleRegisterGattClient(session_handle, callbacks, app_id);
73 static aceBT_bleDeRegisterGattClient_fn_t new_api = NULL;
76 static bool initialized =
false;
79 new_api = (aceBT_bleDeRegisterGattClient_fn_t
80 )dlsym(RTLD_DEFAULT,
"aceBT_bleDeRegisterGattClient");
86 return new_api(session_handle);
88 return pre5170_bleDeregisterGattClient(session_handle);
95 static aceBT_bleDiscoverAllServices_fn_t new_api = NULL;
98 static bool initialized =
false;
102 (aceBT_bleDiscoverAllServices_fn_t)dlsym(RTLD_DEFAULT,
"aceBT_bleDiscoverAllServices");
108 return new_api(session_handle, conn_handle);
110 return pre5170_bleDiscoverAllServices(session_handle, conn_handle);
117 static aceBT_bleGetService_fn_t new_api = NULL;
120 static bool initialized =
false;
123 new_api = (aceBT_bleGetService_fn_t)dlsym(RTLD_DEFAULT,
"aceBT_bleGetService");
129 return new_api(conn_handle);
131 return pre5170_bleGetService(conn_handle);
135typedef status_t (*aceBT_bleReadCharacteristics_fn_t)(
143 static aceBT_bleReadCharacteristics_fn_t new_api = NULL;
146 static bool initialized =
false;
150 (aceBT_bleReadCharacteristics_fn_t)dlsym(RTLD_DEFAULT,
"aceBT_bleReadCharacteristics");
156 return new_api(session_handle, conn_handle, chars_value);
158 return pre5170_bleReadCharacteristic(session_handle, conn_handle, chars_value);
162typedef status_t (*aceBT_bleWriteCharacteristics_fn_t)(
166status_t shim_bleWriteCharacteristic(
170 static aceBT_bleWriteCharacteristics_fn_t new_api = NULL;
173 static bool initialized =
false;
176 new_api = (aceBT_bleWriteCharacteristics_fn_t
177 )dlsym(RTLD_DEFAULT,
"aceBT_bleWriteCharacteristics");
183 return new_api(session_handle, conn_handle, chars_value, request_type);
185 return pre5170_bleWriteCharacteristics(
186 session_handle, conn_handle, chars_value, request_type
191typedef status_t (*aceBT_bleWriteDescriptor_fn_t)(
199 static aceBT_bleWriteDescriptor_fn_t new_api = NULL;
202 static bool initialized =
false;
206 (aceBT_bleWriteCharacteristics_fn_t)dlsym(RTLD_DEFAULT,
"aceBT_bleWriteDescriptor");
211 return new_api(session_handle, conn_handle, chars_value, request_type);
213 return pre5170_bleWriteDescriptor(session_handle, conn_handle, chars_value, request_type);
217typedef status_t (*aceBT_bleSetNotification_fn_t)(
225 static aceBT_bleSetNotification_fn_t new_api = NULL;
228 static bool initialized =
false;
231 new_api = (aceBT_bleSetNotification_fn_t)dlsym(RTLD_DEFAULT,
"aceBT_bleSetNotification");
237 return new_api(session_handle, conn_handle, chars_value, enable);
239 return pre5170_bleSetNotification(session_handle, conn_handle, chars_value, enable);
aceBT_bleGattClientCallbacks_t bleGattClientCallbacks_t
Callback struct of GATT Client Bluetooth operations.
aceBt_bleAppId_t bleAppId_t
BLE application type.
aceBT_responseType_t responseType_t
Type of write operation for a BLE characteristic.
ace_status_t status_t
Bluetooth API status codes.
aceBT_bleConnHandle bleConnHandle
Connection handle for the lifetime of a Bluetooth connection.
aceBT_sessionHandle sessionHandle
Session handle for the lifetime of the Bluetooth application.
aceBT_bleGattCharacteristicsValue_t bleGattCharacteristicsValue_t
BLE GATT Characteristic.