CANBUS
view release on metacpan or search on metacpan
int nb ;
nb = write(s, &frame, sizeof(frame));
if (nb != 16) printf("wrote %d bytes not 16\n", nb);
void receive()
INIT:
int nd ;
PPCODE:
// Receive a frame
struct can_frame frame;
nd = read(s, &frame, sizeof(frame));
if (nd != 16) printf("read %d bytes not 16\n", nd);
EXTEND(SP, 2);
PUSHs(sv_2mortal(newSViv(frame.can_id & CAN_SFF_MASK)));
PUSHs(sv_2mortal(newSViv(frame.can_dlc)));
( run in 0.464 second using v1.01-cache-2.11-cpan-92ad3014f07 )