package com.mogo.cloud.live.socket;

import com.mogo.cloud.live.utils.TelephoneUtil;
import com.zhidao.ptech.shadow.server.protocol.DeviceInfo;

public class SocketRequestUtils {
    public static byte[] buildDeviceData(int c1, int c2) {
        DeviceInfo.CameraStatus c1Status = DeviceInfo.CameraStatus.forNumber(c1);
        DeviceInfo.CameraStatus c2Status = DeviceInfo.CameraStatus.forNumber(c2);
        DeviceInfo.CameraInfo cameraInfo = DeviceInfo.CameraInfo.newBuilder()
                .setC1(c1Status)
                .setC2(c2Status).build();

        DeviceInfo.DeviceInfoData data = DeviceInfo.DeviceInfoData.newBuilder()
                .setCameraInfo(cameraInfo)
                .setSn(TelephoneUtil.getSerialNumber())
                .setTimestamp(System.currentTimeMillis()).build();
        return data.toByteArray();
    }

}
