uint32_t i;
- if (!(sscanf(*param+8, "%u", &controller_id) == 1))
+ if (!(sscanf(param[1], "%u", &controller_id) == 1))
{
rpp_sci_printf("Unable to parse controller ID\n");
return 1;
rpp_can_check_rx_ind(controller_id-1, &rx_ind);
if (rx_ind)
{
- rpp_can_read(controller_id-1, &pdu);
- rpp_sci_printf("Read something\n");
+ if (rpp_can_read(controller_id-1, &pdu) == SUCCESS)
+ {
+ if (pdu.id & CAN_EFF_FLAG)
+ {
+ rpp_sci_printf("can%u %08X [%u] ", controller_id & (~CAN_EFF_FLAG), pdu.id, pdu.dlc);
+ }
+ else
+ {
+ rpp_sci_printf("can%u %03X [%u] ", controller_id, pdu.id, pdu.dlc);
+ }
+
+ for (i=0; i<pdu.dlc; i++)
+ {
+ rpp_sci_printf("%X ", pdu.data[i]);
+ }
+ rpp_sci_printf("\n");
+ }
+ else
+ {
+ rpp_sci_printf("Error rpp_can_read\n");
+ }
}
}