Skip to content

Install the library

tdslite is header-only: installing it means making its src folder available to your compiler. Pick your build system.

From the Library Manager:

  1. Open Tools → Manage Libraries...
  2. Search for tdslite and click Install.

From a release zip, e.g. for a version that isn't in the Library Manager yet:

  1. Download tdslite-<version>.zip from the releases page.
  2. Open Sketch → Include Library → Add .ZIP Library... and select the file.

Then include the library in your sketch:

#include <tdslite.h>

Add tdslite to lib_deps in platformio.ini:

[env:myboard]
lib_deps =
    mustafakemalgilor/tdslite

or install it from the command line:

pio pkg install --library "mustafakemalgilor/tdslite"

Then include the library:

#include <tdslite.h>

See the registry page for the available versions.

Add the component from the ESP Component Registry:

idf.py add-dependency "tdslite/tdslite"

ESP-IDF 5.0 or newer is required. Include the backend you use:

// plaintext, over lwIP sockets
#include <tdslite-net/socket/tdsl_netimpl_socket.hpp>
// or TLS, over esp-tls
#include <tdslite-net/esp-idf/tdsl_netimpl_esp_tls.hpp>

Get the source, e.g. as a git submodule:

git submodule add https://github.com/tdslite/tdslite.git third_party/tdslite

and add its src folder to your target's include path:

target_include_directories(my_app PRIVATE third_party/tdslite/src)
target_compile_features(my_app PRIVATE cxx_std_11)

Include the backend you use:

#include <tdslite-net/socket/tdsl_netimpl_socket.hpp>

The BSD sockets backend is header-only too. The Boost.ASIO backends (tdslite.net.asio, tdslite.net.asio.tls) are compiled libraries built by tdslite's own CMake project; see the contributing guide for building it.

Check the installation

Compile a program that creates a driver. If it builds, tdslite is installed:

#include <Ethernet.h>
#include <tdslite.h>

tdsl::uint8_t net_buf [512] = {};
tdsl::arduino_driver<EthernetClient> driver{net_buf};

void setup() {}
void loop() {}
#include <tdslite-net/socket/tdsl_netimpl_socket.hpp>

static tdsl::uint8_t net_buf [4096] = {};
static tdsl::socket_driver driver{net_buf};

int main() {}