OSDN Git Service

android/hal-pan: Add implementation of .enable
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 28 Oct 2013 12:09:03 +0000 (14:09 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 28 Oct 2013 12:42:28 +0000 (14:42 +0200)
android/hal-msg.h
android/hal-pan.c

index a0a8390..0987eec 100644 (file)
@@ -290,6 +290,13 @@ struct hal_cmd_av_disconnect {
        uint8_t bdaddr[6];
 } __attribute__((packed));
 
+/* PAN HAL API */
+
+#define HAL_OP_PAN_ENABLE      0x01
+struct hal_cmd_pan_enable {
+       uint8_t local_role;
+} __attribute__((packed));
+
 /* Notifications and confirmations */
 
 
index 62fec00..8fb2563 100644 (file)
@@ -32,12 +32,17 @@ static bool interface_ready(void)
 
 static bt_status_t pan_enable(int local_role)
 {
+       struct hal_cmd_pan_enable cmd;
+
        DBG("");
 
        if (!interface_ready())
                return BT_STATUS_NOT_READY;
 
-       return BT_STATUS_UNSUPPORTED;
+       cmd.local_role = local_role;
+
+       return hal_ipc_cmd(HAL_SERVICE_ID_PAN, HAL_OP_PAN_ENABLE,
+                                       sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static int pan_get_local_role(void)