#include "hmcfgusb.h"
uint32_t hmid = 0;
+uint32_t my_hmid = 0;
enum message_type {
MESSAGE_TYPE_E,
break;
case 'H':
rdata->hmcfgusb_version = (buf[11] << 8) | buf[12];
+ my_hmid = (buf[0x1b] << 16) | (buf[0x1c] << 8) | buf[0x1d];
break;
default:
break;
out[MSGID] = msgid++;
out[CTL] = 0x00;
out[TYPE] = 0xCB;
- SET_SRC(out, 0x000000);
+ SET_SRC(out, my_hmid);
SET_DST(out, hmid);
memcpy(&out[PAYLOAD], switch_msg, sizeof(switch_msg));
out[MSGID] = msgid++;
out[CTL] = 0x20;
out[TYPE] = 0xCB;
- SET_SRC(out, 0x000000);
+ SET_SRC(out, my_hmid);
SET_DST(out, hmid);
memcpy(&out[PAYLOAD], switch_msg, sizeof(switch_msg));
if (ack)
out[CTL] = 0x20;
out[TYPE] = 0xCA;
- SET_SRC(out, 0x000000);
+ SET_SRC(out, my_hmid);
SET_DST(out, hmid);
memcpy(&out[PAYLOAD], pos, payloadlen);