Commit 5697e9e8 authored by Anas Nashif's avatar Anas Nashif
Browse files

Merge "Merge bluetooth branch into master"

parents 23b06ebd 3bb5644c
Loading
Loading
Loading
Loading
+55 −0
Original line number Diff line number Diff line
/** @file
 * @brief Audio/Video Distribution Transport Protocol header.
 */

/*
 * Copyright (c) 2015-2016 Intel Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef __BT_AVDTP_H
#define __BT_AVDTP_H

#ifdef __cplusplus
extern "C" {
#endif

/** @brief AVDTP SEID Information */
struct bt_avdtp_seid_info {
	/** Stream End Point ID */
	uint8_t id:6;
	/** End Point usage status */
	uint8_t inuse:1;
	/** Reserved */
	uint8_t rfa0:1;
	/** Media-type of the End Point */
	uint8_t media_type:4;
	/** TSEP of the End Point */
	uint8_t tsep:1;
	/** Reserved */
	uint8_t rfa1:3;
} __packed;

/** @brief AVDTP Local SEP*/
struct bt_avdtp_seid_lsep {
	/** Stream End Point information */
	struct bt_avdtp_seid_info sep;
	/** Pointer to next local Stream End Point structure */
	struct bt_avdtp_seid_lsep *next;
};

#ifdef __cplusplus
}
#endif

#endif /* __BT_AVDTP_H */
+5 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#define __BT_LOG_H

#include <sections.h>
#include <offsets.h>
#include <zephyr.h>

#ifdef __cplusplus
@@ -81,9 +82,11 @@ void bt_log(int prio, const char *fmt, ...);
			}

#define BT_STACK(name, size) \
		char __stack name[(size) + BT_STACK_DEBUG_EXTRA]
		char __stack name[(size) + K_THREAD_SIZEOF + \
				  BT_STACK_DEBUG_EXTRA]
#define BT_STACK_NOINIT(name, size) \
		char __noinit __stack name[(size) + BT_STACK_DEBUG_EXTRA]
		char __noinit __stack name[(size) + K_THREAD_SIZEOF + \
					   BT_STACK_DEBUG_EXTRA]

#if defined(CONFIG_BLUETOOTH_DEBUG)
const char *bt_hex(const void *buf, size_t len);
+6 −3
Original line number Diff line number Diff line
@@ -4,8 +4,11 @@ CONFIG_UART_CONSOLE=n
CONFIG_GPIO=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_HCI_RAW=y
CONFIG_BLUETOOTH_MAX_CONN=16
CONFIG_UART_NRF5_BAUD_RATE=115200
CONFIG_UART_NRF5_FLOW_CONTROL=n
CONFIG_MAIN_STACK_SIZE=512
CONFIG_IDLE_STACK_SIZE=256
CONFIG_ISR_STACK_SIZE=512
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_HCI_RAW=y
CONFIG_BLUETOOTH_MAX_CONN=20
+7 −3
Original line number Diff line number Diff line
@@ -4,9 +4,13 @@ CONFIG_UART_CONSOLE=n
CONFIG_GPIO=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_HCI_RAW=y
CONFIG_BLUETOOTH_MAX_CONN=16
CONFIG_UART_NRF5_BAUD_RATE=1000000
CONFIG_UART_NRF5_FLOW_CONTROL=y
CONFIG_MAIN_STACK_SIZE=512
CONFIG_IDLE_STACK_SIZE=256
CONFIG_ISR_STACK_SIZE=512
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_HCI_RAW=y
CONFIG_BLUETOOTH_MAX_CONN=20
CONFIG_BLUETOOTH_CONTROLLER_ASSERT_HANDLER=y
CONFIG_BLUETOOTH_TINYCRYPT_ECC=y
+8 −6
Original line number Diff line number Diff line
@@ -32,14 +32,13 @@

#include <net/buf.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/log.h>
#include <bluetooth/hci.h>
#include <bluetooth/buf.h>
#include <bluetooth/hci_raw.h>

static struct device *hci_uart_dev;

#define STACK_SIZE 1024
static uint8_t tx_thread_stack[STACK_SIZE];
static BT_STACK_NOINIT(tx_thread_stack, CONFIG_BLUETOOTH_HCI_SEND_STACK);

/* HCI command buffers */
#define CMD_BUF_SIZE (CONFIG_BLUETOOTH_HCI_SEND_RESERVE + \
@@ -369,10 +368,13 @@ void main(void)
	k_fifo_init(&tx_queue);
	k_fifo_init(&rx_queue);

	k_thread_spawn(tx_thread_stack, STACK_SIZE, tx_thread, NULL, NULL,
		       NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);

	/* Enable the raw interface, this will in turn open the HCI driver */
	bt_enable_raw(&rx_queue);
	/* Spawn the TX thread and start feeding commands and data to the
	 * controller
	 */
	k_thread_spawn(tx_thread_stack, sizeof(tx_thread_stack), tx_thread,
		       NULL, NULL, NULL, K_PRIO_COOP(7), 0, K_NO_WAIT);

	while (1) {
		struct net_buf *buf;
Loading