# eiffel **Repository Path**: mirrors_google/eiffel ## Basic Information - **Project Name**: eiffel - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-06-12 - **Last Updated**: 2026-05-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Eiffel - Tempow bluetooth stack + [1. Overview](#1-overview) + [2. Platforms](#2-platforms) - [2.1 Posix](#21-posix) * [2.1.1 Setup](#211-setup) * [2.1.2 PTS](#212-pts) - [2.2 stm32f4](#22-stm32f4) + [3. Annexes](#3-annexes) - [3.1 Wireshark](#31-wireshark) - [3.2 PTS in a VM](#32-pts-in-a-vm) - [3.3 Controller quirks](#33-controller-quirks) ### 1. Overview The `include` directory contains **all** the C header files - `include/eiffel`: public stack headers; bluetooth, config, log & memory - `include/eiffel/platform`: eiffel platform specific definitions - `include/internal`: internal headers The `src` directory contains **all** the C source files - `src/audio`: audio runtime implementations - `src/device`: HCI devices - `src/eiffel`: bluetooth, log & memory source code - `src/platform`: bluetooth platforms, the `.sh` files inside are additional tasks for the `Taskfile` specific to a platform, eg. `posix` defines `run`, `debug`, `snap`, `..` - `src/internal`: internal headers & sources - `src/tool`: sample bluetooth programs or tools or utils using the eiffel platform abstraction - `src/unit`: unit test source files The `docs` directory contains documentation about the project - `adr`: [Markdown Architectural Decision Records](https://github.com/adr/madr) The `target` directory contains everything else - `target/ci`: Continuous Integration related files which use the `Taskfile` - `target/snapshot`: generated snapshot used by the `Taskfile` - `target/toolchain`: all toolchain definitions for the `Taskfile` This project use a `{Make,Task}file` mechanism. The `Makefile` is as simple as possible, use vpath, implicit rules and does not contains any logic apart the relations between sources files and how to compile them to produces binaries. The `Taskfile` contains all the project logic and use the `Makefile` to compile using the following variables: `CC`, `CFLAGS`, `CPPFLAGS`, `LDFLAGS`, `LDLIBS` and `TARGET_ARCH`. #### Requirements ``` apt install bash-builtins pkg-config cmake libusb-1.0-0-dev libbluetooth-dev libsoundio-dev ``` #### Taskfile `Taskfile`: written in bash, contains a certain number of tasks to accomplish almost everything: `clean` `make` `run` `debug` `matrix`, `..`. See `./Taskfile --help` and `./Taskfile --help` for details. ```bash $ ./Taskfile --help eiffel project taskfile usage: ./Taskfile [option..] [argument..] tasks: - all - clean - dump - lint - make - matrix - size - sizetable - tool - with - debug - gensnap - replay - run - snap - unit options: -h, --help show this help message -v, --verbose use verbose output -P, --platform= set the current platform, platforms: - dummy - posix - bk3266 - stm32f4 -T, --toolchain= set the current toolchain, toolchains: - gcc - clang - clang-darwin ``` Here is some simple commands that show the basic usage of the taskfile ```bash # see ./Taskfile run --help for more options # usage: run [option..] [argument..] ./Taskfile run reset ./Taskfile run scan 0 # 0 is an argument of the scan tool ./Taskfile run --audio=libsoundio speaker ./Taskfile debug reset # launch reset with a debugger ``` You can chain actions with the Taskfile, for example here is a command to compile everything (all) + run the unit tests and replay the snapshots across all toolchains, sanitizers and configurations (debug, release, fast, ..) on the default platform (posix), then change the platform to stm32f4 and does the same for all: ```bash ./Taskfile matrix all unit '*' snap -S '*' -- matrix --platform=stm32f4 all ``` This one change the platform to `stm32f4`, clean the output directory and run the `scan` tool in release-fast (`-O3`) + Link Time Optimizations: ```bash ./Taskfile --platform=stm32f4 clean run --release --fast --lto scan ``` This one clean everything ```bash ./Taskfile clean --full ``` Create a `compile_commands.json` for posix: ```bash ./Taskfile with --dryrun clean --full all unit '*' snap --silent '*' ``` Recommended aliases: ```bash alias task="./Taskfile" alias make="task make" ``` #### Makefile `Makefile`: contains by default only two rules: `clean` which remove `CC` outputs & `default` which does nothing at all. ```makefile .PHONY: default clean default: clean: ; $(RM) *.{a,so,o,d,gcno,gcda} ``` When invoked the `Makefile` will match the command goals with `.mk` files present in the `src` directory with a maximum depth of 2. ```makefile targets = $(foreach v,$(MAKECMDGOALS),$(wildcard src/$v.mk src/*/$v.mk)) include $(wildcard *.d) $(targets) vpath % $(foreach v,$(targets),$(dir $v)) ``` ### 2. Platforms #### 2.1 Posix ##### 2.1.1 Setup **UDEV** ```bash sudo sh -c 'echo "SUBSYSTEM==\"usb\", ATTR{bDeviceClass}==\"e0\", ATTR{bDeviceSubClass}==\"01\", ATTR{bDeviceProtocol}==\"01\", GROUP=\"plugdev\"" > /etc/udev/rules.d/50-bluetooth.rules' # debian based sudo adduser ${USER} plugdev # OR arch based sudo gpasswd -a ${USER} plugdev sudo udevadm control --reload-rules udevadm trigger ``` **LINUX DEVICE** ```bash sudo setcap 'cap_net_admin+eip' ``` **libusb** ```bash # aptitude sudo apt install libusb-1.0-0-dev # brew brew install libusb pkg-config llvm # follow instructions brew link llvm # FreeBSD doas pkg install bash gmake pkgconf llvm-90 ``` **Mac OS X** ```bash # you can see loaded classes with sudo kextstat sudo kextunload -b com.apple.iokit.CSRBluetoothHostControllerUSBTransport ``` **FreeBSD devd(8)** ```bash # stop bluetooth on the first controller (ubt0) doas service bluetooth stop ubt0 ``` Edit /etc/devd.conf. Comment the `attach` and `detach` entries for USB Bluetooth (`ubt*`) to prevent the native stack to operate. #### 2.2 stm32f4 ```bash # aptitude sudo apt install gcc-arm-embedded openocd # FreeBSD doas pkg install gcc-arm-embedded openocd export PATH=$PATH:/usr/local/gcc-arm-embedded/bin ``` The `run` and `debug` task can be used like on POSIX, the Taskfile will try to automatically find the corresponding uart debugger by searching if there is a uart debugger on the usb port next to the stlink ### 3. Annexes #### 3.1 Wireshark Usb Monitoring ```bash sudo modprobe usbmon sudo chmod 644 /dev/usbmon* ``` Some expressions: - for export: `!(frame.protocols == "usb") && bluetooth` - only SBC frames: `bthci_acl.reassembled_in || bta2dp.codec == 0x00` - for PTS export `!(bluetooth.src == 00:00:00:00:00:00) && !(bluetooth.dst == 00:00:00:00:00:00) && [protocol]` - for PTS exports, if using two dongles on the same machine, each packet might appear twice (once when sent to the first dongle and once when received by the second one). You can filter out the duplicates with: `!((usb.dst == host && bluetooth.src == 00:1b:dc:08:0b:58) || (usb.src == host && bluetooth.dst == 00:1b:dc:08:0b:58))` ("00:1b:dc:08:0b:58" being the BT address of the PTS dongle). - for test exports, if using two dongle... `!(frame.protocols == "usb") && bluetooth && !(bluetooth.src == 00:1b:dc:08:0b:58 && usb.src == host) && !(bluetooth.dst == 00:1b:dc:08:0b:58 && usb.dst == host)` #### 3.2 Controller quirks ##### Espressif ###### Write Secure Connection Host Support breaks SCO cf. Core Specification 5.2, 4.E.7.3.92 https://specs.tempow.com/core_v5.2#G37.1668600 cf. Similar issue in espressif github https://github.com/espressif/esp-idf/issues/1322 If a Write Secure Connection Host Support command is sent during the `reset` procedure with the support set to `enabled`, the controller will assert later on during initialization of a SCO connection.