Esempio n. 1
0
        internal ushort BatchCommand(PayLoadBuilder payLoadBuilder, int index)
        {
            ushort byteLength = 0;

            if (!MonitorEvents || ValueChanged == null)
            {
                return(byteLength);                                        // no need to poll data
            }
            switch (Mode)
            {
            case BatteryMode.All: return(UIReadMethods.GetBatteryValue_BatchCommand(payLoadBuilder, index));

            case BatteryMode.Level:
            {
                DataType type = UIReadMethods.GetBatteryLevel_BatchCommand(payLoadBuilder, index);
                return(type.ByteLength());
            }
            }
            return(byteLength);
        }