#include <stdint.h>
#include <time.h>
#define DEVICE_CONFIG_PATH "/app/config/device_config.json"

#define HEARTBEAT_INTERVAL 500
#define HEARTBEAT_ADDRESS  (0xA84)

typedef struct device_t
{
    char     dev_no[32];
    int      no;
    uint16_t count;
} device_t;

typedef struct heartbeat_t
{
    int       device_count;
    device_t* device;
    time_t    config_time;
    time_t    last_time;
} heartbeat_t;

extern heartbeat_t heartbeat_list;

void check_and_read_file(void);
int write_devs_heartBeat(heartbeat_t* hb_list);
