Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sys/can/conn/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#define CONN_CAN_ISOTP_TIMEOUT_TX_CONF_US (1 * US_PER_SEC)
#endif

int conn_can_raw_create(conn_can_raw_t *conn, struct can_filter *filter, size_t count,
int conn_can_raw_create(conn_can_raw_t *conn, const struct can_filter *filter, size_t count,
int ifnum, int flags)
{
assert(conn != NULL);
Expand Down Expand Up @@ -71,7 +71,7 @@ int conn_can_raw_create(conn_can_raw_t *conn, struct can_filter *filter, size_t
return conn_can_raw_set_filter(conn, filter, count);
}

int conn_can_raw_set_filter(conn_can_raw_t *conn, struct can_filter *filter, size_t count)
int conn_can_raw_set_filter(conn_can_raw_t *conn, const struct can_filter *filter, size_t count)
{
assert(conn != NULL);
assert(filter != NULL || count == 0);
Expand Down
3 changes: 3 additions & 0 deletions sys/include/can/conn/isotp.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
extern "C" {
#endif

#include "compiler_hints.h"
#include "can/can.h"
#include "can/isotp.h"
#include "mbox.h"
Expand Down Expand Up @@ -92,7 +93,7 @@
* @param[in] master the master connection
* @param[in,out] slave the slave connection to initialize
*/
static inline void conn_can_isotp_init_slave(conn_can_isotp_t *master, conn_can_isotp_slave_t *slave)

Check warning on line 96 in sys/include/can/conn/isotp.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static inline void conn_can_isotp_init_slave(conn_can_isotp_t *master,
conn_can_isotp_slave_t *slave)

{
slave->next = NULL;
slave->master = master;
Expand Down Expand Up @@ -164,6 +165,7 @@
* @return the number of bytes received
* @return any other negative number in case of an error
*/
ACCESS(write_only, 2, 3)
int conn_can_isotp_recv(conn_can_isotp_t *conn, void *buf, size_t size, uint32_t timeout);

/**
Expand All @@ -178,6 +180,7 @@
* @return the number of bytes sent
* @return any other negative number in case of an error
*/
ACCESS(read_only, 2, 3)
int conn_can_isotp_send(conn_can_isotp_t *conn, const void *buf, size_t size, int flags);

#if defined(MODULE_CONN_CAN_ISOTP_MULTI) || defined(DOXYGEN)
Expand All @@ -190,7 +193,7 @@
*
* @return 0 if OK, < 0 if error
*/
int conn_can_isotp_select(conn_can_isotp_slave_t **conn, conn_can_isotp_t *master, uint32_t timeout);

Check warning on line 196 in sys/include/can/conn/isotp.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int conn_can_isotp_select(conn_can_isotp_slave_t **conn, conn_can_isotp_t *master,
uint32_t timeout);

#endif

#ifdef __cplusplus
Expand Down
7 changes: 5 additions & 2 deletions sys/include/can/conn/raw.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
extern "C" {
#endif

#include "compiler_hints.h"
#include "can/can.h"
#include "can/raw.h"
#include "mbox.h"
Expand Down Expand Up @@ -76,7 +77,8 @@ typedef struct conn_can_raw {
* @return 0 if socket was successfully connected
* @return any other negative number in case of an error
*/
int conn_can_raw_create(conn_can_raw_t *conn, struct can_filter *filter, size_t count,
ACCESS(read_only, 2, 3)
int conn_can_raw_create(conn_can_raw_t *conn, const struct can_filter *filter, size_t count,
int ifnum, int flags);

/**
Expand Down Expand Up @@ -131,7 +133,8 @@ int conn_can_raw_send(conn_can_raw_t *conn, const can_frame_t *frame, int flags)
* @return 0 if can filters were successfully set
* @return any other negative number in case of an error
*/
int conn_can_raw_set_filter(conn_can_raw_t *conn, struct can_filter *filter, size_t count);
ACCESS(read_only, 2, 3)
int conn_can_raw_set_filter(conn_can_raw_t *conn, const struct can_filter *filter, size_t count);

#ifdef __cplusplus
}
Expand Down
10 changes: 6 additions & 4 deletions sys/include/can/isotp.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,30 @@ extern "C" {

#include "can/can.h"
#include "can/common.h"
#include "compiler_hints.h"
#include "net/gnrc/pktbuf.h"
#include "thread.h"
#include "ztimer.h"
#include "net/gnrc/pktbuf.h"

#ifndef CAN_ISOTP_BS
/**
* @brief Default Block Size for RX Flow Control frames
*/
#define CAN_ISOTP_BS (10)
# define CAN_ISOTP_BS (10)
#endif

#ifndef CAN_ISOTP_STMIN
/**
* @brief Default STmin for RX Flow Control frames
*/
#define CAN_ISOTP_STMIN (5)
# define CAN_ISOTP_STMIN (5)
#endif

#ifndef CAN_ISOTP_WFTMAX
/**
* @brief Default maximum WFT for TX Flow Control
*/
#define CAN_ISOTP_WFTMAX (1)
# define CAN_ISOTP_WFTMAX (1)
#endif

/**
Expand Down Expand Up @@ -168,6 +169,7 @@ kernel_pid_t isotp_init(char *stack, int stacksize, char priority, const char *n
* @return the number of bytes sent
* @return < 0 if an error occurred (-EBUSY, -ENOMEM)
*/
ACCESS(read_only, 2, 3)
int isotp_send(struct isotp *isotp, const void *buf, int len, int flags);

/**
Expand Down