#ifndef ISOTP_LOG_BACKEND_H
#define ISOTP_LOG_BACKEND_H
#include "log.h"

/* ISO-TP Backend Configuration */
#define ISOTP_LOG_BUFFER_MIN_LEVEL LOG_LEVEL_INFO // log level where messages are buffered before streaming mode is enabled
#define ISOTP_LOG_BUFFER_1_BYTES 1024 // Primary buffer, used when streaming is disabled
#define ISOTP_LOG_BUFFER_2_BYTES 256  // Secondary buffer, used for double-buffering during streaming, can be smaller


/* ISO-TP CAN ID configuration */
#ifndef ISOTP_LOG_CAN_ID
#define ISOTP_LOG_CAN_ID 0x123  // CAN ID to use for ISO-TP log messages
#endif

/* ISO-TP backend API */
void isotp_log_backend_init(void);
bool isotp_log_is_backend_registered(void);
const log_backend_t* isotp_log_get_backend(void);
void isotp_log_enable_streaming(log_level_t level);

/* Backend status check function */
bool isotp_log_is_enabled(log_level_t level);

/* Process function - should be called periodically to send buffered messages */
void isotp_log_process(void);

#endif /* ISOTP_LOG_BACKEND_H */