Browse Source

update lib/can.*

Signed-off-by: surenyi <surenyi82@163.com>
master
surenyi 5 years ago
parent
commit
9cf4d57b29
  1. 4
      lib/can.c
  2. 7
      lib/can.h

4
lib/can.c

@ -216,12 +216,12 @@ static int __do_send_data(struct canbus *can, int is_extend, int remote, unsigne
#undef RETRY_MAX
}
int can_send_std_data(struct canbus *can, int is_extend, unsigned int id, const void *data, unsigned char len)
int can_send_data(struct canbus *can, int is_extend, unsigned int id, const void *data, unsigned char len)
{
return __do_send_data(can, is_extend, 0, id, data, len);
}
int can_send_std_remote(struct canbus *can, int is_extend, unsigned int id, const void *data, unsigned char len)
int can_send_remote(struct canbus *can, int is_extend, unsigned int id, const void *data, unsigned char len)
{
return __do_send_data(can, is_extend, 1, id, data, len);
}

7
lib/can.h

@ -13,11 +13,12 @@ void can_setup(struct canbus *can, int baudrate);
int can_set_baudrate(struct canbus *can, unsigned int baudrate);
/*
* send standard can frame.
* send can frame.
*
* return > 0 on success.
*/
int can_send_std_data(struct canbus *can, int is_extend, unsigned int id, const void *data, unsigned char len);
int can_send_std_remote(struct canbus *can, int is_extend, unsigned int id, const void *data, unsigned char len);
int can_send_data(struct canbus *can, int is_extend, unsigned int id, const void *data, unsigned char len);
int can_send_remote(struct canbus *can, int is_extend, unsigned int id, const void *data, unsigned char len);
/*
* set receive rx handler

Loading…
Cancel
Save