Install
TeslaBLE is a static C++ library. It encodes Tesla vehicle-command messages and runs the BLE handshake. Plug in SimpleBLE, NimBLE, or the Arduino BLE stack for scan and GATT.
Host (CMake)
Section titled “Host (CMake)”Needs CMake 3.20+, a C++17 compiler, and network on first configure (FetchContent pulls nanopb 0.4.9.2, mbedtls 3.6.7, Catch2 for tests).
git clone https://github.com/pmdroid/tesla-vehicle-command.gitcd tesla-vehicle-commandcmake -B build -DTESLA_BLE_BUILD_TESTS=ONcmake --build buildctest --test-dir build --output-on-failurePoint another CMake project at this tree with add_subdirectory and link TeslaBLE. Tests are on when this repo is the top-level CMake project, or when you pass -DTESLA_BLE_BUILD_TESTS=ON.
Headers live in include/. Call them as:
#include <authenticator.h>#include <session.h>#include <carserver.h>#include <security.h>#include <shared.h>#include <ble_frame.h>ESP-IDF / PlatformIO
Section titled “ESP-IDF / PlatformIO”library.json registers the library for PlatformIO on espidf. Add the GitHub URL as a lib dep, or copy include/ and src/ into the firmware tree. On ESP, mbedtls comes from ESP-IDF.
See examples/esp32 (NimBLE, Seeed XIAO ESP32C3).
Arduino
Section titled “Arduino”examples/arduino plus arduino.sh pack a zip the Arduino IDE can import. Arduino-esp32 uses mbedtls 2 through MBEDTLS_VERSION_MAJOR.