Example #1
0
        public static void WriteSerialNumber(ServerInfo info)
        {
            String output = JsonConvert.SerializeObject(info);

            byte[] buf = System.Text.Encoding.Default.GetBytes(output);
            MySerialPort.SendCommand(MT_RPC_CMD_SREQ | MT_RPC_SYS_SYS, MT_SYS_WRITE_SN, buf);
        }
Example #2
0
        public static void WriteSerialNumber(String psw, String url, String svr_ipv4, int svr_udp_port, int svr_tcp_port, int local_port)
        {
            ServerInfo info = new ServerInfo {
                password        = psw,
                server_url      = url,
                server_ipv4     = svr_ipv4,
                server_tcp_port = svr_tcp_port,
                server_udp_port = svr_udp_port,
                local_udp_port  = local_port
            };
            String output = JsonConvert.SerializeObject(info);

            byte[] buf = System.Text.Encoding.Default.GetBytes(output);
            MySerialPort.SendCommand(MT_RPC_CMD_SREQ | MT_RPC_SYS_SYS, MT_SYS_WRITE_SN, buf);
        }
Example #3
0
 public static void ReadSerialNumber(String psw)
 {
     MySerialPort.SendCommand(MT_RPC_CMD_SREQ | MT_RPC_SYS_SYS, MT_SYS_READ_SN, null);
 }
Example #4
0
 public static void ReadDeviceInfo()
 {
     MySerialPort.SendCommand(MT_RPC_CMD_SREQ | MT_RPC_SYS_SYS, MT_SYS_READ_INFO, null);
 }