shared/gatt-client: Fix bug in service changed queue.

This patch fixes a bug where the handle range for queued service changed
events weren't getting stored. This caused service discovery to be
initiated for the 0x0000-0x0000 range, which caused an error response.
shared/gatt-client: Fix bug in service changed handling.

This patch fixes a bug where the upper layer never got notified of a
service changed event if no new services are added within a changed
service range. This also fixes a bug where an empty changed service list
or ATT error caused pending service changed events to not get processed.
tools/btgatt-client: Fix read-long-value offset parsing.

This patch fixes the way read-long-value command parses the "offset"
argument by interpreting it as base 10 instead of 16, which is more
intuitive.
tools/btgatt-client: Fix off-by-one error.

This patch fixes an error in write-long-value command that caused an
extra invalid byte to get sent at the end of the long write value.
tools/btgatt-client: Print prompt on service changed.

The service changed handler now prints the command line prompt if the
changed service list empty.
shared/gatt-db: Fix range handling in read by grp type.

This patch fixes bug in gatt_db_read_by_grp_type in which the range end handle
was being ignored. This caused incorrect results to be sent for a database
where services exists beyond the end handle provided in the request.
TODO: Add new shared/gatt TODO items.

Added items for adding packed structs for ATT PDUs and improving unit test
coverage.
Remove unused g_attrib_set_debug function

This function is not used, and also not implemented.
attrib: Remove MTU-probing code

Probing for the MTU using bt_io is problematic for
testing because you cannot impersonate AF_BLUETOOTH sockets
with a socketpair.
attrib: Add mtu argument to g_attrib_new

Instead of using the default MTU, use one passed
in by the user, and detect it from the channel when
it is created.
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.
Add unit tests for gattrib

This will ensure that the API behavior of gattrib is preserved.
attrib: Add unit tests for g_attrib_register
attrib: fix GATTRIB_ALL_REQS behavior

g_attrib_register(..., GATTRIB_ALL_REQS, ...) behavior would previously
include indications, this fixes it to only include requests and
commands.
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.