/* * @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 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 writer(strBuf); this->objectToJson(writer); str = strBuf.GetString(); } void objectToJson(rapidjson::Writer& 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