All pastes #749323 Raw Edit

Miscellany

public text v1 · immutable
#749323 ·published 2007-10-25 16:51 UTC
rendered paste body
typedef struct {
  unsigned short int cls;
  unsigned short int opcode;
  unsigned short int param_len;
} CmdHeader;

// Baudrate
typedef struct {
  CmdHeader cmd;
  unsigned int baud;
  unsigned int checksum;
} BaudReq;

  BaudReq req;

  req.cmd.cls = 0x2;

  req.cmd.opcode = BBSETBAUDRATE;

  req.cmd.param_len = 0x4;

  req.baud = speed;

  req.checksum = Checksum((CmdHeader*)&req);


  DEBUGLOG(printf("\nSetting new speed: %d\n",speed));

  SendCmd(fd, &req, sizeof(BaudReq));


Setting new speed: 921600
Sending:
00000000 | 02 00 82 00 04 00 00 00  00 10 0e 00 a4 00 03 00