#ifndef HART_SERIAL_H
#define HART_SERIAL_H

#include "../common.h"

//=========================== typedef =========================================

typedef void (*hart_serial_request_cbt)(uint16_t cmdId, uint8_t* payload, uint8_t len);

//=========================== prototypes ======================================

void hart_serial_init(uint8_t* macAddr, uint8_t pollingAddr, hart_serial_request_cbt requestCb);

// response format: RC|Data data
void hart_serial_txHartFrame(uint16_t cmd, uint8_t* response, uint8_t response_len);
void hart_serial_errorReply(uint8_t cmdId, uint8_t errCode);

#endif
