From 15d7b8a8153d393fd6710b81f7456af3c70e226f Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Thu, 6 Jan 2011 23:07:41 +0000 Subject: [PATCH] introduce HCI states SLEEPING and FALLING_ASLEEP, introduce HCI power mode command SLEEP --- TODO.txt | 20 +++++++++++++++++--- include/btstack/hci_cmds.h | 7 +++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/TODO.txt b/TODO.txt index 36f67cecd..1b30886d1 100644 --- a/TODO.txt +++ b/TODO.txt @@ -11,12 +11,26 @@ - Cocoa run_loop: added timeouts, include in libBTstack.dylib build 2010-xxxx: Release 0.2 - revions xxx - limit size of /tmp/hci_dump.pklg to 1000 packets (max 1 MB) - +- power handling: receive power notifications NEXT: -- figure out how to receive iPhone System Power IONotifications (in BTdaemon) to detect, when phone gets locked -- have a look at External Accessory interface by Apple - it's quite similar +- power handling + - DONE: figure out how to receive iPhone System Power IONotifications (in BTdaemon) to detect, when phone gets locked and wakes up + - DONE: introduce HCI states SLEEPING and FALLING_ASLEEP + - DONE: introduce HCI power mode command SLEEP + - stop all baseband connections on HCI_POWER_OFF and HCI_POWER_SLEEP + - for now, treat sleep/wake the same as power off/on + - decide on configure flags + - clean up components + +- decide what to do with the CocoaTouch code. + - do nothing + - add it to libBTstack.dylib + - provide a libBTstackCocoaTouch.dylib? + - move RFCOMM code into BTdaemon +- have a look at External Accessory interface by Apple - it's quite similar in function to BTstack + - HCI CMD packet is limited to 1024 bytes payload. SDP records could be larger than that. Options: - provide a way to transfer SDP records in segments - ignore HCI command lenght on socket connection and directly stream data without buffer diff --git a/include/btstack/hci_cmds.h b/include/btstack/hci_cmds.h index 1fe83a132..434d69e35 100644 --- a/include/btstack/hci_cmds.h +++ b/include/btstack/hci_cmds.h @@ -174,7 +174,8 @@ extern "C" { */ typedef enum { HCI_POWER_OFF = 0, - HCI_POWER_ON + HCI_POWER_ON, + HCI_POWER_SLEEP } HCI_POWER_MODE; /** @@ -184,7 +185,9 @@ typedef enum { HCI_STATE_OFF = 0, HCI_STATE_INITIALIZING, HCI_STATE_WORKING, - HCI_STATE_HALTING + HCI_STATE_HALTING, + HCI_STATE_SLEEPING, + HCI_STATE_FALLING_ASLEEP } HCI_STATE; /**