Hello,
I am new to Libcanard. I am working on an MCU and was able to make the heartbeat message work properly.
Currently, i am trying to make the service uavcan.node.GetInfo (port id 430) to work.
I tried this command with yakut but i always get a timeout. My node ID = 95. Using the MCU debugger, I can hit correctly the CAN RX reception breakpoint and can see that the PC is sending me a CanardTransferKindRequest
with uavcan_node_GetInfo_1_0_FIXED_PORT_ID_
void processReceivedTransfer(const CanardRxTransfer* const transfer)
{
if (transfer->metadata.transfer_kind == CanardTransferKindMessage)
{
}
else if (transfer->metadata.transfer_kind == CanardTransferKindRequest)
{
if (transfer->metadata.port_id == uavcan_node_GetInfo_1_0_FIXED_PORT_ID_)
{
// The request object is empty so we don't bother de-serializing it. Just send the response.
const uavcan_node_GetInfo_Response_1_0 resp = processRequestNodeGetInfo();
uint8_t serialized[uavcan_node_GetInfo_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_] = {0};
size_t serialized_size = sizeof(serialized);
const int8_t res = uavcan_node_GetInfo_Response_1_0_serialize_(&resp, &serialized[0], &serialized_size);
if (res >= 0)
{
CanardTransferMetadata transfer_metadata = transfer->metadata;
transfer_metadata.transfer_kind = CanardTransferKindResponse;
int32_t result = canardTxPush(&canard_Txqueue,
&canard,
transfer->timestamp_usec + (1000UL*1000UL),
&transfer_metadata,
serialized_size,
serialized);
if (result < 0)
{
// An error has occurred: either an argument is invalid, the TX queue is full, or we've run out of memory.
// It is possible to statically prove that an out-of-memory will never occur for a given application if the
// heap is sized correctly; for background, refer to the Robson's Proof and the documentation for O1Heap.
printf("processReceivedTransfer(): canardTxPush Error %ld \n", result);
}
}
else
{
//assert(false);
}
}
}
}
This is what I see on the candump on Ubuntu PC when i sent this command:
yakut call 95 uavcan.node.getinfo -T3 -Pe
Error: The request has timed out after 3.0 seconds
Also attached yakut monitor screenshot.
Please can you tell me what is wrong by looking at this dump ?
$ candump -td -c -x can0
(000.000000) can0 TX - - 036BAF87 [1] E5
(000.000036) can0 TX - - 107D5507 [8] 00 00 00 00 00 00 29 F2
(000.000947) can0 RX - - 026B83DF [8] 01 00 00 00 08 01 07 A5
(000.000395) can0 RX - - 026B83DF [8] 00 00 00 00 00 00 00 05
(000.000166) can0 RX - - 026B83DF [8] 00 00 00 00 00 00 00 05
(000.002803) can0 RX - - 026B83DF [8] 00 00 14 69 6F 2E 67 25
(000.000032) can0 RX - - 026B83DF [8] 68 6F 73 74 72 6F 62 05
(000.000032) can0 RX - - 026B83DF [8] 6F 74 69 63 73 2E 62 25
(000.000032) can0 RX - - 026B83DF [7] 6D 73 00 00 26 D0 45
(000.000031) can0 RX - - 026B83DF [8] AA BB CC 00 00 00 00 25
(000.998095) can0 TX - - 1C7D5607 [8] 06 00 00 00 01 02 55 AC
(000.000172) can0 TX - - 1C7D5607 [8] 1D 56 1D 04 00 00 00 0C
(000.000033) can0 TX - - 1C7D5607 [8] 01 01 55 1D 40 00 00 2C
(000.000270) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 0C
(000.000031) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 2C
(000.000031) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 0C
(000.000157) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 2C
(000.000031) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 0C
(000.000031) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 2C
(000.000965) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 0C
(000.000145) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 40 00 2C
(000.000032) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 0C
(000.000031) can0 TX - - 1C7D5607 [8] 00 00 40 00 00 00 00 2C
(000.000288) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 0C
(000.000208) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 2C
(000.000224) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 0C
(000.000392) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 2C
(000.000405) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 0C
(000.000254) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 2C
(000.000262) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 03 00 0C
(000.000272) can0 TX - - 1C7D5607 [8] 00 00 00 40 00 00 00 2C
(000.000485) can0 TX - - 1C7D5607 [8] 00 00 00 00 00 00 00 0C
(000.000040) can0 TX - - 1C7D5607 [3] 45 F0 6C
(000.000420) can0 TX - - 107D5507 [8] 01 00 00 00 00 00 29 F3
(000.995131) can0 TX - - 107D5507 [8] 02 00 00 00 00 00 29 F4
(001.000867) can0 TX - - 107D5507 [8] 03 00 00 00 00 00 29 F5