mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-10 13:33:33 +08:00
Remove CCC if the device is not bonded
Changes attrib server to remove CCC entries of the device when the connection is established if the device is not bonded.
This commit is contained in:
parent
2abb3498e8
commit
a6cabbf64b
@ -38,10 +38,14 @@
|
||||
#include <bluetooth/sdp_lib.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "gdbus.h"
|
||||
#include "glib-compat.h"
|
||||
#include "btio.h"
|
||||
#include "sdpd.h"
|
||||
#include "hcid.h"
|
||||
#include "adapter.h"
|
||||
#include "device.h"
|
||||
#include "manager.h"
|
||||
#include "att.h"
|
||||
#include "gattrib.h"
|
||||
#include "storage.h"
|
||||
@ -834,9 +838,12 @@ done:
|
||||
|
||||
guint attrib_channel_attach(GAttrib *attrib, gboolean out)
|
||||
{
|
||||
struct btd_adapter *adapter;
|
||||
struct btd_device *device;
|
||||
struct gatt_channel *channel;
|
||||
GIOChannel *io;
|
||||
GError *gerr = NULL;
|
||||
char addr[18];
|
||||
uint16_t cid;
|
||||
|
||||
io = g_attrib_get_channel(attrib);
|
||||
@ -856,6 +863,14 @@ guint attrib_channel_attach(GAttrib *attrib, gboolean out)
|
||||
return 0;
|
||||
}
|
||||
|
||||
adapter = manager_find_adapter(&channel->src);
|
||||
|
||||
ba2str(&channel->dst, addr);
|
||||
device = adapter_find_device(adapter, addr);
|
||||
|
||||
if (device_is_bonded(device) == FALSE)
|
||||
delete_device_ccc(&channel->src, &channel->dst);
|
||||
|
||||
if (channel->mtu > ATT_MAX_MTU)
|
||||
channel->mtu = ATT_MAX_MTU;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user