3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
9 #include <msp/strings/formatter.h>
17 Command::Command(Cmd c, const unsigned char *d, unsigned l):
25 memcpy(data+1, d, min(l, 127U));
30 void Command::send(int fd)
36 ostream &operator<<(ostream &out, const Command &cmd)
39 for(unsigned i=1; i<cmd.len; ++i)
40 out<<format(" %02X", static_cast<int>(cmd.data[i]));
45 } // namespace Marklin