Git Product home page Git Product logo

btstack's Introduction

Welcome to BTstack

BTstack is BlueKitchen's implementation of the official Bluetooth stack. It is well suited for small, resource-constraint devices such as 8 or 16 bit embedded systems as it is highly configurable and comes with an ultra small memory footprint.

Targeting a variety of platforms is as simple as providing the necessary UART, CPU, and CLOCK implementations. BTstack is currently capable of connecting to Bluetooth-modules via: (H2) HCI USB, (H4) HCI UART + TI's eHCILL, and (H5) HCI Three-Wire UART.

On smaller embedded systems, a minimal run loop implementation allows to use BTstack without a Real Time OS (RTOS). If a RTOS is already provided, BTstack can be integrated and run as a single thread.

On larger systems, BTstack provides a server that connects to a Bluetooth module. Multiple applications can communicate with this server over different inter-process communication methods. As sockets are used for client/server communication, it's easy to interact via higher-level level languages, e.g. there's already a Java binding for use in desktop environments.

BTstack supports the Central and the Peripheral Role of Bluetooth 5 Low Energy specification incl. LE Secure Connections, LE Data Channels, and LE Data Length Extension. It can be configured to run as either single-mode stack or a dual-mode stack.

BTstack is free for non-commercial use. However, for commercial use, tell us a bit about your project to get a quote.

Documentation: HTML, PDF

Third-party libraries (FOSS): List of used libraries and their licenses

Discussion and Community Support: BTstack Google Group

Supported Protocols and Profiles

Protocols: L2CAP (incl. Enhanced Retransmission Mode and LE Data Channels), RFCOMM, SDP, BNEP, AVDTP, AVCTP, ATT, SM (incl. LE Secure Connections and Cross-transport key derivation).

Profiles: A2DP, AVRCP incl. Browsing (CT+TG) and Cover Art (CT), GAP, GATT, HFP, HID, HSP, IOP, OPP, SPP, PAN, PBAP.

GATT Service Servers: Battery (BAS), Bond Management (BMS), Cycling Power (CPS), Cycling Speed and Cadence (CSCS), Device Information (DID), Heart Rate (HRS), HID over GATT (HIDS) Device , Mesh Provisioning, Mesh Proxy, Nordic SPP, Scan Parameters (SCPS), TX Power (TPS), u-Blox SPP.

GATT Service Clients:: ANCS, Battery (BAS), Device Information (DID), HID-over-GATT (HOGP) Host, Scan Parameters (SCPP).

GATT Services are in general easy to implement and require short development time. For more GATT Services please contact us, or follow the implementation guidelines.

In Development: LE Audio and more.

It has been qualified with the Bluetooth SIG (QDID 166433) for A2DP 1.3.2, AVCTP 1.4, AVDTP 1.3, AVRCP 1.6.2, DID 1.3, GAVDP 1.3, HFP 1.8, HSP 1.2, PAN 1.0, PBAP Client 1.2, RFCOMM 1.2, SPP 1.2 BR/EDR protocol/profiles, BAS 1.0, CPP 1.1, CPS 1.1, CSCP 1.0, CSCS 1.0, DIS 1.1, HIDS 1.0, HOGP 1.0, HRP 1.0, HRS 1.0, SCPP 1.0, SCPS 1.0 GATT profiles as well as and ATT, GAP, GATT, IOP, L2CAP, SDP, SM of the Bluetooth Core 5.2 specification.

For information on Apple's MFi/iAP2 and Find My profiles, please contact us directly.

Evaluation Platforms

Embedded Platforms:

Build Status Port Platform
esp32 Espressif ESP32 2.4 GHz Wi-Fi and Bluetooth Dual-Mode combo chip using FreeRTOS
max32630-fthr MAX32630FTHR ARM Cortex M4F Board with onboard Panasonic PAN1326 module containing TI CC2564B Bluetooth controller
msp432p401lp-cc256x TI MSP432P401R LaunchPad with CC2564C Dual-mode Bluetooth® Controller Evaluation Module and EM Adapter BoosterPack with additional 32768Hz quartz oscillator
No build server rrenesas-ek-ra6m4a-da14531 Renesas EK-RA6M4 with MikroeE BLE Tiny Click board
No build server renesas-tb-s1ja-cc256x Renesas TB-S1JA with with Dual-mode Bluetooth® CC2564 evaluation board and EM Adapter BoosterPack with additional 32768Hz quartz oscillator
samv71-xplained-atwilc3000 SAMV71 Ultra Xplained Ultra evaluation kit with ATWILC3000 SHIELD
stm32-f4discovery-cc2564b STM32 F4 Discovery Board with CC256xEM Bluetooth Adapter Kit for ST and CC2564B Dual-mode Bluetooth® Controller Evaluation Module
stm32-l073rz-nucleo-em9304 EM9304 DVK: STM32 Nucleo development board NUCELO-L73RZ with EM9304 Bluetooth Controller
No build server stm32-wb55xx-nucleo-freertos P-NUCLEO-WB55 kit
wiced-h4 Broadcom/Cypress platforms that support the WICED SDK via H4 UART, e.g. RedBear Duo (BCM43438 A1), Inventek Systems ISM4334x (BCM43438 A1), Inventek Systems ISM4343 (BCM43340)

Other Platforms:

Status Port Platform
No build server freebsd-netgraph FreeBSD port that uses kernel netgraph HCI node
libusb Unix-based system with dedicated USB Bluetooth dongle
No build server libusb-intel Unix-based system with Intel Wireless 8260/8265 Controller
posix-h4 Unix-based system connected to Bluetooth module via H4 over serial port
No build server posix-h4-nxp Unix-based system connected to Cypress controllers via H4 over serial port
No build server posix-h4-da14581 Unix-based system connected to Dialog Semiconductor DA14581 via H4 over serial port
No build server posix-h4-da14585 Unix-based system connected to Dialog Semiconductor DA14585 via H4 over serial port
No build server posix-h4-nxp Unix-based system connected to NXP controllers via H4 over serial port
No build server posix-h4-zephyr Unix-based system connected to Bluetooth module with Zephyr HCI firmware via H4 over serial port
No build server posix-h5 Unix-based system connected to Bluetooth module via H5 over serial port
No build server qt-h4 Unix- or Win32-based Qt application connected to Bluetooth module via H4 over serial port
No build server qt-usb Unix- or Win32-based Qt application with dedicated USB Bluetooth dongle
No build server windows-h4 Win32-based system connected to Bluetooth module via serial port
No build server windows-h4-da14585 Win32-based system connected to Dialog Semiconductor DA14585 via H4 over serial port
No build server windows-winusb Win32-based system with dedicated USB Bluetooth dongle
No build server windows-winusb-intel Win32-based system with Intel Wireless 8260/8265 Controller
No build server raspi Raspberry Pi 3 or Raspberry Pi Zero W with built-in BCM4343 Bluetooth/Wifi Controller
daemon TCP and Unix domain named socket client-server architecture supporting multiple clients
java Java wrapper for daemon
mtk daemon for rooted Android devices, based on Mediatek MT65xx processor, Java and C client-server API
No build server freertos FreeRTOS: Run BTstack on a dedicated thread, not thread-safe.

Supported Chipsets

Chipset Type HCI Transport SCO over HCI BTstack folder Comment
Atmel ATWILC3000 LE H4 n.a. atwilc3000 Firmware size: 60 kB
Broadcom UART Dual mode H4, H5 Probably bcm Max UART baudrate 2 mbps
Broadcom USB Dongles Dual mode USB Yes bcm
CSR UART Dual mode H4, H5, BCSP No (didn't work) csr
CSR USB Dongles Dual mode USB Yes csr
Infineon CYW207xx Dual mode H4, H5, USB Probably bcm
Infineon CYW20819 Dual mode H4, H5, USB Probably bcm Keep CTS high during power cycle
Infineon CYW43xxx Dual mode + Wifi H4, H5 Don't know bcm Bluetooth + Wifi Combo Controller
Infineon CYW5557x Dual mode + Wifi H4 Yes bcm autobaud-mode needed, see posix-h4-bcm
Infineon PSoC 4 LE H4 n.a. HCI Firmware part of PSoC Creator kit examples
Dialog Semiconductor DA145xx LE H4, SPI n.a. da14581 Official HCI firmware used
Dialog Semiconductor DA1469x LE H4, SPI n.a HCI Firmware part of DA1469x SDK
Espressif ESP32 Dual mode + Wifi VHCI, H4 Yes SoC with Bluetooth and Wifi
Espressif ESP32-S3, ESP32-C3 LE + Wifi VHCI, H4 Yes SoC with Bluetooth and Wifi
EM 9301, 9304, 9305 LE SPI n.a. em9301 Custom HCI SPI implementation
Intel Dual Wireless 3165, 8260, 8265 Dual mode USB Probably intel Firmware size: 400 kB
Nordic nRF LE H4 n.a. Requires custom HCI firmware
NXP 88W88997, IW416, IW61x Dual mode + Wifi H4 Yes nxp Requires initial firmware
Realtek RTL8822CS Dual mode + Wifi H5 Yes Requires initial firmware and config
Realtek USB Dongles Dual mode + Wifi USB Yes realtek Requires initial firmware and config
Renesas RX23W LE H4 n.a. HCI Firmware part of BTTS
STM STLC2500D Classic H4 No (didn't try) stlc2500d Custom deep sleep management not supported
STM32-WB5x LE VHCI n.a. SoC with multi-protocol Radio co-processor
Toshiba TC35661 Dual mode H4 No tc3566
TI CC256x, WL183x Dual mode H4, H5, eHCILL Yes cc256x Also WL185x, WL187x, and WL189x

More infos on supported chipsets

Source Tree Overview

Path Description
chipset Support for individual Bluetooth chipsets
doc Sources for BTstack documentation
example Example applications available for all ports
platform Support for special OSs and/or MCU architectures
port Complete port for a MCU + Chipset combinations
src Bluetooth stack implementation
test Unit and PTS tests
tool Helper tools for BTstack

btstack's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

btstack's Issues

iOS xcode compile error

include <btstack/utils.h> #import <btstack/btstack.h>

are missing and won't compile in Xcode 6.4 hmm,... are they in the btstack folder? or...

please let me know thanks...

Off-topic: BTC Mouse & Trackpad IOS 10+

Hello. I tryed to use BTC mouse on my Ipad air with ios 10 on it, but it seems my bluetooth can't find the mouse.
On ios 9 there where no problems.
Will there be an update for this great app?

IOS 9 update

Hello!
When you will update it to ios9 ?
Thank you so much for your efforts.

ESP32: SDK sdp_init conflict

Hi, have experimenting with esp32 and bumped to issue:

src/classic/sdp_server.c:78: multiple definition ofsdp_init'
/opt/esp/btstack-master/port/esp32/a2dp_source_demo/build/bt/libbt.a(sdp_main.o):/opt/esp/esp-idf/components/bt/bluedroid/stack/sdp/sdp_main.c:82: first defined here

`

Seems like recently sdk was updated and now there are intersection in namespace.

btstack multiple connections, ESP32

Hi,

I wrote a simple application based on 2 btstack provided examples first is spp_streamer_client to connect to other BT devices and the second is spp_counter to accept connections from outside. It works well but every one alone when I establish a connection I can't receive connections and vice versa. Is there an example for such case or clear steps of how to do that?

Regards

SPP User Confirmation Failure

I am having trouble with SPP User Confirmation code
I have been using the most recent version of the BTStack (commit-id:64f92e5791eca3562fa09fa9b77bf55c6c013783).

This code is only appears after first pairing and never appears next times, unless unpair and uninstall the BT from Windows 10.

I could reproduce this issue at Windows 10 and Windows 7 using spp_counter.c example. Once I pair with my BT device, i can get data from serial port well. When I reboot the device and try to open the serial port it try to connect. Somehow Windows 10 does not pop up BT device confirmation request. That's why connection attemption is getting failed. I dont know if this is Windows OS issue or BT stack issue. I didnt have such an issue with other BT devices.

I also tried to completely disable authentication, but the following function doesnt do anything in SPP mode. It generates and try to get confirmation.

sm_set_authentication_requirements(0)

Any idea?

Thanks

Baud rate problem

Hi,

I'm using MSP430F5438A + CC2564B to send ADC data to an android phone.
It's successful but has a slow data rate, less than one data per sec.
I've referred to spp_and_le_counter.c, and set timers to send notifications.
Even though I set the timeout at 1ms, it's useless.

My target data rate is 1.5k per sec. How could I resolve this problem?

This is my demo vedio: https://youtu.be/vOHGzDM1oJg

Thanks!

BTStack Port for ESP32 and HID Keyboard Mode

HID keyboard demo doesn't work out of the box (for me at least on the release branch).

Inspection of the example template file indicates that it is likely this issue still exists on master.

This is what the console looks like:

image

The reason seems to be the following in bt_stack_config.h:
#define MAX_NR_L2CAP_SERVICES 2

But hid_device_init() which is run from main in the demo seems to use more than 2 services. The fact that this is defined also means that malloc is not used even though it is available.

This is low priority and easily fixable but I thought I would bring it to light to save time for others.

a2dp_source_demo compile error!!!

Hi.
I can't compile a2dp_source_demo with ESP-32DevkitC.
error is as follow :

CC a2dp_source_demo.o
/home/str/esp/btstack/port/esp32/a2dp_source_demo/main/./a2dp_source_demo.c:46:20: fatal error: hxcmod.h: No such file or directory
compilation terminated.
/home/str/workspace/esp-idf/make/component_wrapper.mk:210: recipe for target 'a2dp_source_demo.o' failed
make[1]: *** [a2dp_source_demo.o] Error 1
/home/str/workspace/esp-idf/make/project.mk:390: recipe for target 'main-build' failed
make: *** [main-build] Error 2

pls, Help me.
Best regards.

ESP32: Link keys not stored in Flash memory

Hi!

I'm using the ESP32 port of the btstack and I'm running into an issue.

Basically, when I use, for example, the SPP counter program, I can pair it with the computer and exchange data with a Python application running PyBluez.

Nevertheless, if I reset the device, it keeps being identified as paired by Windows but I'm no longer able to connect to it on the application. I can still find the advertised service on my Python program but when I try to connect using a PyBluez Bluetooth socket, it refuses the connection..

The only way I found to solve this is by forgetting the device and repairing it again.

The thing is that this just happens if I reset the ESP32 and the bluetooth program runs from the start. If I leave the ESP32 running the program and I try to connect multiple times from my PC application, it works fine.

I'm just getting started with the BTStack and I don't have a deep understanding of the bluetooth stack and profiles, so maybe I'm doing something wrong.

I'm testing this on Windows 8.1.

Best regards,
Nuno Santos

iOS build error

screen shot 2015-07-13 at 2 45 00 pm

having compiling issues/errors.. what is the work around this?...

Cannot connect to BTDaemon from app on iOS 9.0.2

Hi,mringwal
I am developing an IOS application based on btstack, but it does not seem to work on Ios 9.0.2.
I compile the CocoaTouch sample, it works on ios 8.4 but also not on ios 9.0.2.

default

The bt_open() method just return -1,so is it not compatible with ios 9.0.2 ? Or there are some new changes?

Waiting for your reply, thank you!

readme file or document is not correct

ex. path platforms/stm32-f103rb-nucleo/README.md.
=>cannot find from project with the path above

could povide a detailed document for building a project environment ?

ESP32: problems using BTstack and WiFi

Hi,
I used btstack port for ESP32 example SPP_Counter and It worked well then I added my WiFi application (3 tasks) to it which connects to a server and uploads data, When I ran it WiFi not worked correctly and station got ip event wasn't received and hence can't connect to server and when I connect bluetooth WiFi disconnects and can't connect again.

Now, Can't btstack work with WiFi and causes this strange behaviour?

Regards

ESP32: Compilation errors after btstack update

Hi,

My application was working well until I updated btstack yesterday were it started to complain in compilation about missing defines

C:/Users/pulse/workspace/spp_counter_8/components/Bt_Stack/../../../../../../esp/btstack/src/ble/le_device_db_tlv.c:86:2: error: #error "NVM_NUM_DEVICE_DB_ENTRIES not defined, please define in btstack_config.h"
#error "NVM_NUM_DEVICE_DB_ENTRIES not defined, please define in btstack_config.h"
^
C:/Users/pulse/workspace/spp_counter_8/components/Bt_Stack/../../../../../../esp/btstack/src/ble/le_device_db_tlv.c:90:2: error: #error "NVM_NUM_DEVICE_DB_ENTRIES must not be 0, please update in btstack_config.h"
#error "NVM_NUM_DEVICE_DB_ENTRIES must not be 0, please update in btstack_config.h"
^
C:/Users/pulse/workspace/spp_counter_8/components/Bt_Stack/../../../../../../esp/btstack/src/ble/le_device_db_tlv.c:93:27: error: 'NVM_NUM_DEVICE_DB_ENTRIES' undeclared here (not in a function)
static uint8_t entry_map[NVM_NUM_DEVICE_DB_ENTRIES];
^
C:/Users/pulse/workspace/spp_counter_8/components/Bt_Stack/../../../../../../esp/btstack/src/ble/le_device_db_tlv.c:93:17: warning: 'entry_map' defined but not used [-Wunused-variable]
static uint8_t entry_map[NVM_NUM_DEVICE_DB_ENTRIES];
^
C:/Users/pulse/workspace/spp_counter_8/components/Bt_Stack/../../../../../../esp/btstack/src/ble/le_device_db_tlv.c: In function 'le_device_db_tlv_fetch_mapped':
C:/Users/pulse/workspace/spp_counter_8/components/Bt_Stack/../../../../../../esp/btstack/src/ble/le_device_db_tlv.c:148:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
C:/Users/pulse/workspace/spp_counter_8/components/Bt_Stack/../../../../../../esp/btstack/src/ble/le_device_db_tlv.c: In function 'le_device_db_tlv_store_mapped':
C:/Users/pulse/workspace/spp_counter_8/components/Bt_Stack/../../../../../../esp/btstack/src/ble/le_device_db_tlv.c:156:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
cc1.exe: some warnings being treated as errors
make[1]: *** [/c/esp/esp-idf-v2.1/make/component_wrapper.mk:211: ../../../../../../esp/btstack/src/ble/le_device_db_tlv.o] Error 1
make: *** [C:/esp/esp-idf-v2.1/make/project.mk:386: Bt_Stack-build] Error 2

NRF-5 stack unclear with existing zephyr-hci over uart modules

Hi, we have hardware with nrf51822 with zephyr already deployed. The port/nrf5-zephyr code expects me to flash the nrf chip as part of the process, but the chips are already provisioned.

How Do I compile/run only the host version of the btstack application to connect to my HCI over UART bluetooth chips?

how to accomplish the power up sequence

I try the port/windows-h4 when I want to use chipsets(cc2564) to boot up the bt stack, how to implement the power up sequence mentioned in the spec “Dual-Mode Bluetooth_ CC2564 ModuleEvaluation Board.pdf”

SDP Bug

I'm seeing some weird behavior with sdp services that I am not sure what the issue is. If I register multiple services then do a sdptool browse from another machine I am seeing the same service printed twice rather than two different services. For example:

sdptool browse:
Service RecHandle: 0x10001
Service Class ID List:
"" (0x1800)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 31
"ATT" (0x0007)
uint16: 0x14
uint16: 0x1e

Service RecHandle: 0x10001
Service Class ID List:
"" (0x1800)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 31
"ATT" (0x0007)
uint16: 0x14
uint16: 0x1e

The second thing i registered appears twice but the first registered service is missing.
Can anyone confirm this issue?

BTStack connection issue

Having some trouble connecting to the stack. The pairing process with the phone is ok, but Im not able to do a connect. Is there anything obvious that you can see from this log during the connection process?

HCI_EVENT_READ_REMOTE_SUPPORTED_FEATURES_COMPLETE, bonding flags 6
LOG -- HCI_EVENT_LINK_KEY_REQUEST
LOG -- responding to link key request
LOG -- IO Capability Request received, stack bondable 1, io cap 1
LOG -- gap_mitm_protection_required_for_security_level 0
LOG -- hci_emit_security_level 3 for handle 1
LOG -- l2cap - security level update
LOG -- gap_request_security_level 0, current level 3
LOG -- hci_emit_security_level 3 for handle 1
LOG -- l2cap - security level update
LOG -- l2cap - state 5
LOG -- L2CAP_EVENT_INCOMING_CONNECTION addr BC:F5:AC:71:69:A3 handle 0x1 psm 0x1 local_cid 0x40 remote_cid 0x49
LOG -- L2CAP_ACCEPT_CONNECTION local_cid 0x40
LOG -- l2cap_stop_rtx for local cid 0x40
LOG -- l2cap_start_rtx for local cid 0x40
LOG -- gap_request_security_level 2, current level 3
LOG -- hci_emit_security_level 3 for handle 1
LOG -- l2cap - security level update
LOG -- l2cap - state 5
LOG -- L2CAP_EVENT_INCOMING_CONNECTION addr BC:F5:AC:71:69:A3 handle 0x1 psm 0x3 local_cid 0x41 remote_cid 0x47
LOG -- rfcomm_max_frame_size_for_l2cap_mtu: 1017 -> 1012
LOG -- L2CAP_EVENT_INCOMING_CONNECTION (l2cap_cid 0x41) for PSM_RFCOMM => accept
LOG -- L2CAP_ACCEPT_CONNECTION local_cid 0x41
LOG -- l2cap - state 9
LOG -- l2cap_stop_rtx for local cid 0x41
LOG -- l2cap_start_rtx for local cid 0x41
LOG -- L2CAP signaling handler code 4, state 9
LOG -- l2cap cid 64, hint 0, type 1
LOG -- L2CAP signaling handler code 5, state 9
LOG -- l2cap_stop_rtx for local cid 0x40
LOG -- L2CAP signaling handler code 4, state 9
LOG -- l2cap cid 65, hint 0, type 1
LOG -- L2CAP_EVENT_CHANNEL_OPENED status 0x0 addr BC:F5:AC:71:69:A3 handle 0x1 psm 0x1 local_cid 0x40 remote_cid 0x49 local_mtu 1017, remote_mtu 672, flush_timeout 0
LOG -- L2CAP_EVENT_CREDITS local_cid 0x40 credits 1
LOG -- L2CAP signaling handler code 5, state 9
LOG -- l2cap_stop_rtx for local cid 0x41
LOG -- L2CAP_EVENT_CHANNEL_OPENED status 0x0 addr BC:F5:AC:71:69:A3 handle 0x1 psm 0x3 local_cid 0x41 remote_cid 0x47 local_mtu 1017, remote_mtu 1691, flush_timeout 0
LOG -- L2CAP_EVENT_CHANNEL_OPENED for PSM_RFCOMM, status 0
LOG -- rfcomm_max_frame_size_for_l2cap_mtu: 1017 -> 1012
LOG -- L2CAP_EVENT_CREDITS local_cid 0x41 credits 1
LOG -- Received SABM #0
LOG -- Sending UA #0
LOG -- Multiplexer up and running
LOG -- L2CAP_EVENT_CREDITS local_cid 0x41 credits 1
LOG -- Received UIH Parameter Negotiation Command for #2, credits 7
LOG -- rfcomm_channel_create for service 8006998, channel 1 --- list of channels:
LOG -- -> Inform app
LOG -- RFCOMM_EVENT_INCOMING_CONNECTION addr BC:F5:AC:71:69:A3 channel #1 cid 0x01
LOG -- rfcomm_channel_ready_for_incoming_dlc_setup state var 0002
LOG -- L2CAP_EVENT_CREDITS local_cid 0x40 credits 1
LOG -- L2CAP signaling handler code 6, state 10
LOG -- L2CAP_EVENT_CHANNEL_CLOSED local_cid 0x40
LOG -- l2cap_stop_rtx for local cid 0x40
LOG -- rfcomm_channel_ready_for_incoming_dlc_setup state var 0002
LOG -- gap_request_security_level 0, current level 3
LOG -- hci_emit_security_level 3 for handle 1
LOG -- l2cap - security level update
LOG -- l2cap - state 5
LOG -- L2CAP_EVENT_INCOMING_CONNECTION addr BC:F5:AC:71:69:A3 handle 0x1 psm 0x1 local_cid 0x42 remote_cid 0x48
LOG -- L2CAP_ACCEPT_CONNECTION local_cid 0x42
LOG -- l2cap - state 10
LOG -- rfcomm_channel_ready_for_incoming_dlc_setup state var 0002
LOG -- l2cap_stop_rtx for local cid 0x42
LOG -- l2cap_start_rtx for local cid 0x42
LOG -- L2CAP signaling handler code 4, state 9
LOG -- l2cap cid 66, hint 0, type 1
LOG -- rfcomm_channel_ready_for_incoming_dlc_setup state var 0002
LOG -- L2CAP signaling handler code 5, state 9
LOG -- l2cap_stop_rtx for local cid 0x42
LOG -- L2CAP_EVENT_CHANNEL_OPENED status 0x0 addr BC:F5:AC:71:69:A3 handle 0x1 psm 0x1 local_cid 0x42 remote_cid 0x48 local_mtu 1017, remote_mtu 672, flush_timeout 0
LOG -- L2CAP_EVENT_CREDITS local_cid 0x42 credits 1
LOG -- L2CAP_EVENT_CREDITS local_cid 0x42 credits 1
LOG -- rfcomm_channel_ready_for_incoming_dlc_setup state var 0002
LOG -- L2CAP signaling handler code 6, state 10
LOG -- L2CAP_EVENT_CHANNEL_CLOSED local_cid 0x42
LOG -- l2cap_stop_rtx for local cid 0x42
LOG -- rfcomm_channel_ready_for_incoming_dlc_setup state var 0002
LOG -- Received DISC #0, (ougoing = 0)
LOG -- TODO: no connections established - delete link key prophylactically
LOG -- Sending UA #0
LOG -- Closing down multiplexer
LOG -- L2CAP_EVENT_CREDITS local_cid 0x41 credits 1
LOG -- RFCOMM_EVENT_OPEN_CHANNEL_COMPLETE status 0x70 addr BC:F5:AC:71:69:A3 handle 0x1 channel #1 cid 0x01 mtu 100
LOG -- L2CAP_DISCONNECT local_cid 0x41 reason 0x13
LOG -- L2CAP signaling handler code 6, state 11
LOG -- L2CAP_EVENT_CHANNEL_CLOSED local_cid 0x41
LOG -- L2CAP_EVENT_CHANNEL_CLOSED cid 0x41, mult 0
LOG -- l2cap_stop_rtx for local cid 0x41

le_streamer examples recursive call

I found that the le_streamer.c use ATT_EVENT_CAN_SEND_NOW to trigger another att_server_request_can_send_now_event, this will cause the recursive call, I wonder is that properly?

Multiple central and single peripheral

The manual says:

By default, a Bluetooth device stops sending advertisements when it gets into the Connected state.

How will it change it? And is it possible to connect several central devices to one peripheral (peripheral device with btstack)? Chipset cc2564B.

ESP32: Error with uploading sm_pairing_peripheral.c

Error uploading sm_pairing_peripheral.c through make commands and the following error comes up
/btstack/port/esp32/sm_pairing_peripheral/main/sm_pairing_peripheral.c:55:35: fatal error: sm_pairing_peripheral.h: No such file or directory.

I could not find the file anywhere in the stack btstack also.

SPP data duplication and drop and how to debug it

Hello,

I am trying to send some data to Android App using SPP at high speed, My current data throughput is ~20kb.

But, I am having trouble with duplicated data. I have a counter for each string that is sent at once.
I am seeing some of the data is transferred 3-5 times, some of them are dropped.

rfcomm_send sends data and always returns 0 even though packet is dropped. Is there a way to know if packet successfully transferred or not?

Why a packet is sent multiple times to SPP client? How can I debug this?

I derived my test application from SPP Counter and implemented top of that, Heart beat perioid is 8ms and have the following configuration.

#ifndef __BTSTACK_CONFIG
#define __BTSTACK_CONFIG
#include <stdint.h>
// Port related features
#define HAVE_INIT_SCRIPT
#define HAVE_EMBEDDED_TIME_MS
//#define HAVE_POSIX_TIME
//#define HAVE_MALLOC
// BTstack features that can be enabled

#define ENABLE_BLE
#define ENABLE_CLASSIC

#define ENABLE_LE_PERIPHERAL
#define ENABLE_LE_CENTRAL
//#define ENABLE_LOG_INTO_HCI_DUMP
//#define ENABLE_LOG_DEBUG
#define ENABLE_LOG_ERROR
//#define ENABLE_LOG_INFO
//#define ENABLE_SDP_DES_DUMP
//#define ENABLE_SDP_EXTRA_QUERIES
// #define ENABLE_LE_SECURE_CONNECTIONS

// BTstack configuration. buffers, sizes, ...

// BTstack configuration. buffers, sizes, ...
//#define HCI_INCOMING_PRE_BUFFER_SIZE 6
#define HCI_ACL_PAYLOAD_SIZE 1021
#define MAX_SPP_CONNECTIONS 1
#define MAX_NR_HCI_CONNECTIONS MAX_SPP_CONNECTIONS
#define MAX_NR_GATT_CLIENTS 0
#define MAX_NR_GATT_SUBCLIENTS 0
#define MAX_NR_HFP_CONNECTIONS 0
#define MAX_NR_L2CAP_SERVICES 2
#define MAX_NR_L2CAP_CHANNELS (1+MAX_SPP_CONNECTIONS)
#define MAX_NR_RFCOMM_MULTIPLEXERS MAX_SPP_CONNECTIONS
#define MAX_NR_RFCOMM_SERVICES 1
#define MAX_NR_RFCOMM_CHANNELS MAX_SPP_CONNECTIONS
#define MAX_NR_BNEP_SERVICES 1
#define MAX_NR_BNEP_CHANNELS MAX_SPP_CONNECTIONS
#define MAX_NR_BTSTACK_LINK_KEY_DB_MEMORY_ENTRIES 2
#define MAX_NR_WHITELIST_ENTRIES 1
#define MAX_NR_SM_LOOKUP_ENTRIES 3
#define MAX_NR_SERVICE_RECORD_ITEMS 1

#define MAX_NR_LE_DEVICE_DB_ENTRIES 1

I don't understand.

Hi.
I don't understand in readme.
"In port/esp32, configure the serial port for firmware upload as described in the ESP-IDF setup guides."
Could you explain install method?
Best regards.

Undefined btstack_run_loop_freertos_trigger_from_isr with certain FreeRTOS settings.

When INCLUDE_xEventGroupSetBitFromISR is not defined in the FreeRTOS config the function
"btstack_run_loop_freertros_trigger_from_isr" (btstack_run_loop_freertos.c) is not defined due to a pre-compiler condition. However, this function is being used without such a condition in btstack_uart_block_freertos.c, resulting in a compiler error.

There is not any "force button" on BTStack 1.1-1

I just jnstalled BTStack in order to use controllers for all but when i want to connect a bluetooth device like my apple watch ,i should reboot my jailbroken device(iphone 6s ios 9.3.3).i read that i have to press "force off" button without rebooting my device.but there is not any button https://imgur.com/a/p3znb

Getting BTStack Working on iOS

So I've been trying to connect to a BT 4.0 Classic device over SPP. I've tried a few different approaches and I feel like BTstack is my best option but I'm running into some problems.
I noticed this:
screen shot 2016-05-06 at 1 16 49 pm
What is the reason for using the /usr/lib/libBTstack.dylib path instead of a local path?
I tried using install_name_tool to rewrite the path but was unable to.
I tried to build run your makefile for the iOS port but got this issue:
screen shot 2016-05-06 at 1 29 15 pm

Is there any way to run BTstack with a non-jailbroken device? I'm not looking to upload to the store but I'd like to be able to add the app to non-jailbroken devices

Any help would be greatly appreciated!

Preprocessor - Feature activation -> also use in header files

If BTStack is configured to omit one feature (e.g.: ENABLE_LE_DATA_CHANNELS), there are still all prototypes available in the headers --> other source files compile nice, BUT: undefined reference during linking.

Suggestion:
Disable function headers in header files too, might be easier to find disabled stack parts.

hci free acl slot

The HCI layer query the free slot is valid in every sent action, but in dual-mode, when no free slots classic then make the le can't sent also (if le_acl_packets_total_num available), is it weird?

ESP32: debugging methods for btstack problems

Hi,

I've an application where ESP32 module receives data over uart port and sends it to btstack over FreeRTOS queue as shown in this simple example

`
// a task receives data from FreeRTOS queue and request to send
static void task1 (void *pvParameters)
{
while (1)
{
xEventGroupWaitBits ( bt_classic_event_group, BT_CLASSIC_READY_BIT, pdTRUE, pdFALSE, portMAX_DELAY );

	if ( xQueueReceive( xBt_Queue, &bt_q_rd_msg, portMAX_DELAY ) == pdPASS )
	{
		rfcomm_request_can_send_now_event ( rfcomm_channel_id );
	}
}

}
`

`
static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size)
{
...

switch (packet_type)
{
	case HCI_EVENT_PACKET:
		switch (hci_event_packet_get_type(packet))
		{

			case RFCOMM_EVENT_CAN_SEND_NOW:
				if ( rfcomm_send ( rfcomm_channel_id, (uint8_t*) bt_q_rd_msg.u8Bdy, bt_q_rd_msg.u8Hdr[0] ) == 0 )
				{
					ESP_LOGI("bt_classic_packet_handler", "send success ID%d L%d", rfcomm_channel_id, bt_q_rd_msg.u8Hdr[0]);
				}
				else
				{
					ESP_LOGE("bt_classic_packet_handler", "send err");
				}

				xEventGroupSetBits ( bt_classic_event_group, BT_CLASSIC_READY_BIT );

			break;

			...
		}
		...
	}	
	...
}

}
`

It works fine but for a few seconds until it stop working where btstack stop sending events for rfcomm_request_can_send_now_event call, It seems that btstack stop working but it continues if the bluetooth link dropped and established again and problem occurs again.

My question is about debugging methods for btstack to check why it stops sending events as I can't do anything for such case

make package link error | BTstack for iOS

I've been trying to compile this very promising tool but I'm getting stuck always at:

...
Making stage for tool BTdaemon...
echo /private/var/simlink/btstack/port/ios/_
/private/var/simlink/btstack/port/ios/_
mkdir -p ../.theos/_/usr/local/lib
mkdir -p ../.theos/_/usr/local/bin
ln -s /usr/lib/libBTstack.dylib ../.theos/_/usr/local/lib
ln: failed to create symbolic link `../.theos/_/usr/local/lib/libBTstack.dylib': File exists
make[2]: *** [after-BTdaemon-stage] Error 1
make[1]: *** [BTdaemon.stage.tool.variables] Error 2
make: *** [internal-stage] Error 2

I want to exploit this issue I just opened to to explain all the issues I've encountered, so I would like to know if I'm doing everything in the correct way...

First off, I was having some problems with the IOKit framework, it said it wasn't found:

...
Compiling ../SpringBoardAccess/SpringBoardAccess.c...
 Linking tool BTdaemon...
ld: framework not found IOKIT
clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation)

After some hours of try/fail attempts, I realized the repo's makefile has a slightly different name from apple's framework:

line 52 from /btstack/port/ios/src/makefile says "IOKIT"(caps). After changing it to "IOKit" as it is written in the frameworks dir, it compiled everything until it started to compile "inquiry"... there I got this:

Making all for tool inquiry...
 Linking tool inquiry...
ld: warning: directory not found for option '-L../src/.theos/obj'
ld: library not found for -lBTstack
clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [obj/inquiry.64873355.unsigned] Error 1
make[2]: *** [internal-tool-all_] Error 2
make[1]: *** [inquiry.all.tool.variables] Error 2
make: *** [internal-all] Error 2

I think, maybe it is my version of theos that doesn't know/create ".theos" (I've got to admit, I don't understand this ".theos" directory either, yet...) so after chaning inquiry and other makefiles from '-L../src/.theos/obj' to '-L../src/obj', I was able to compile again...

then I got to the error for which I open this issue...

...
Making stage for tool BTdaemon...
echo /private/var/simlink/btstack/port/ios/_
/private/var/simlink/btstack/port/ios/_
mkdir -p ../.theos/_/usr/local/lib
mkdir -p ../.theos/_/usr/local/bin
ln -s /usr/lib/libBTstack.dylib ../.theos/_/usr/local/lib
ln: failed to create symbolic link `../.theos/_/usr/local/lib/libBTstack.dylib': File exists
make[2]: *** [after-BTdaemon-stage] Error 1
make[1]: *** [BTdaemon.stage.tool.variables] Error 2
make: *** [internal-stage] Error 2

even after I activated message=yes, it says nothing related to such simlink. The problem is that I don't find libBTstack.dylib anywahere apart from __/usr/lib/libBTstack.dylib

some important information:
I'm working on:

  • arm7 device, (ipad 1st gen - iOS 5.1.1)
  • sdk 7.1
  • theos on iOS

I hope I was clear enough, and thank you all for your answers.

ESP32: Scanning stops after some hours

Hi,

I am developing a project using ESP32 with the gap_le_advertisements example that must scan for beacons and print its parameters as MAC address. I was able to run and see the needed informations, but I have to do this continuously and after some hours the scanning stopped. No error message is showed.

Do you guys think that is a problem with the hardware or the firmware?
What is the best way to implement this?

Thanks.

btstack_stdin interface!

Hi.
I received your email as follow.
2
I want to know btstack_stdin interface.
Also I see as follow.
3
Could you explain me about this.
Best regards.

Use UART instead of SPI

I just have a quick question. Is it possible to use the UART instead of the SPI in the Arduino porting?

ESP32: panu_demo not supported

Just did a new setup on my Win7x64 machine and tried to compile the panu_demo examples and got this error message:

...
CC panu_demo.o
D:/GitHub/btstack/port/esp32/panu_demo/main/panu_demo.c:58:21: fatal error: ifaddrs.h: No such file or director
compilation terminated.
make[1]: *** [/home/esp-idf/make/component_wrapper.mk:177: panu_demo.o] Error 1
make: *** [D:/msys32/home/esp-idf/make/project.mk:386: main-build] Error 2

George@George-Office2 MINGW32 /d/GitHub/btstack/port/esp32/panu_demo

I checked out the esp32-freertos branch

Testing BTstack on windows 7 using MSYS

Hi, I've been through the Quick Start guide and I am stuck at the instruction "compile and install libusb".

gcc is complaining about missing headers like termios.h when I try to compile libusb from the platform/libusb folder.

Should I go for the precompiled libs from the libusb project or am I missing something ?

I am ready to draft a how-to for windows users if I can get BTstack working.

Thanks in advance for the reply.

BTStack GPS: Not transmitting (faked) location to applications

I am not sure if this is the right issue tracker for BTStack GPS, so please feel free to tell me where else to post this:

First of all, I just have purchased BTStack GPS, so it is not a licensing issue.

Scenario: My Flight Simulator shall send its GPS position via bluetooth to the iPad 2 WiFi Only (iOS 8.1.2), to be able to use real iPad aviation software for training purposes.
So I set up the Flight Simulator to send NMEA data to a virtual COM port, which in turn is served as Bluetooth service using Franson GpsGate.

On the iPad, BTStack GPS connects just fine via bluetooth to the PC, and retrieves the correct FS GPS position. This position, of course, differs heavily from my real location.

Unfortunately, the iPad only seems to serve location data when switching WiFi on. The WiFi based location is quite accurate, and THIS location is what is presented to all location based applications, not the BTStack received one.

I also tried switching the "Fake 1m accuracy" option on, and restarted the iPad several times. After a reboot, when starting BTStack GPS, it seems to work for the very next application to be opened, but after switching to another application (and then back to the first one), the location again is the WiFi based (real) one.

When disabling WiFi, location services are not available at all on the iPad 2 WiFi Only...

Another app, "Fake GPS", does not have any problems to fake my location for all application - it works fine (but only uses a single static location).

I can't use your project.

Hi.
I can't do hsp_ag_demo and hfp_ag_demo with ESP-32DevkitC.
How to define HAVE_BTSTACK_STDIN?
/*

  • hfp_ag_demo.c
    */

// *****************************************************************************
/* EXAMPLE_START(hfp_ag_demo): HFP Audio Gateway (AG) Demo
*

  • @text This HFP Audio Gateway example demonstrates how to receive
  • an output from a remote HFP Hands-Free (HF) unit, and,
  • if HAVE_BTSTACK_STDIN is defined, how to control the HFP HF.
    */
    // *****************************************************************************

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "btstack.h"
#include "sco_demo_util.h"
#ifdef HAVE_BTSTACK_STDIN
#include "btstack_stdin.h"
#endif
Could you help me.
Best regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.