Skip to content

File OTA.h

File List > arduino > libraries > inline > OTA > OTA.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzyński 2023-03-10. */

#pragma once

#include <Arduino.h>

#ifdef __cplusplus

class LibreTinyOTA {
  public: /* lt_ota.h */
    inline lt_ota_type_t getType() { return lt_ota_get_type(); }

    inline bool isValid(uint8_t index) { return lt_ota_is_valid(index); }

    inline bool canRollback() { return lt_ota_can_rollback(); }

    inline uint8_t getCurrentIndex() { return lt_ota_dual_get_current(); }

    inline uint8_t getStoredIndex() { return lt_ota_dual_get_stored(); }

    inline uf2_ota_scheme_t getUF2Scheme() { return lt_ota_get_uf2_scheme(); }

    inline bool switchImage(bool revert = false) { return lt_ota_switch(revert); }
};

extern LibreTinyOTA OTA;

#endif