OSDN Git Service

core: Re-connect for ECONNRESET or ECONNABORTED
authorClaudio Takahasi <claudio.takahasi@openbossa.org>
Tue, 2 Oct 2012 17:22:56 +0000 (14:22 -0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Wed, 3 Oct 2012 07:51:09 +0000 (10:51 +0300)
commitc60d08b37068289303168cccfe79789348e44bc4
tree916810d0b0ef11e558aa5056093942b8a5643a3f
parent670354f2fc1356d948066358912c4b05ef5204e4
core: Re-connect for ECONNRESET or ECONNABORTED

This patch keeps scanning and re-connections active if the disconnection
reason is ECONNRESET(Remote Initiated Disconnection).

Re-connection is a behaviour determined by Profiles or by the upper
layer(user actions). For instance, HoG requires re-connection always
active, no matter if the previous disconnection reason was page timeout
or remote initiated disconnection (ECONNRESET). Some devices disconnects
after some idle time, connectable advertises are sent by the peripheral
when commanded by the user(eg: key pressed). Disconnection can be also
triggered by the local host (ECONNABORTED) using command line tools or
Disconnect method in the Device interface.

The peripheral dictates the re-connection controlling the connectable
advertises, BlueZ(central) needs to keep the scanning always active to
able to detect the advertises and trigger the connection.
src/device.c