/*
 * kl_api.c
 * Top-level orchestration: init and service all K-Line layers.
 */

#include "kl_api.h"
#include "kl_phy.h"
#include "kl_transport.h"
#include "kl_session.h"
#include "kl_app.h"

void KLine_Init(void)
{
    KL_App_Init();
    KL_Transport_Init();
    KL_Session_Init();   /* Calls KL_Phy_Init internally, arms EXTI */
}

void KLine_Service(void)
{
    KL_Phy_Service();
    KL_Transport_Service();
    KL_App_Service();
    KL_Session_Service();
}

uint8_t KLine_GetStatus(void)
{
    return KL_Session_GetStatus();
}
