#ifndef __INTER_TYPES_H__
#define __INTER_TYPES_H__

#include <mqtt_helper.hpp>
#include <inttypes.h>
#include <atomic>

typedef struct ev_region_t {
    float minx;
    float miny;
    float maxx;
    float maxy;
} ev_region_t;
typedef struct ev_module_config_t {
    MqttHelper *pClient;
    struct module{
        struct record{
            int interval; // in seconds
            record(){interval = 120;}
        } record;
        struct ai{
            ev_region_t region;
            bool enabled;
            float face_thresh; //[0,1]
            float human_thresh;
            int image_report_interval; // max in seconds
            ai(){enabled =true, face_thresh = 0.65, human_thresh = 0.65;}
        } ai;
        struct motion{
            ev_region_t region;
            bool enabled;
            int level; // 1 - 6
            recursive_mutex mut;
            //std::atomic<uint64_t> count;
            uint64_t count;
            motion(){enabled = true, level=3, count = 0;}
        } motion;
        struct sys{
            int fps;
            int video_quality;
            int bitrate_kb;
            int bitrate_type;
            int push;
            sys(){fps = 15, video_quality = 5, bitrate_kb = 1024, bitrate_type=1, push=0;}
        } sys;
        module(){}
    } module;
    ev_module_config_t(){
        pClient = nullptr;
    }
} ev_module_config_t;
#endif