/* continue with service discovery and connection */
btd_device_set_temporary(device, false);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
device_update_last_seen(device, data->dst_type);
+#else
+ device_update_last_seen(device, data->dst_type, true);
+#endif
if (data->dst_type != BDADDR_BREDR){
g_io_channel_set_close_on_unref(io, FALSE);
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
if (device_get_rpa_exist(dev) == true)
bdaddr_type = BDADDR_LE_RANDOM;
-#endif
device_update_last_seen(dev, bdaddr_type);
+#else
+ device_update_last_seen(dev, bdaddr_type, !not_connectable);
+#endif
/*
* FIXME: We need to check for non-zero flags first because
!(eir_data.flags & EIR_BREDR_UNSUP)) {
device_set_bredr_support(dev);
/* Update last seen for BR/EDR in case its flag is set */
- device_update_last_seen(dev, BDADDR_BREDR);
+ device_update_last_seen(dev, BDADDR_BREDR, !not_connectable);
}
#endif
bool connected;
bool svc_resolved;
bool initiator;
+#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
+ bool connectable;
+ time_t last_seen;
+#endif
};
struct csrk_info {
sdp_list_t *tmp_records;
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
time_t bredr_seen;
time_t le_seen;
+#endif
gboolean trusted;
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
if (dev->bdaddr_type == BDADDR_LE_RANDOM)
return dev->bdaddr_type;
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
if (dev->bredr_seen) {
bredr_last = current - dev->bredr_seen;
+#else
+ if (dev->bredr_state.last_seen) {
+ bredr_last = current - dev->bredr_state.last_seen;
+#endif
if (bredr_last > SEEN_TRESHHOLD)
bredr_last = NVAL_TIME;
}
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
if (dev->le_seen) {
le_last = current - dev->le_seen;
+#else
+ if (dev->le_state.last_seen) {
+ le_last = current - dev->le_state.last_seen;
+#endif
if (le_last > SEEN_TRESHHOLD)
le_last = NVAL_TIME;
}
{
struct bearer_state *state = get_state(dev, bdaddr_type);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
device_update_last_seen(dev, bdaddr_type);
+#else
+ device_update_last_seen(dev, bdaddr_type, true);
+#endif
if (state->connected) {
char addr[18];
if (device->bredr_state.connected || device->le_state.connected)
return;
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
device_update_last_seen(device, bdaddr_type);
+#else
+ device_update_last_seen(device, bdaddr_type, true);
+#endif
g_slist_free_full(device->eir_uuids, g_free);
device->eir_uuids = NULL;
addr_str);
return;
}
-#endif
if (device->bredr)
+#else
+ if (btd_opts.mode == BT_MODE_LE || device->bredr)
+#endif
return;
device->bredr = true;
void device_set_le_support(struct btd_device *device, uint8_t bdaddr_type)
{
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
if (device->le)
+#else
+ if (btd_opts.mode == BT_MODE_BREDR || device->le)
+#endif
return;
device->le = true;
store_device_info(device);
}
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
void device_update_last_seen(struct btd_device *device, uint8_t bdaddr_type)
+#else
+void device_update_last_seen(struct btd_device *device, uint8_t bdaddr_type,
+ bool connectable)
+#endif
{
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
if (bdaddr_type == BDADDR_BREDR)
device->bredr_seen = time(NULL);
else
device->le_seen = time(NULL);
+#else
+ struct bearer_state *state;
+
+ state = get_state(device, bdaddr_type);
+
+ state->last_seen = time(NULL);
+ state->connectable = connectable;
+#endif
if (!device_is_temporary(device))
return;
/* Check the ADV type. Some beacon device can be connectable regardless adv flags */
return device->le_connectable;
#else
- /* Check if either Limited or General discoverable are set */
- return (device->ad_flags[0] & 0x03);
+ struct bearer_state *state;
+ state = get_state(device, device->bdaddr_type);
+
+ return state->connectable;
#endif
}
uint8_t bdaddr_type);
void device_set_bredr_support(struct btd_device *device);
void device_set_le_support(struct btd_device *device, uint8_t bdaddr_type);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
void device_update_last_seen(struct btd_device *device, uint8_t bdaddr_type);
+#else
+void device_update_last_seen(struct btd_device *device, uint8_t bdaddr_type,
+ bool connectable);
+#endif
void device_merge_duplicate(struct btd_device *dev, struct btd_device *dup);
uint32_t btd_device_get_class(struct btd_device *device);
uint16_t btd_device_get_vendor(struct btd_device *device);