#ifndef PLATFORM_SCALE_PROPERTIES_H
#define PLATFORM_SCALE_PROPERTIES_H
#include "common/json_util.h"

namespace zsy
{
    struct PlatformScaleProperties
    {
        std::string sn;
        std::string name;
        uint8_t delay;
        uint8_t sample;
        uint8_t retries;
        double weight;
        std::string port;
        uint32_t baudRate{9600};
        uint8_t byteSize{8};
        uint8_t parity{0};
        uint8_t stopBits{0};
    };

    inline void from_json(const nlohmann::json &j, PlatformScaleProperties &o)
    {
        PARSE_JSON(sn, o.sn);
        PARSE_JSON(name, o.name);
        PARSE_JSON(delay, o.delay);
        PARSE_JSON(sample, o.sample);
        PARSE_JSON(retries, o.retries);
        PARSE_JSON(weight, o.weight);
        PARSE_JSON(port, o.port);
        PARSE_JSON(baudRate, o.baudRate);
        PARSE_JSON(byteSize, o.byteSize);
        PARSE_JSON(parity, o.parity);
        PARSE_JSON(stopBits, o.stopBits);
    }
}


#endif //PLATFORM_SCALE_PROPERTIES_H
