OSDN Git Service

android: Add support for handling get properties commands
authorSzymon Janc <szymon.janc@tieto.com>
Mon, 4 Nov 2013 15:34:23 +0000 (16:34 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 4 Nov 2013 19:31:16 +0000 (21:31 +0200)
When this commands is received all properties shall be reported to HAL.

android/adapter.c

index fb5c462..56ac4b7 100644 (file)
@@ -1120,6 +1120,19 @@ static bool get_property(void *buf, uint16_t len)
        }
 }
 
+static void get_properties(void)
+{
+       get_address();
+       get_name();
+       get_uuids();
+       get_class();
+       get_type();
+       get_service();
+       get_scan_mode();
+       get_devices();
+       get_disc_timeout();
+}
+
 static bool start_discovery(void)
 {
        struct mgmt_cp_start_discovery cp;
@@ -1504,6 +1517,10 @@ void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
                        goto error;
 
                break;
+       case HAL_OP_GET_ADAPTER_PROPS:
+               get_properties();
+
+               break;
        case HAL_OP_GET_ADAPTER_PROP:
                if (!get_property(buf, len))
                        goto error;