canbus: send 8 bytes in the id response

The last byte contains the "node id" command, which is used to
identify the application.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-04-25 15:49:35 -04:00 committed by KevinOConnor
parent 3505f4cae5
commit 81ff8e125c
1 changed files with 2 additions and 1 deletions

View File

@ -127,9 +127,10 @@ can_process_query_unassigned(uint32_t id, uint32_t len, uint8_t *data)
uint8_t send[8];
send[0] = CANBUS_RESP_NEED_NODEID;
memcpy(&send[1], canbus_uuid, sizeof(canbus_uuid));
send[7] = CANBUS_CMD_SET_NODEID;
// Send with retry
for (;;) {
int ret = canbus_send(CANBUS_ID_ADMIN_RESP, 7, send);
int ret = canbus_send(CANBUS_ID_ADMIN_RESP, 8, send);
if (ret >= 0)
return;
}