Esempio n. 1
0
 /// <summary>
 /// 卧室IR
 /// </summary>
 /// <param name="data"></param>
 public void SendBedRoomIR(int port, int index)
 {
     //irsend,1,39000,1,0,66,22,67,11,88,33\x0D
     //irdb,1,10\x0D
     byte[] sendBytes = Encoding.GetEncoding(28591).GetBytes("irdb," + port + "," + index);
     byte[] send      = new byte[sendBytes.Length + 1];
     Buffer.BlockCopy(sendBytes, 0, send, 0, sendBytes.Length);
     send[send.Length - 1] = 0x0D;
     // ILiveDebug.Instance.WriteLine("GY:" + ILiveUtil.ToHexString(send));
     UDPAPI.SendData(host4, 9001, send);
 }
Esempio n. 2
0
        public string GetTianQi()
        {
            string url = string.Format("weather.yahooapis.com/forecastrss?w={0}&u=c", 2132582);
            // url = "http://www.baidu.com";
            HttpClient client = new HttpClient();

            UDPAPI.SendData("Start");
            string ret = client.Get(url);

            UDPAPI.SendData("END");
            return(ret);
        }
Esempio n. 3
0
 public void StudyRoomComputerOpen()
 {
     byte[] data = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17,
                     0xB8, 0x97, 0x5A, 0xD3, 0x9B, 0x17 };
     UDPAPI.SendData("192.168.1.255", 30000, data);
 }
Esempio n. 4
0
 /// <summary>
 /// 卧室投影仪
 /// </summary>
 /// <param name="data"></param>
 public void SendBedRoomPort1(byte[] data)
 {
     UDPAPI.SendData(host4, 8001, data);
 }
Esempio n. 5
0
 /// <summary>
 /// 卧室窗帘
 /// </summary>
 /// <param name="data"></param>
 public void SendPort6(byte[] data)
 {
     UDPAPI.SendData(host2, 8006, data);
 }
Esempio n. 6
0
 public void StudyRoomComputerClose()
 {
     byte[] data = Encoding.GetEncoding(28591).GetBytes("CMD|PowerOff");
     UDPAPI.SendData("192.168.1.42", 5700, data);
 }