package com.rdiot.yx485.device.ble

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable


/**
 * 绑定设备信息
 * @author mR2hao
 * @date 2022/11/25
 */
@Serializable
data class BindInfo(
    @SerialName("user_id")
    var userId: String = "",  // 用户id
    @SerialName("home_id")
    var homeId: String = "", // 家庭id
    @SerialName("room_name")
    var roomName: String = "",// 房间名
    @SerialName("ssid")
    var ssid: String = "", // wifi名
    @SerialName("pwd")
    var pwd: String = "", // wifi密码
    @SerialName("env")//蓝牙调试模式 0生产环境 1测试环境
    var bindMode: Int = 0,
    @SerialName("device_type_id")//设备类型id
    var deviceTypeId: String = "",
) {
    fun toJsonString(): String {
        return "{\"user_id\":\"$userId\"," +
                "\"home_id\":\"$homeId\"," +
                "\"room_name\":\"$roomName\"" +
                ",\"ssid\":\"$ssid\"" +
                ",\"pwd\":\"$pwd\"" +
                ",\"device_type_id\":\"$deviceTypeId\"" +
                ",\"env\":$bindMode}"
    }
}