From 36235e21e4a69906283581fbaf32e05a11967156 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Fri, 25 Oct 2013 17:14:59 +0200 Subject: [PATCH] android: Add initial code for handling adapter set property command No commands are handled yet. --- android/adapter.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/android/adapter.c b/android/adapter.c index 685b00da2..13cce8ffe 100644 --- a/android/adapter.c +++ b/android/adapter.c @@ -365,6 +365,20 @@ static bool get_property(void *buf, uint16_t len) } } +static uint8_t set_property(void *buf, uint16_t len) +{ + struct hal_cmd_set_adapter_prop *cmd = buf; + + switch (cmd->type) { + case HAL_PROP_ADAPTER_NAME: + case HAL_PROP_ADAPTER_SCAN_MODE: + case HAL_PROP_ADAPTER_DISC_TIMEOUT: + default: + DBG("Unhandled property type 0x%x", cmd->type); + return HAL_STATUS_FAILED; + } +} + void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, uint16_t len) { @@ -395,6 +409,12 @@ void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, if (!get_property(buf, len)) goto error; + break; + case HAL_OP_SET_ADAPTER_PROP: + status = set_property(buf, len); + if (status != HAL_STATUS_SUCCESS) + goto error; + break; default: DBG("Unhandled command, opcode 0x%x", opcode); -- 2.47.3