Diff between 8e955dfd82d5798c8884914fc78bcc40c9ecc7ad and 1ca4c658d9076cd63a63cf7649e74581e1a3a1b0

Changed Files

File Additions Deletions Status
android/main.c +4 -0 modified
android/pan.c +56 -0 modified
android/pan.h +2 -0 modified

Full Patch

diff --git a/android/main.c b/android/main.c
index 29b3882..7d36976 100644
--- a/android/main.c
+++ b/android/main.c
@@ -272,6 +272,10 @@ static gboolean cmd_watch_cb(GIOChannel *io, GIOCondition cond,
 		bt_a2dp_handle_cmd(hal_cmd_io, msg->opcode, msg->payload,
 								msg->len);
 		break;
+	case HAL_SERVICE_ID_PAN:
+		bt_pan_handle_cmd(hal_cmd_io, msg->opcode, msg->payload,
+								msg->len);
+		break;
 	default:
 		ipc_send_rsp(hal_cmd_io, msg->service_id, HAL_STATUS_FAILED);
 		break;
diff --git a/android/pan.c b/android/pan.c
index 4b988ac..0cc3590 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -32,9 +32,65 @@
 #include "lib/bluetooth.h"
 #include "log.h"
 #include "pan.h"
+#include "hal-msg.h"
+#include "ipc.h"
 
 static GIOChannel *notification_io = NULL;
 
+static uint8_t bt_pan_enable(struct hal_cmd_pan_enable *cmd, uint16_t len)
+{
+	DBG("Not Implemented");
+
+	return HAL_STATUS_FAILED;
+}
+
+static uint8_t bt_pan_get_role(void *cmd, uint16_t len)
+{
+	DBG("Not Implemented");
+
+	return HAL_STATUS_FAILED;
+}
+
+static uint8_t bt_pan_connect(struct hal_cmd_pan_connect *cmd, uint16_t len)
+{
+	DBG("Not Implemented");
+
+	return HAL_STATUS_FAILED;
+}
+
+static uint8_t bt_pan_disconnect(struct hal_cmd_pan_connect *cmd, uint16_t len)
+{
+	DBG("Not Implemented");
+
+	return HAL_STATUS_FAILED;
+}
+
+void bt_pan_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
+								uint16_t len)
+{
+	uint8_t status = HAL_STATUS_FAILED;
+
+	switch (opcode) {
+	case HAL_OP_PAN_ENABLE:
+		status = bt_pan_enable(buf, len);
+		break;
+	case HAL_OP_PAN_GET_ROLE:
+		status = bt_pan_get_role(buf, len);
+		break;
+	case HAL_OP_PAN_CONNECT:
+		status = bt_pan_connect(buf, len);
+		break;
+	case HAL_OP_PAN_DISCONNECT:
+		status = bt_pan_disconnect(buf, len);
+		break;
+	default:
+		DBG("Unhandled command, opcode 0x%x", opcode);
+		break;
+	}
+
+	ipc_send_rsp(io, HAL_SERVICE_ID_A2DP, status);
+}
+
 bool bt_pan_register(GIOChannel *io, const bdaddr_t *addr)
 {
 	DBG("");
diff --git a/android/pan.h b/android/pan.h
index 318f318..1ffba9d 100644
--- a/android/pan.h
+++ b/android/pan.h
@@ -21,5 +21,7 @@
  *
  */
 
+void bt_pan_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, uint16_t len);
+
 bool bt_pan_register(GIOChannel *io, const bdaddr_t *addr);
 void bt_pan_unregister(void);