+ bool opcode_set;
+
+ static cec_command format(cec_logical_address initiator, cec_logical_address destination, cec_opcode opcode)
+ {
+ cec_command command;
+ command.clear();
+ command.initiator = initiator;
+ command.destination = destination;
+ command.opcode = opcode;
+ command.opcode_set = true;
+
+ return command;
+ }
+
+ void push_back(uint8_t data)
+ {
+ if (!opcode_set)
+ {
+ opcode_set = true;
+ opcode = (cec_opcode) data;
+ }
+ else
+ parameters.push_back(data);
+ }