/*
 * @Description: 
 * @Version: 1.0
 * @Autor: lishengyin
 * @Date: 2022-02-21 09:42:16
 * @LastEditors: lishengyin
 * @LastEditTime: 2022-02-28 17:42:08
 */
#ifndef __DEVICEINFO_H_
#define __DEVICEINFO_H_

#include <iostream>

using namespace std;

class DeviceInfo
{
public:
    std::string localIp = "192.168.0.130";
    std::string deviceUserName = "admin";
    std::string devicePassWord = "sunwin2021";
    std::string port = "19000";
    std::string stream = "rtsp://"+ localIp + ":8554/live";
    
public:
    DeviceInfo() {}
    ~DeviceInfo(){}

    void objectToJson(string& str){
        rapidjson::StringBuffer strBuf;
        rapidjson::Writer<rapidjson::StringBuffer> writer(strBuf);
        this->objectToJson(writer);
        str = strBuf.GetString();
    }
    void objectToJson(rapidjson::Writer<rapidjson::StringBuffer>& writer){
        writer.StartObject();
        
        writer.Key("localIp");
        writer.String(localIp.c_str());

        writer.Key("deviceUserName");
        writer.String(deviceUserName.c_str());

        writer.Key("devicePassWord");
        writer.String(devicePassWord.c_str());

        writer.Key("port");
        writer.String(port.c_str());

        writer.Key("stream");
        writer.String(stream.c_str());
        
        writer.EndObject();
    }
};



#endif