attrib: remove g_attrib_is_encrypted

This function is only used in one place and encryption is the
responsibility of the channel, not the attribute.
shared/att: bugfix for BT_ATT_ALL_REQUESTS
GATT shim to src/shared bt_att

This patch implements a version of GAttrib which is backed by
bt_att, which enables the simultaneous use of GAttrib and bt_att.

This should enable smooth transition of profiles from the GAttrib
API to the src/shared bt_att API.
attrib/gattrib: Add g_attrib_get_att.

Added the g_attrib_get_att function which returns the underlying bt_att
structure associated with a GAttrib.
shared/att: Add bt_att_get_fd.

This patch adds a getter for a bt_att structure's underlying connection
file descriptor.
core: device: Use bt_att_register_disconnect.

btd_device is now notified of ATT channel disconnections by registering
a disconnect handler with bt_att instead of setting up an io watch with
the GIOChannel.
shared/gatt-client: Call ready_handler only in init.

Currently disconnect_cb calls ready_handler to notify the upper layer
if a disconnect occurred during initialization. This patch fixes it so
that the handler is only called if in_init is set.
core: device: Use shared/gatt-client for GATT.

This patch changes the GATT service discovery code path with the
following:
   - As part for device_attach_attrib, a bt_gatt_client structure is
   created that performs MTU exchange and service discovery, caches the
   services in an internal list, and handles the remote GATT service.

   - The device_browse_primary code path obtains service information
   by iterating through bt_gatt_client's services, instead of directly
   initiating primary and secondary service discovery using attrib/gatt.
   If the bt_gatt_client isn't ready at the time, the code defers
   registration of services and profile probing until the ready handler
   is called.

   - The attio connected callbacks are invoked from bt_gatt_client's
   ready handler instead of device_attach_attrib.
profiles/gatt: Don't handle GATT service.

ATT MTU exchange and handling of indications from the "Service Changed"
characteristic are now handled by shared/gatt-client, so this profile
should only deal with the GAP service.
core: Introduce gatt-callbacks

This patch introduces src/gatt-callbacks.h. This defines API functions
to get notified of bt_gatt_client related events, such as ready,
service changed, and disconnects. This is orthogonal and similar to the
existing attio.h functions, which we're aiming to deprecate.
profiles/gatt: Rename profile to gap.

Since this built in profile only handles the GAP service, this patch renames it
to gap.
profiles/gap: Rewrite using bt_gatt_client.

This patch rewrites the GAP profile to use the shared GATT stack instead
of GAttrib. The profile now also handles the Device Name characteristic.
shared/att: Directly close fd on ATT violations.

The existing code handles ATT protocol request timeouts and invalid
incoming request PDUs by cleaning up the io structure via io_destroy.
This doesn't always work, since this only terminates the connection if
io_set_close_on_destroy has been set. Calling io_destroy to force a
disconnect also has the added side-effect of not invoking the disconnect
callback registered with struct io.

This patch fixes these by calling close directly on the file descriptor
when required by the ATT protocol specification. This both cleans up the
connection regardless of whether or not close_on_unref has been set, and
it triggers the disconnect callback via an EPOLLHUP event.
TODO: Update GAttrib related items.

Updated TODOs related to the daemon transition from attrib/ to
shared/gatt.
core: gatt: Introduce gatt-client.

This patch introduces src/gatt-client, which will implement the D-Bus
API outlined in doc/gatt-api.txt.
core: gatt: Export GATT services on D-Bus

This patch adds code that exports an object on D-Bus with the
org.bluez.GattService1 interface for each GATT service that is present
in bt_gatt_client.
core: gatt: Export GATT characteristics on D-Bus

This patch adds code that exports an object on D-Bus with the
org.bluez.GattCharacteristic1 interface for each GATT characteristic
that is present in bt_gatt_client.
core: gatt: Export GATT descriptors on D-Bus

This patch adds code that exports an object on D-Bus with the
org.bluez.GattDescriptor1 interface for each GATT descriptor that is
present in bt_gatt_client.
core: gatt: Implement GattCharacteristic1.ReadValue

This patch implements the ReadValue method of
org.bluez.GattCharacteristic1 and exposes the "Value" property based on
what was cached during the most recent read. The property is hidden if
the value is unknown.
core: gatt: Implement GattDescriptor1.ReadValue

This patch implements the ReadValue method of org.bluez.GattDescriptor1
and exposes the "Value" property based on what was cached during the
most recent read. The property is hidden if the value is unknown.