CAPI/Socket: Add function bt_socket_listen 09/22709/1
authorWu Jiangbo <jiangbox.wu@intel.com>
Tue, 10 Jun 2014 03:33:01 +0000 (11:33 +0800)
committerWu Jiangbo <jiangbox.wu@intel.com>
Tue, 10 Jun 2014 11:34:43 +0000 (19:34 +0800)
Change-Id: I2861b67c6f04ac5e5e6943f4c3f7e6422368a529
Signed-off-by: Wu Jiangbo <jiangbox.wu@intel.com>
capi/bluetooth.c

index 5e5f648..53b4c0f 100644 (file)
@@ -4071,6 +4071,22 @@ int bt_socket_disconnect_rfcomm(int socket_fd)
                                        spp_ctx->uuid);
 }
 
+int bt_socket_listen(int socket_fd, int max_pending_connections)
+{
+       struct spp_context *spp_ctx;
+
+       spp_ctx = find_spp_context_from_socketfd(socket_fd);
+       if (spp_ctx == NULL)
+               return BT_ERROR_OPERATION_FAILED;
+
+       if (max_pending_connections > 0)
+               spp_ctx->max_pending = max_pending_connections;
+       else
+               spp_ctx->max_pending = -1;
+
+       return BT_SUCCESS;
+}
+
 int bt_socket_set_connection_state_changed_cb(
                        bt_socket_connection_state_changed_cb callback,
                        void *user_data)