Commit: ff376acf185f2a9406eeb9ff35b9e24df25a1ab7
Parent: 9235d4b5aea5f420c5330c22a411ab780b272aa6
Author: Andre Guedes <andre.guedes@openbossa.org>
Committer: Johan Hedberg <johan.hedberg@nokia.com>
Date: 2011-05-05 11:07:26
Tree: 239bb3760513cdd53e4485b4c2cf20eee4cd543d

Refactoring adapter_set_state() This patch implements a new state machine for struct btd_adapter. The adapter_set_state() function was completely rewritten since its logic does not apply anymore. The whole logic of interleaved discovery procedure before implemented in adapter_set_state() should be implemented at hciops and mgmtops layers. At the adapter layer, it is not important to track what is the current state (inquiring or scanning) during the discovery session. All the adapter layer cares about is if it is performing the discovery or not. Therefore, the adapter states STATE_STDINQ, STATE_PINQ and STATE_LE_SCAN were replaced by a new state called STATE_DISCOV. Additionally, because there is no point in implementing states as a bitmask, all adapter states were implemented using integers instead of a bitmask.

Diffstat

M plugins/mgmtops.c | 11 ++++- - - - - - -
M src/adapter.c | 147 ++++++++++++++++++++++++++++++++++++++++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
M src/adapter.h | 10 ++++- - - - - -
M src/event.c | 5 +- - - -

4 files changed, 73 insertions(+), 100 deletions(-)

View Full Diff | Patch