From c3a00c04bf0d183990fb62ab88f01df3cf08f8ab Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Sat, 12 Jun 2010 21:00:22 +0000 Subject: [PATCH] dispatch sdp client commands --- src/daemon.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/daemon.c b/src/daemon.c index 989819938..a13ff68bb 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -54,6 +54,7 @@ #include #include #include +#include #include "socket_connection.h" #ifdef USE_BLUETOOL @@ -103,8 +104,9 @@ static int btstack_command_handler(connection_t *connection, uint8_t *packet, ui uint16_t cid; uint16_t psm; uint16_t mtu; - uint16_t handle; uint8_t reason; + uint32_t service_record_handle; + // BTstack internal commands - 16 Bit OpCode, 8 Bit ParamLen, Params... switch (READ_CMD_OCF(packet)){ case BTSTACK_GET_STATE: @@ -164,6 +166,14 @@ static int btstack_command_handler(connection_t *connection, uint8_t *packet, ui reason = packet[7]; l2cap_decline_connection_internal(cid, reason); break; + case SDP_REGISTER_SERVICE_RECORD: + printf("SDP_REGISTER_SERVICE_RECORD size %u\n", size); + sdp_register_service_internal(&packet[3]); + break; + case SDP_UNREGISTER_SERVICE_RECORD: + service_record_handle = READ_BT_32(packet, 3); + sdp_unregister_service_internal(service_record_handle); + break; default: //@TODO: log into hci dump as vendor specific "event" fprintf(stderr, "Error: command %u not implemented\n:", READ_CMD_OCF(packet));