X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Flocomotive.cpp;h=5fe5ca5f863d07ca489cdea2bae773eb46ba9d8e;hb=02c9a9779954d993cb73fe5f7a72b0847e87f633;hp=2df46a0d7fae67429c6ddea6be63da3e81c9f6eb;hpb=010d8321e982d1684fcbff5bf6fc2bdec7cb7bae;p=r2c2.git diff --git a/source/libmarklin/locomotive.cpp b/source/libmarklin/locomotive.cpp index 2df46a0..5fe5ca5 100644 --- a/source/libmarklin/locomotive.cpp +++ b/source/libmarklin/locomotive.cpp @@ -11,6 +11,7 @@ Distributed under the GPL #include "constants.h" #include "control.h" #include "locomotive.h" +#include "locotype.h" #include "reply.h" using namespace std; @@ -105,6 +106,18 @@ void Locomotive::send_command(bool setf) data[3] |= (1<4) + { + if(!++data[0]) + ++data[1]; + data[2] = 0; + data[3] = 0xA0; + for(unsigned i=0; i<4; ++i) + if((funcs>>i)&32) + data[3] |= (1<