示例#1
0
        protected ArduinoCommand AddRawCommand(String commandAlias, RawCommand rcmd)
        {
            ArduinoCommand command = AddCommand(commandAlias, ArduinoCommand.CommandType.SEND);

            command.AddArgument((int)rcmd);               //which raw command do we want to send
            command.AddArgument(0);                       //this is normally the 'bits' field so it isn't used
            command.AddArgument((int)IRProtocol.UNKNOWN); //this is how the board-side identifies it as
            return(command);
        }
示例#2
0
        protected override ArduinoCommand CreateCommand(string deviceName, DBRow row)
        {
            var command = new ArduinoCommand((String)row["command_alias"]);

            command.Type = ArduinoCommand.CommandType.SEND;
            switch (Encoding)
            {
            case IREncoding.HEX:
                command.AddArgument(Convert.ToInt64((String)row["command"], 16));
                break;

            case IREncoding.LONG:
                command.AddArgument(Convert.ToInt64((String)row["command"]));
                break;
            }
            command.AddArgument(Convert.ToUInt16(row["bits"]));
            command.AddArgument(Convert.ToInt16(row["protocol"]));
            return(command);
        }