Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315694
b: refs/heads/master
c: 10122d0
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo Padovan committed Jul 17, 2012
1 parent 2976ec4 commit c91f141
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 255a68e0124082396d5e6a073ae80f2c41d9c886
refs/heads/master: 10122d07ced378ec9187f4b3110e110282beb192
13 changes: 13 additions & 0 deletions trunk/drivers/bluetooth/hci_h5.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ struct h5 {
bool tx_ack_req; /* Pending ack to send */
u8 tx_seq; /* Next seq number to send */
u8 tx_ack; /* Next ack number to send */

bool sleeping;
};

static void h5_reset_rx(struct h5 *h5);
Expand Down Expand Up @@ -211,6 +213,9 @@ static void h5_handle_internal_rx(struct hci_uart *hu)
const unsigned char sync_rsp[] = { 0x02, 0x7d };
const unsigned char conf_req[] = { 0x03, 0xfc, 0x01 };
const unsigned char conf_rsp[] = { 0x04, 0x7b, 0x01 };
const unsigned char wakeup_req[] = { 0x05, 0xfa };
const unsigned char woken_req[] = { 0x06, 0xf9 };
const unsigned char sleep_req[] = { 0x07, 0x78 };
const unsigned char *hdr = h5->rx_skb->data;
const unsigned char *data = &h5->rx_skb->data[4];

Expand All @@ -233,6 +238,14 @@ static void h5_handle_internal_rx(struct hci_uart *hu)
BT_DBG("Three-wire init sequence complete");
hci_uart_init_ready(hu);
return;
} else if (memcmp(data, sleep_req, 2) == 0) {
BT_DBG("Peer went to sleep");
h5->sleeping = true;
h5_link_control(hu, wakeup_req, 2);
} else if (memcmp(data, woken_req, 2) == 0) {
BT_DBG("Peer woke up");
h5->sleeping = false;
return;
} else {
BT_DBG("Link Control: 0x%02hhx 0x%02hhx", data[0], data[1]);
return;
Expand Down

0 comments on commit c91f141

Please sign in to comment.