can_resmgr_init()
Initialize CAN resource manager
Synopisis
#include <hw/libcan.h>
int can_resmgr_init( can_drvr_funcs_t* const drvr_funcs,
const int verbosity );Arguments
- drvr_func
A pointer to a
can_drvr_funcs_tstructure instance containing hardware-specific callback functions. This pointer must remain valid until you call can_resmgr_fini().- verbosity
The slog2 logging verbosity level.
Description
The can_resmgr_init() function initializes the CAN resource manager and specifies hardware-specific callback functions.
Returns
0 on success, or -1 on error (errno is set).
Errors
- EINVAL
Any of
drvr_func,drvr_func->transmit,drvr_func->devctl, ordrvr_func->event_handlerare NULL.- EAGAIN
One of the following occurred:
- The process can't allocate a new kernel channel object.
- The process exceeded its maximum allowed number of channels.
- The number of channels created by the process is greater than the limit specified for RLIMIT_CHANNELS_NP (refer to prlimit() in the C Library Reference of the QNX SDP 8.0 documentation).
- ENOMEM
Insufficient memory to allocate context.
- EPERM
The process tried to create a public channel without having the required permission; refer to procmgr_ability() in the C Library Reference of the QNX SDP 8.0 documentation.
Page updated:
