mirror of https://github.com/labapart/gattlib
gattlib: Disable gattlib_get_rssi() for now
This API has been disabled until this issue is clarified: https://github.com/labapart/gattlib/issues/75 RSSI can be accessed through `gattlib_get_rssi_from_mac()` before the connection is established.pull/116/head
parent
ebf3cc80fb
commit
0142c33dd8
|
@ -549,10 +549,12 @@ int get_handle_from_uuid(gatt_connection_t* connection, const uuid_t* uuid, uint
|
|||
return -1;
|
||||
}
|
||||
|
||||
#if 0 // Disable until https://github.com/labapart/gattlib/issues/75 is resolved
|
||||
int gattlib_get_rssi(gatt_connection_t *connection, int16_t *rssi)
|
||||
{
|
||||
return GATTLIB_NOT_SUPPORTED;
|
||||
}
|
||||
#endif
|
||||
|
||||
int gattlib_get_rssi_from_mac(void *adapter, const char *mac_address, int16_t *rssi)
|
||||
{
|
||||
|
|
|
@ -1365,6 +1365,7 @@ int gattlib_notification_stop(gatt_connection_t* connection, const uuid_t* uuid)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0 // Disable until https://github.com/labapart/gattlib/issues/75 is resolved
|
||||
int gattlib_get_rssi(gatt_connection_t *connection, int16_t *rssi)
|
||||
{
|
||||
gattlib_context_t* conn_context = connection->context;
|
||||
|
@ -1377,6 +1378,7 @@ int gattlib_get_rssi(gatt_connection_t *connection, int16_t *rssi)
|
|||
|
||||
return GATTLIB_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
int gattlib_get_rssi_from_mac(void *adapter, const char *mac_address, int16_t *rssi)
|
||||
{
|
||||
|
|
|
@ -53,12 +53,13 @@ class Device:
|
|||
if self._connection == 0:
|
||||
raise DeviceError()
|
||||
|
||||
@property
|
||||
def rssi(self):
|
||||
_rssi = c_int16(0)
|
||||
ret = gattlib_get_rssi(self._connection, byref(_rssi))
|
||||
handle_return(ret)
|
||||
return _rssi.value
|
||||
# Disable until https://github.com/labapart/gattlib/issues/75 is resolved
|
||||
# @property
|
||||
# def rssi(self):
|
||||
# _rssi = c_int16(0)
|
||||
# ret = gattlib_get_rssi(self._connection, byref(_rssi))
|
||||
# handle_return(ret)
|
||||
# return _rssi.value
|
||||
|
||||
@staticmethod
|
||||
def on_disconnection(user_data):
|
||||
|
|
|
@ -357,6 +357,7 @@ int gattlib_notification_stop(gatt_connection_t* connection, const uuid_t* uuid)
|
|||
void gattlib_register_notification(gatt_connection_t* connection, gattlib_event_handler_t notification_handler, void* user_data);
|
||||
void gattlib_register_indication(gatt_connection_t* connection, gattlib_event_handler_t indication_handler, void* user_data);
|
||||
|
||||
#if 0 // Disable until https://github.com/labapart/gattlib/issues/75 is resolved
|
||||
/**
|
||||
* @brief Function to retrieve RSSI from a GATT connection
|
||||
*
|
||||
|
@ -366,6 +367,7 @@ void gattlib_register_indication(gatt_connection_t* connection, gattlib_event_ha
|
|||
* @return GATTLIB_SUCCESS on success or GATTLIB_* error code
|
||||
*/
|
||||
int gattlib_get_rssi(gatt_connection_t *connection, int16_t *rssi);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Function to retrieve RSSI from a MAC Address
|
||||
|
|
Loading…
Reference in New Issue