Пример #1
0
        private BroadlinkDevice CreateBroadlinkDevice(short deviceType)
        {
            BroadlinkDevice device;

            switch (deviceType)
            {
            case 0x2712:                     // RM2
            case 0x2737:                     // RM Mini
            case 0x273d:                     // RM Pro Phicomm
            case 0x2783:                     // RM2 Home Plus
            case 0x277c:                     // RM2 Home Plus GDT
            case 0x272a:                     // RM2 Pro Plus
            case 0x2787:                     // RM2 Pro Plus2
            case 0x278b:                     // RM2 Pro Plus BL
            case 0x278f:                     // RM Mini Shate
                device = new RMDevice();
                break;

            default:
                device = new BroadlinkDevice();
                break;
            }
            device.DeviceType = deviceType;
            return(device);
        }
Пример #2
0
        public static byte[] GenerateReadTemperaturePacket(RMDevice device)
        {
            var payload = new byte[16];

            payload[0x00] = 1;

            var command = (short)0x006a;

            var packet = GenerateCommandPacket(command, payload, device);

            return(packet);
        }