|
CANpie FD
CAN programming interface environment - Version 3.08
|
This file holds constants and structures used within CANpie FD. All functions, structures, defines and constants in CANpie FD have the prefix "Cp". The following table shows the used nomenclature:
CANpie code | Nomenclature |
Core functions | CpCore<Name> |
Message access functions | CpMsg<Name> |
Structures | Cp<Name>_ts |
Definitions | CP_<NAME> |
Enumerations | eCP_<NAME> |
|
enum | CpErr_e {
eCP_ERR_NONE = 0,
eCP_ERR_GENERIC = 1,
eCP_ERR_HARDWARE = 2,
eCP_ERR_INIT_FAIL = 3,
eCP_ERR_INIT_READY = 4,
eCP_ERR_INIT_MISSING = 5,
eCP_ERR_RCV_EMPTY = 6,
eCP_ERR_RCV_OVERRUN = 7,
eCP_ERR_TRM_FULL = 8,
eCP_ERR_CAN_MESSAGE = 10,
eCP_ERR_CAN_ID = 11,
eCP_ERR_CAN_DLC = 12,
eCP_ERR_FIFO_EMPTY = 20,
eCP_ERR_FIFO_WAIT = 21,
eCP_ERR_FIFO_FULL = 22,
eCP_ERR_FIFO_SIZE = 23,
eCP_ERR_FIFO_PARAM = 24,
eCP_ERR_BUS_PASSIVE = 30,
eCP_ERR_BUS_OFF = 31,
eCP_ERR_BUS_WARNING = 32,
eCP_ERR_CHANNEL = 40,
eCP_ERR_REGISTER = 41,
eCP_ERR_BITRATE = 42,
eCP_ERR_BUFFER = 43,
eCP_ERR_PARAM = 44,
eCP_ERR_NOT_SUPPORTED = 50
} |
|
enum | CpCallback_e {
eCP_CALLBACK_PROCESSED = 0,
eCP_CALLBACK_PUSH_FIFO
} |
|
enum | CpBitrate_e {
eCP_BITRATE_NONE = -1,
eCP_BITRATE_10K = 0,
eCP_BITRATE_20K = 1,
eCP_BITRATE_50K = 2,
eCP_BITRATE_100K = 3,
eCP_BITRATE_125K = 4,
eCP_BITRATE_250K = 5,
eCP_BITRATE_500K = 6,
eCP_BITRATE_800K = 7,
eCP_BITRATE_1M = 8,
eCP_BITRATE_2M = 10,
eCP_BITRATE_4M = 11,
eCP_BITRATE_5M = 12,
eCP_BITRATE_AUTO = 9
} |
|
enum | CpChannel_e {
eCP_CHANNEL_NONE = 0,
eCP_CHANNEL_1,
eCP_CHANNEL_2,
eCP_CHANNEL_3,
eCP_CHANNEL_4,
eCP_CHANNEL_5,
eCP_CHANNEL_6,
eCP_CHANNEL_7,
eCP_CHANNEL_8
} |
|
enum | CpMode_e {
eCP_MODE_INIT = 0
,
eCP_MODE_OPERATION = 1
,
eCP_MODE_LISTEN_ONLY = 2,
eCP_MODE_SLEEP = 3,
eCP_MODE_SELF_TEST = 4
} |
|
enum | CpState_e {
eCP_STATE_INIT = 0
,
eCP_STATE_SLEEPING = 1,
eCP_STATE_BUS_ACTIVE = 2,
eCP_STATE_BUS_WARN = 3,
eCP_STATE_BUS_PASSIVE = 4,
eCP_STATE_BUS_OFF = 5,
eCP_STATE_PHY_FAULT = 10,
eCP_STATE_PHY_H = 11,
eCP_STATE_PHY_L = 12
} |
|
enum | CpErrType_e {
eCP_ERR_TYPE_NONE = 0,
eCP_ERR_TYPE_BIT0,
eCP_ERR_TYPE_BIT1,
eCP_ERR_TYPE_STUFF,
eCP_ERR_TYPE_FORM,
eCP_ERR_TYPE_CRC,
eCP_ERR_TYPE_ACK
} |
|
enum | CpBuffer_e {
eCP_BUFFER_1 = 0,
eCP_BUFFER_2,
eCP_BUFFER_3
,
eCP_BUFFER_16
} |
|
enum | CpBufferDir_e {
eCP_BUFFER_DIR_RCV = 0,
eCP_BUFFER_DIR_TRM
} |
|
enum | CpRpc_e {
eCP_RPC_NOOP = 0,
eCP_RPC_MODE,
eCP_RPC_BITRATE
} |
|
◆ CP_DATA_SIZE
#define CP_DATA_SIZE ((uint8_t) 8) |
The symbol CP_DATA_SIZE defines the maximum number of bytes which are transferred inside the data field of a CAN message. For classic CAN frames the maximum number of bytes is 8, for CAN FD frames the maximum number of bytes is 64.
◆ CpBitrate_e
Fixed bit-rates.
The values of the enumeration CpBitrate_e are used as parameter for the function CpCoreBitrate().
Enumerator |
---|
eCP_BITRATE_NONE | No bit-rate defined
|
eCP_BITRATE_10K | bit-rate 10 kBit/s
|
eCP_BITRATE_20K | bit-rate 20 kBit/s
|
eCP_BITRATE_50K | bit-rate 50 kBit/s
|
eCP_BITRATE_100K | bit-rate 100 kBit/s
|
eCP_BITRATE_125K | bit-rate 125 kBit/s
|
eCP_BITRATE_250K | bit-rate 250 kBit/s
|
eCP_BITRATE_500K | bit-rate 500 kBit/s
|
eCP_BITRATE_800K | bit-rate 800 kBit/s
|
eCP_BITRATE_1M | bit-rate 1 MBit/s
|
eCP_BITRATE_2M | bit-rate 2 MBit/s (ISO CAN FD, data phase)
|
eCP_BITRATE_4M | bit-rate 4 MBit/s (ISO CAN FD, data phase)
|
eCP_BITRATE_5M | bit-rate 5 MBit/s (ISO CAN FD, data phase)
|
eCP_BITRATE_AUTO | Use automatic bit-rate detection
|
◆ CpBuffer_e
Buffer definition.
The enumeration CpBuffer_e is used to define a message buffer inside a FullCAN controller. The index for the first buffer starts at 0.
Enumerator |
---|
eCP_BUFFER_1 | Buffer number 1
|
eCP_BUFFER_2 | Buffer number 2
|
eCP_BUFFER_3 | Buffer number 3 ..
|
eCP_BUFFER_16 | Buffer number 16
|
◆ CpBufferDir_e
Buffer direction definition.
The enumeration CpBufferDir_e is used to define the direction of a message buffer (transmit or receive). The enumeration values are used by the function CpCoreBufferConfig().
Enumerator |
---|
eCP_BUFFER_DIR_RCV | Message buffer direction is receive
|
eCP_BUFFER_DIR_TRM | Message buffer direction is transmit
|
◆ CpCallback_e
Callback Return Codes.
These return values are used by the callback functions that can be installed by the function CpCoreIntFunctions().
Example
uint8_t MyCallback(
CpCanMsg_ts * ptsCanMsgV, uint8_t ubBufferIdxV)
{
{
}
}
Enumerator |
---|
eCP_CALLBACK_PROCESSED | Message was processed by callback and should not inserted in the FIFO
|
eCP_CALLBACK_PUSH_FIFO | Message was not processed by callback and must be inserted in the FIFO
|
◆ CpChannel_e
Channel definition.
The physical CAN interfaces are numbered from 1 .. N (N: total number of physical CAN interfaces on the target system). The enumeration CpChannel_e lists up to 8 physical interfaces. The enumeration value eCP_CHANNEL_NONE denotes an invalid channel value.
Enumerator |
---|
eCP_CHANNEL_NONE | CAN interface invalid
|
eCP_CHANNEL_1 | CAN interface 1
|
eCP_CHANNEL_2 | CAN interface 2
|
eCP_CHANNEL_3 | CAN interface 3
|
eCP_CHANNEL_4 | CAN interface 4
|
eCP_CHANNEL_5 | CAN interface 5
|
eCP_CHANNEL_6 | CAN interface 6
|
eCP_CHANNEL_7 | CAN interface 7
|
eCP_CHANNEL_8 | CAN interface 8
|
◆ CpErr_e
CANpie Error codes.
All functions that may cause an error condition will return an error code. The CANpie error codes are within the value range from 0 to 127. The designer of the core functions might extend the error code table with hardware specific error codes, which must be in the range from 128 to 255.
Enumerator |
---|
eCP_ERR_NONE | No error (00dec / 00hex)
|
eCP_ERR_GENERIC | Error not specified (01dec / 01hex)
|
eCP_ERR_HARDWARE | Hardware failure (02dec / 02hex)
|
eCP_ERR_INIT_FAIL | Initialisation failure (03dec / 03hex)
|
eCP_ERR_INIT_READY | Channel is initialised, ready to run (04dec / 04hex)
|
eCP_ERR_INIT_MISSING | CAN channel was not initialised (05dec / 05hex)
|
eCP_ERR_RCV_EMPTY | Receive buffer is empty (06dec / 06hex)
|
eCP_ERR_RCV_OVERRUN | Receive buffer overrun (07dec / 07hex)
|
eCP_ERR_TRM_FULL | Transmit buffer is full (08dec / 08hex)
|
eCP_ERR_CAN_MESSAGE | CAN message has wrong format (10dec / 0Ahex)
|
eCP_ERR_CAN_ID | CAN identifier not valid (11dec / 0Bhex)
|
eCP_ERR_CAN_DLC | CAN data length code not valid (12dec / 0Chex)
|
eCP_ERR_FIFO_EMPTY | FIFO is empty (20dec / 14hex)
|
eCP_ERR_FIFO_WAIT | Message is waiting in FIFO (21dec / 15hex)
|
eCP_ERR_FIFO_FULL | FIFO is full (22dec / 16hex)
|
eCP_ERR_FIFO_SIZE | FIFO size is out of range (23dec / 17hex)
|
eCP_ERR_FIFO_PARAM | Parameter of FIFO function is out of range (24dec / 18hex)
|
eCP_ERR_BUS_PASSIVE | Controller is in error passive (30dec / 1Ehex)
|
eCP_ERR_BUS_OFF | Controller is in bus off (31dec / 1Fhex)
|
eCP_ERR_BUS_WARNING | Controller is in warning status (32dec / 20hex)
|
eCP_ERR_CHANNEL | Channel out of range (40dec / 28hex)
|
eCP_ERR_REGISTER | Register address out of range (41dec / 29hex)
|
eCP_ERR_BITRATE | bit-rate out of range (42dec / 2Ahex)
|
eCP_ERR_BUFFER | Buffer number out of range (43dec / 2Bhex)
|
eCP_ERR_PARAM | Parameter number out of range (44dec / 2Chex)
|
eCP_ERR_NOT_SUPPORTED | Function is not supported (50dec / 32hex)
|
◆ CpErrType_e
Error type.
These values are used as return value for the function CpCoreCanState().
Enumerator |
---|
eCP_ERR_TYPE_NONE | No error
|
eCP_ERR_TYPE_BIT0 | Bit 0 error
|
eCP_ERR_TYPE_BIT1 | Bit 1 error
|
eCP_ERR_TYPE_STUFF | Stuff error
|
eCP_ERR_TYPE_FORM | Format error
|
eCP_ERR_TYPE_CRC | CRC error
|
eCP_ERR_TYPE_ACK | Acknowledge error
|
◆ CpMode_e
Mode of CAN controller.
These values are used as parameter for the function CpCoreCanMode() in order to change the state of the CAN controller.
Enumerator |
---|
eCP_MODE_INIT | Set controller in 'Initialization' mode (no reception or transmission possible)
|
eCP_MODE_OPERATION | Set controller into 'Operation' mode
|
eCP_MODE_LISTEN_ONLY | Set controller into 'Listen-only' mode
|
eCP_MODE_SLEEP | Set controller into 'Sleep' (power-down) mode
|
eCP_MODE_SELF_TEST | Set controller into 'Self-test' mode
|
◆ CpRpc_e
Remote Procedure Call definition.
The enumeration CpRpc_e is used to define different Remote Procedure Calls. The enumeration values are used by the function CpMsgRpcType() to identify a Remote Procedure Call upon reception.
◆ CpState_e
State of CAN controller.
These values are used as return value for the function CpCoreCanState().
Enumerator |
---|
eCP_STATE_INIT | CAN controller is in stopped mode
|
eCP_STATE_SLEEPING | CAN controller is in Sleep mode
|
eCP_STATE_BUS_ACTIVE | CAN controller is error active
|
eCP_STATE_BUS_WARN | CAN controller is active, warning level is reached
|
eCP_STATE_BUS_PASSIVE | CAN controller is error passive
|
eCP_STATE_BUS_OFF | CAN controller went into Bus Off
|
eCP_STATE_PHY_FAULT | General failure of physical layer detected (if supported by hardware)
|
eCP_STATE_PHY_H | Fault on CAN-H detected (Low Speed CAN)
|
eCP_STATE_PHY_L | Fault on CAN-L detected (Low Speed CAN)
|
friend CpStatus_tv CpCoreStatistic(CpPort_ts *ptsPortV, CpStatistic_ts *ptsStatsV)
Read CAN controller statistics.
friend CpStatus_tv CpCoreFifoRelease(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV)
Release FIFO from message buffer.
@ eCP_ERR_CAN_ID
Definition: canpie.h:522
@ eCP_BITRATE_50K
Definition: canpie.h:656
CpStatus_tv CpCoreBitrate(CpPort_ts *ptsPortV, int32_t slNomBitRateV, int32_t slDatBitRateV)
Set bit-rate of CAN controller.
friend CpStatus_tv CpCoreFifoWrite(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, CpCanMsg_ts *ptsCanMsgV, uint32_t *pulMsgCntV)
Transmit a CAN message.
uint32_t ulTimeStampRes
Definition: canpie.h:1174
Definition: qcan_namespace.hpp:51
CAN_Channel_e channel() const
CAN_State_e state(void) const
Definition: qcan_socket.hpp:177
void CpMsgSetTime(CpCanMsg_ts *ptsCanMsgV, const CpTime_ts *ptsTimeV)
Set time-stamp value.
@ eCP_STATE_BUS_WARN
Definition: canpie.h:826
void socketSelected(QCanSocket *pclSocketV)
@ eCP_BITRATE_125K
Definition: canpie.h:666
void CpFifoIncOut(CpFifo_ts *ptsFifoV)
Definition: qcan_frame.hpp:164
bool read(QCanFrame &clFrameR)
friend CpStatus_tv CpCoreBufferConfig(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint32_t ulIdentifierV, uint32_t ulAcceptMaskV, uint8_t ubFormatV, uint8_t ubDirectionV)
Initialise message buffer.
void CpMsgClrRemote(CpCanMsg_ts *ptsCanMsgV)
Clear RTR bit.
@ eCP_STATE_BUS_ACTIVE
Definition: canpie.h:821
@ eLOG_LEVEL_OFF
Definition: qcan_namespace.hpp:264
static QCanTimeStamp now(void)
CpStatus_tv CpCoreBufferConfig(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint32_t ulIdentifierV, uint32_t ulAcceptMaskV, uint8_t ubFormatV, uint8_t ubDirectionV)
Initialise message buffer.
@ eCP_ERR_FIFO_WAIT
Definition: canpie.h:534
uint8_t ubCanRcvErrCnt
Definition: canpie.h:1259
@ eCAN_CHANNEL_2
Definition: qcan_namespace.hpp:154
int32_t CpMsgRpcGetNominalBitrate(const CpCanMsg_ts *ptsCanMsgV)
Get Nominal Bit Timing selection via RPC.
@ eCP_ERR_NOT_SUPPORTED
Definition: canpie.h:583
@ eCP_ERR_FIFO_EMPTY
Definition: canpie.h:530
@ eFORMAT_FD_EXT
Definition: qcan_frame.hpp:217
uint8_t CpMsgGetData(const CpCanMsg_ts *ptsCanMsgV, uint8_t ubPosV)
Get Data.
QString message(void) const
Definition: qcan_server_logger.hpp:104
CpStatus_tv CpCoreIntFunctions(CpPort_ts *ptsPortV, CpRcvHandler_Fn pfnRcvHandlerV, CpTrmHandler_Fn pfnTrmHandlerV, CpErrHandler_Fn pfnErrHandlerV)
Install callback functions.
@ eCP_ERR_FIFO_PARAM
Definition: canpie.h:546
CpStatus_tv CpCoreFifoRead(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, CpCanMsg_ts *ptsCanMsgV, uint32_t *pulMsgCntV)
Read a CAN message from FIFO.
@ eCP_CALLBACK_PROCESSED
Definition: canpie.h:618
FilterType_te type(void) const
Definition: qcan_filter.hpp:138
bool connectNetwork(const CAN_Channel_e &teChannelR)
@ eCP_MODE_SLEEP
Definition: canpie.h:788
CAN_State_e state(void)
Definition: qcan_network.hpp:397
@ eCP_BITRATE_1M
Definition: canpie.h:686
@ eCP_ERR_CHANNEL
Definition: canpie.h:563
QCanSocketDialog(QWidget *pclParentV, Qt::WindowFlags f)
@ eCAN_CHANNEL_5
Definition: qcan_namespace.hpp:163
@ eCP_CHANNEL_7
Definition: canpie.h:749
@ eCAN_MODE_SLEEP
Definition: qcan_namespace.hpp:204
uint32_t ulSec1970
Definition: canpie.h:984
uint32_t ulMsgUser
Definition: canpie.h:1079
virtual QString name(void)=0
virtual QString version(void)
Definition: qcan_interface.hpp:267
@ eCAN_CHANNEL_8
Definition: qcan_namespace.hpp:172
ConnectionState_e
Definition: qcan_interface.hpp:114
friend CpStatus_tv CpCoreBufferGetDlc(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint8_t *pubDlcV)
Get DLC of specified buffer.
friend CpStatus_tv CpCoreBufferSetData(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint8_t *pubSrcDataV, uint8_t ubStartPosV, uint8_t ubSizeV)
Set data of message buffer.
QUuid uuid(void) const
Definition: qcan_socket.hpp:186
virtual bool configureDevice(void)
Definition: qcan_interface.hpp:139
@ eCP_BITRATE_800K
Definition: canpie.h:681
@ eCAN_BITRATE_AUTO
Definition: qcan_namespace.hpp:130
uint32_t aulLong[CP_DATA_SIZE/4]
Definition: canpie.h:1029
uint32_t ulIdentifier
Definition: canpie.h:1013
@ eCAN_BITRATE_NONE
Definition: qcan_namespace.hpp:65
@ eCP_ERR_NONE
Definition: canpie.h:482
@ eCAN_BITRATE_20K
Definition: qcan_namespace.hpp:75
@ eCAN_STATE_BUS_ACTIVE
Definition: qcan_namespace.hpp:234
FrameType_e
Definition: qcan_frame.hpp:227
@ eCP_ERR_INIT_MISSING
Definition: canpie.h:502
@ eCP_ERR_TYPE_ACK
Definition: canpie.h:884
friend CpStatus_tv CpCoreFifoConfig(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, CpFifo_ts *ptsFifoV)
Assign FIFO to message buffer.
friend CpStatus_tv CpCoreBufferSetDlc(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint8_t ubDlcV)
Set DLC of specified buffer.
uint32_t ulState
Definition: cp_fifo.h:107
uint32_t CpMsgRpcType(const CpCanMsg_ts *ptsCanMsgV)
Identify Remote Procedure Call.
CAN socket.
Definition: qcan_socket.hpp:66
bool operator>(const QCanTimeStamp &clTimeStampR) const
CAN_Bitrate_e
Definition: qcan_namespace.hpp:60
uint32_t ulIndexIn
Definition: cp_fifo.h:93
@ eCP_BUFFER_1
Definition: canpie.h:898
@ eCP_BITRATE_500K
Definition: canpie.h:676
bool removeFilter(const int32_t slPositionR)
bool operator==(const QCanTimeStamp &clTimeStampR) const
@ eCP_ERR_TYPE_STUFF
Definition: canpie.h:875
@ eCAN_MODE_LISTEN_ONLY
Definition: qcan_namespace.hpp:200
QHostAddress serverAddress(void)
Definition: qcan_server.hpp:148
CAN state structure.
Definition: canpie.h:1244
@ eCP_ERR_INIT_READY
Definition: canpie.h:498
@ eERROR_TYPE_FORM
Definition: qcan_frame.hpp:190
@ eCP_BITRATE_NONE
Definition: canpie.h:641
@ eERROR_CRASHED
Definition: qcan_server.hpp:97
QByteArray toByteArray(void) const
@ eCAN_STATE_BUS_PASSIVE
Definition: qcan_namespace.hpp:245
@ eFORMAT_FD_STD
Definition: qcan_frame.hpp:214
@ eCAN_BITRATE_MAX
Definition: qcan_namespace.hpp:135
QAbstractSocket::SocketError error() const
FrameFormat_e
Definition: qcan_frame.hpp:205
CpRpc_e
Remote Procedure Call definition.
Definition: canpie.h:953
@ eCP_ERR_HARDWARE
Definition: canpie.h:490
uint8_t ubMsgDLC
Definition: canpie.h:1043
uint8_t CpMsgRpcGetCanMode(const CpCanMsg_ts *ptsCanMsgV)
Get CAN controller mode via RPC.
void CpMsgSetOverrun(CpCanMsg_ts *ptsCanMsgV)
Set Overrun bit.
int32_t slDatBitRate
Definition: canpie.h:1207
Definition: qcan_filter_list.hpp:62
@ eERROR_ACTIVE
Definition: qcan_server.hpp:100
@ eCP_BITRATE_2M
Definition: canpie.h:691
@ eCP_MODE_SELF_TEST
Definition: canpie.h:792
uint8_t ubDriverFeatures
Definition: canpie.h:1148
uint32_t ulIndexMax
Definition: cp_fifo.h:101
int32_t nominalBitrate(void)
Definition: qcan_network.hpp:150
@ eCP_RPC_NOOP
Definition: canpie.h:956
bool operator>=(const QCanTimeStamp &clTimeStampR) const
CpErr_e
CANpie Error codes.
Definition: canpie.h:477
@ eCP_ERR_CAN_MESSAGE
Definition: canpie.h:518
@ eCP_ERR_RCV_EMPTY
Definition: canpie.h:506
void CpMsgRpcSetCanMode(CpCanMsg_ts *ptsCanMsgV, uint8_t ubModeV)
Set state of CAN controller via RPC.
void disconnectNetwork(void)
@ eERROR_TYPE_CRC
Definition: qcan_frame.hpp:193
@ eCAN_BITRATE_125K
Definition: qcan_namespace.hpp:90
@ eCP_ERR_BUS_OFF
Definition: canpie.h:554
@ eCAN_CHANNEL_1
Definition: qcan_namespace.hpp:151
bool match(const QCanFrame &clFrameR) const
uint8_t ubCanFeatures
Definition: canpie.h:1132
QHostAddress peerAddress() const
CpStatus_tv CpCoreBufferSetData(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint8_t *pubSrcDataV, uint8_t ubStartPosV, uint8_t ubSizeV)
Set data of message buffer.
uint32_t ulNanoSec
Definition: canpie.h:989
CpBufferDir_e
Buffer direction definition.
Definition: canpie.h:933
@ eCP_BITRATE_10K
Definition: canpie.h:646
@ eCP_STATE_PHY_L
Definition: canpie.h:851
@ eLOG_LEVEL_INFO
Definition: qcan_namespace.hpp:279
@ eCP_MODE_LISTEN_ONLY
Definition: canpie.h:784
uint8_t ubReserved[1]
Definition: canpie.h:1169
@ eCP_CHANNEL_2
Definition: canpie.h:734
@ eCAN_MODE_SELF_TEST
Definition: qcan_namespace.hpp:208
int32_t dataBitrate(void)
Definition: qcan_network.hpp:176
CpStatus_tv CpCoreStatistic(CpPort_ts *ptsPortV, CpStatistic_ts *ptsStatsV)
Read CAN controller statistics.
void setChannel(const CAN_Channel_e teChannelV)
CAN frame time-stamp.
Definition: qcan_timestamp.hpp:96
uint32_t seconds(void) const
Definition: qcan_timestamp.hpp:176
CpStatus_tv CpCoreBufferSend(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV)
Send message from message buffer.
CpTime_ts * CpMsgGetTime(CpCanMsg_ts *ptsCanMsgV)
Get time-stamp value.
QCanTimeStamp operator-(const QCanTimeStamp &clTimeStampR) const
Definition: qcan_server.hpp:65
bool operator<=(const QCanTimeStamp &clTimeStampR) const
uint8_t ubCanErrState
Definition: canpie.h:1250
uint32_t ulCanClock
Definition: canpie.h:1179
@ eCAN_STATE_BUS_WARN
Definition: qcan_namespace.hpp:240
QString errorString() const
void CpMsgSetBitrateSwitch(CpCanMsg_ts *ptsCanMsgV)
Set bit-rate switch.
int32_t CpMsgRpcGetDataBitrate(const CpCanMsg_ts *ptsCanMsgV)
Get Data Bit Timing selection via RPC.
@ eERROR_NONE
Definition: qcan_interface.hpp:89
@ eCAN_CHANNEL_4
Definition: qcan_namespace.hpp:160
CpCanMsg_ts * CpFifoDataInPtr(CpFifo_ts *ptsFifoV)
@ eCP_ERR_TYPE_BIT1
Definition: canpie.h:872
CAN_Channel_e
Definition: qcan_namespace.hpp:145
@ eLOG_LEVEL_DEBUG
Definition: qcan_namespace.hpp:282
void setTimeStamp(const QCanTimeStamp &clTimeStampR)
Definition: qcan_frame.hpp:719
ErrorType_e
Definition: qcan_frame.hpp:175
@ eCP_ERR_RCV_OVERRUN
Definition: canpie.h:510
@ eCP_ERR_GENERIC
Definition: canpie.h:486
CAN_State_e
Definition: qcan_namespace.hpp:218
@ eCP_ERR_CAN_DLC
Definition: canpie.h:526
CpStatus_tv CpCoreBufferSetDlc(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint8_t ubDlcV)
Set DLC of specified buffer.
@ eERROR_TYPE_BIT1
Definition: qcan_frame.hpp:184
uint32_t CpMsgGetIdentifier(const CpCanMsg_ts *ptsCanMsgV)
Get Identifier Value.
CAN network representation.
Definition: qcan_network.hpp:90
CpStatus_tv CpCoreBufferGetData(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint8_t *pubDestDataV, uint8_t ubStartPosV, uint8_t ubSizeV)
Get data from message buffer.
CpStatus_tv CpCoreFifoConfig(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, CpFifo_ts *ptsFifoV)
Assign FIFO to message buffer.
@ ConnectedState
Definition: qcan_interface.hpp:123
CpBuffer_e
Buffer definition.
Definition: canpie.h:895
bool_t CpMsgIsFdFrame(const CpCanMsg_ts *ptsCanMsgV)
Check for CAN FD frame.
uint32_t ulBitRateMax
Definition: canpie.h:1193
CpStatus_tv CpCoreBufferRelease(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV)
Release message buffer.
QCanNetwork * network(uint8_t ubNetworkIndexV)
union CpCanMsg_s::@0 tuMsgData
int32_t framesAvailable(void) const
bool_t CpMsgIsBitrateSwitchSet(const CpCanMsg_ts *ptsCanMsgV)
Check for bit-rate.
@ eCAN_BITRATE_2M
Definition: qcan_namespace.hpp:115
QCanServer(QObject *pclParentV=Q_NULLPTR, uint16_t uwPortNumberV=QCAN_WEB_SOCKET_DEFAULT_PORT, uint8_t ubNetworkNumV=QCAN_NETWORK_MAX, bool btClearServerV=false)
@ eERROR_TYPE_BIT0
Definition: qcan_frame.hpp:181
@ eCP_ERR_BUS_PASSIVE
Definition: canpie.h:550
@ eERROR_NONE
Definition: qcan_server.hpp:94
CpStatus_tv CpCoreCanMode(CpPort_ts *ptsPortV, uint8_t ubModeV)
Set state of CAN controller.
bool_t CpFifoIsFull(CpFifo_ts *ptsFifoV)
QCanTimeStamp operator+(const QCanTimeStamp &clTimeStampR) const
void setServerAddress(const QHostAddress clHostAddressV, const uint16_t uwPortV=QCAN_WEB_SOCKET_DEFAULT_PORT)
@ eCP_CHANNEL_6
Definition: canpie.h:746
#define QCAN_NETWORK_MAX
Maximum number of networks.
Definition: qcan_defs.hpp:95
uint32_t CpMsgGetExtId(const CpCanMsg_ts *ptsCanMsgV)
Get 29 Bit Identifier Value.
QCanServerLoggerView(QCanServer *pclServerV=Q_NULLPTR)
uint8_t CpMsgSizeToDlc(uint8_t ubSizeV)
Convert CAN payload size to DLC.
uint8_t ubDriverMajor
Definition: canpie.h:1159
@ eLOG_LEVEL_TRACE
Definition: qcan_namespace.hpp:285
QCanSocket(QObject *pclParentV=Q_NULLPTR)
@ eCAN_BITRATE_1M
Definition: qcan_namespace.hpp:110
void CpMsgSetExtId(CpCanMsg_ts *ptsCanMsgV, uint32_t ulExtIdV)
Set 29 Bit Identifier Value.
uint8_t ubVersionMajor
Definition: canpie.h:1111
@ eCP_ERR_REGISTER
Definition: canpie.h:567
Definition: qcan_server_logger_view.hpp:55
void CpMsgRpcSetBitrate(CpCanMsg_ts *ptsCanMsgV, int32_t slNomBitRateV, int32_t slDatBitRateV)
Set bit-rate of CAN controller via RPC.
@ eCP_BUFFER_DIR_RCV
Definition: canpie.h:937
@ eCP_STATE_SLEEPING
Definition: canpie.h:816
CpStatus_tv CpCoreDriverInit(uint8_t ubPhyIfV, CpPort_ts *ptsPortV, uint8_t ubConfigV)
Initialise the CAN driver.
@ eCP_CHANNEL_NONE
Definition: canpie.h:728
@ eFILTER_ACCEPT
Definition: qcan_filter.hpp:73
Definition: qcan_network_settings.hpp:58
@ eCP_ERR_TYPE_BIT0
Definition: canpie.h:869
uint8_t maximumNetwork(void) const
uint8_t CpMsgGetDlc(const CpCanMsg_ts *ptsCanMsgV)
Get Data Length Code.
@ eCP_CHANNEL_1
Definition: canpie.h:731
uint8_t ubBufferMax
Definition: canpie.h:1154
@ eFORMAT_CAN_EXT
Definition: qcan_frame.hpp:211
QCanTimeStamp timeStamp(void) const
Definition: qcan_frame.hpp:729
void fromMicroSeconds(uint32_t ulMicroSecondsV)
bool filter(const QCanFrame &clFrameR) const
@ eCP_MODE_INIT
Definition: canpie.h:771
QCanTimeStamp & operator-=(const QCanTimeStamp &clTimeStampR)
@ eCP_STATE_INIT
Definition: canpie.h:809
friend CpStatus_tv CpCoreBufferRelease(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV)
Release message buffer.
bool operator!=(const QCanTimeStamp &clTimeStampR) const
LogLevel_e
Definition: qcan_namespace.hpp:261
@ eCAN_BITRATE_5M
Definition: qcan_namespace.hpp:125
virtual uint8_t interfaceCount(void)=0
CpMode_e
Mode of CAN controller.
Definition: canpie.h:766
void CpMsgInit(CpCanMsg_ts *ptsCanMsgV, uint8_t ubFormatV)
Initialise message structure.
@ eCP_CHANNEL_8
Definition: canpie.h:752
@ eCP_ERR_TYPE_NONE
Definition: canpie.h:866
Definition: qcan_frame_list.hpp:57
@ eLOG_LEVEL_WARN
Definition: qcan_namespace.hpp:276
#define CP_DATA_SIZE
Definition: canpie.h:460
@ eCAN_BITRATE_4M
Definition: qcan_namespace.hpp:120
Definition: qcan_server_logger.hpp:60
uint16_t CpMsgGetStdId(const CpCanMsg_ts *ptsCanMsgV)
Get 11 Bit Identifier Value.
bool isFlexibleDataEnabled(void)
Definition: qcan_network.hpp:269
CANpie constants, structures and enumerations
@ eCAN_BITRATE_10K
Definition: qcan_namespace.hpp:70
uint32_t ulTrmMsgCount
Definition: canpie.h:1227
void setHostAddress(const QHostAddress clHostAddressV)
@ eCAN_BITRATE_800K
Definition: qcan_namespace.hpp:105
@ eCP_BITRATE_4M
Definition: canpie.h:696
int32_t slNomBitRate
Definition: canpie.h:1200
@ eCAN_CHANNEL_3
Definition: qcan_namespace.hpp:157
CpCallback_e
Callback Return Codes.
Definition: canpie.h:612
@ eCAN_BITRATE_250K
Definition: qcan_namespace.hpp:95
bool isConnected(void) const
Definition: qcan_socket.hpp:143
friend CpStatus_tv CpCoreBitrate(CpPort_ts *ptsPortV, int32_t slNomBitRateV, int32_t slDatBitRateV)
Set bit-rate of CAN controller.
bool_t CpMsgIsExtended(const CpCanMsg_ts *ptsCanMsgV)
Check for Extended CAN frame.
Administration variables of a CAN message FIFO.
Definition: cp_fifo.h:89
CAN statistic structure.
Definition: canpie.h:1218
uint32_t CpFifoFree(CpFifo_ts *ptsFifoV)
void CpMsgClear(CpCanMsg_ts *ptsCanMsgV)
Clear message structure.
CpStatus_tv CpCoreCanState(CpPort_ts *ptsPortV, CpState_ts *ptsStateV)
Retrieve state of CAN controller.
@ eCAN_BITRATE_100K
Definition: qcan_namespace.hpp:85
@ eCAN_BITRATE_50K
Definition: qcan_namespace.hpp:80
CpCanMsg_ts * CpFifoDataOutPtr(CpFifo_ts *ptsFifoV)
void setNanoSeconds(uint32_t ulNanoSecondsV)
bool_t CpFifoIsEmpty(CpFifo_ts *ptsFifoV)
Hardware description interface.
Definition: canpie.h:1105
friend CpStatus_tv CpCoreBufferGetData(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint8_t *pubDestDataV, uint8_t ubStartPosV, uint8_t ubSizeV)
Get data from message buffer.
@ eCP_CALLBACK_PUSH_FIFO
Definition: canpie.h:623
@ eERROR_FIFO_RCV_EMPTY
Definition: qcan_interface.hpp:103
@ eCP_ERR_TRM_FULL
Definition: canpie.h:514
uint32_t CpFifoPending(CpFifo_ts *ptsFifoV)
void CpMsgClrOverrun(CpCanMsg_ts *ptsCanMsgV)
Clear Overrun bit.
Error_e
Definition: qcan_server.hpp:91
CpStatus_tv CpCoreDriverRelease(CpPort_ts *ptsPortV)
Release the CAN driver.
@ eCAN_CHANNEL_6
Definition: qcan_namespace.hpp:166
Definition: qcan_frame_trace.hpp:57
@ eCAN_MODE_INIT
Definition: qcan_namespace.hpp:187
@ eERROR_USED
Definition: qcan_interface.hpp:100
CAN interface.
Definition: qcan_interface.hpp:58
@ eCP_ERR_TYPE_FORM
Definition: canpie.h:878
@ eCP_ERR_FIFO_FULL
Definition: canpie.h:538
uint8_t ubCanErrType
Definition: canpie.h:1255
friend CpStatus_tv CpCoreFifoRead(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, CpCanMsg_ts *ptsCanMsgV, uint32_t *pulMsgCntV)
Read a CAN message from FIFO.
CpBitrate_e
Fixed bit-rates.
Definition: canpie.h:635
CAN message structure.
Definition: canpie.h:1003
QCanTimeStamp(uint32_t ulSecondsV=0, uint32_t ulNanoSecondsV=0)
void allowBitrateChange(bool btEnabledV=true)
@ eCP_STATE_PHY_H
Definition: canpie.h:846
@ eCP_MODE_OPERATION
Definition: canpie.h:778
void setHostAddress(const QHostAddress clHostAddressV, const uint16_t uwPortV=QCAN_WEB_SOCKET_DEFAULT_PORT)
uint32_t ulRcvMsgCount
Definition: canpie.h:1223
bool_t CpMsgIsRemote(const CpCanMsg_ts *ptsCanMsgV)
Check for remote frame.
@ eCP_BITRATE_100K
Definition: canpie.h:661
bool_t CpMsgIsOverrun(const CpCanMsg_ts *ptsCanMsgV)
Check for message overrun.
bool isNetworkEnabled(void)
Definition: qcan_network.hpp:290
CAN socket dialog.
Definition: qcan_socket_dialog.hpp:86
virtual QIcon icon(void)=0
@ eCP_STATE_PHY_FAULT
Definition: canpie.h:841
@ eCAN_MODE_OPERATION
Definition: qcan_namespace.hpp:194
@ eCP_RPC_MODE
Definition: canpie.h:959
Definition: qcan_filter.hpp:57
@ eLOG_LEVEL_ALL
Definition: qcan_namespace.hpp:288
@ eFILTER_REJECT
Definition: qcan_filter.hpp:76
@ eCAN_STATE_SLEEPING
Definition: qcan_namespace.hpp:228
uint8_t ubDriverMinor
Definition: canpie.h:1164
void fromMilliSeconds(uint32_t ulMilliSecondsV)
QCanTimeStamp & operator+=(const QCanTimeStamp &clTimeStampR)
@ eCP_ERR_PARAM
Definition: canpie.h:579
@ eCAN_STATE_BUS_OFF
Definition: qcan_namespace.hpp:250
CpErrType_e
Error type.
Definition: canpie.h:862
uint32_t frameCountError(void)
Definition: qcan_network.hpp:209
@ eCP_RPC_BITRATE
Definition: canpie.h:962
CpStatus_tv CpCoreFifoWrite(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, CpCanMsg_ts *ptsCanMsgV, uint32_t *pulMsgCntV)
Transmit a CAN message.
void CpMsgSetRemote(CpCanMsg_ts *ptsCanMsgV)
Set RTR bit.
CAN_Mode_e
Definition: qcan_namespace.hpp:183
@ eCP_BITRATE_AUTO
Definition: canpie.h:708
@ eCAN_STATE_STOPPED
Definition: qcan_namespace.hpp:222
CpCanMsg_ts * ptsCanMsg
Definition: cp_fifo.h:112
int32_t appendFilter(const QCanFilter &clFilterR)
@ eLOG_LEVEL_FATAL
Definition: qcan_namespace.hpp:267
@ eCP_BUFFER_3
Definition: canpie.h:904
bool_t CpMsgIsRpc(const CpCanMsg_ts *ptsCanMsgV)
Check for Remote Procedure Call.
void CpFifoInit(CpFifo_ts *ptsFifoV, CpCanMsg_ts *ptsCanMsgV, uint32_t ulSizeV)
@ eCAN_CHANNEL_7
Definition: qcan_namespace.hpp:169
uint32_t nanoSeconds(void) const
Definition: qcan_timestamp.hpp:155
@ eCP_BITRATE_20K
Definition: canpie.h:651
@ eCP_ERR_BUFFER
Definition: canpie.h:575
uint8_t CpMsgDlcToSize(const uint8_t ubDlcV)
Convert DLC to payload size.
QString uuidString(void) const
Definition: qcan_socket.hpp:195
void CpMsgSetDlc(CpCanMsg_ts *ptsCanMsgV, uint8_t ubDlcV)
Set Data Length Code.
#define QCAN_WEB_SOCKET_DEFAULT_PORT
Default port for WebSocket server.
Definition: qcan_defs.hpp:64
#define CP_BUFFER_MAX
Definition: canpie.h:135
@ eCP_BUFFER_2
Definition: canpie.h:901
CpStatus_tv CpCoreHDI(CpPort_ts *ptsPortV, CpHdi_ts *ptsHdiV)
Get hardware description information.
@ eERROR_BITRATE
Definition: qcan_interface.hpp:94
bool operator<(const QCanTimeStamp &clTimeStampR) const
@ eCP_BITRATE_5M
Definition: canpie.h:701
CAN time structure.
Definition: canpie.h:979
bool write(const QCanFrame &clFrameR)
@ eCAN_BITRATE_500K
Definition: qcan_namespace.hpp:100
bool isErrorFrameEnabled(void)
Definition: qcan_network.hpp:258
@ eCP_BUFFER_DIR_TRM
Definition: canpie.h:940
bool isListenOnlyEnabled(void)
Definition: qcan_network.hpp:280
void CpMsgSetIdentifier(CpCanMsg_ts *ptsCanMsgV, uint32_t ulIdentifierV)
Set Identifier Value.
Definition: qcan_server_settings.hpp:81
friend CpStatus_tv CpCoreCanState(CpPort_ts *ptsPortV, CpState_ts *ptsStateV)
Retrieve state of CAN controller.
CpStatus_tv CpCoreFifoRelease(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV)
Release FIFO from message buffer.
CAN plug-in representation.
Definition: qcan_plugin.hpp:57
InterfaceError_e
Definition: qcan_interface.hpp:76
@ eCP_ERR_TYPE_CRC
Definition: canpie.h:881
CpChannel_e
Channel definition.
Definition: canpie.h:724
@ eFRAME_TYPE_DATA
Definition: qcan_frame.hpp:233
void CpFifoIncIn(CpFifo_ts *ptsFifoV)
friend CpStatus_tv CpCoreHDI(CpPort_ts *ptsPortV, CpHdi_ts *ptsHdiV)
Get hardware description information.
uint8_t ubCanTrmErrCnt
Definition: canpie.h:1263
@ ClosingState
Definition: qcan_interface.hpp:126
friend CpStatus_tv CpCoreBufferSend(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV)
Send message from message buffer.
uint16_t auwWord[CP_DATA_SIZE/2]
Definition: canpie.h:1026
@ eCP_ERR_BUS_WARNING
Definition: canpie.h:558
@ eCP_STATE_BUS_OFF
Definition: canpie.h:836
@ eCP_CHANNEL_3
Definition: canpie.h:737
void CpMsgSetStdId(CpCanMsg_ts *ptsCanMsgV, uint16_t uwStdIdV)
Set 11 Bit Identifier Value.
uint8_t aubByte[CP_DATA_SIZE]
Definition: canpie.h:1023
@ eCP_BITRATE_250K
Definition: canpie.h:671
@ eERROR_TYPE_STUFF
Definition: qcan_frame.hpp:187
friend CpStatus_tv CpCoreDriverRelease(CpPort_ts *ptsPortV)
Release the CAN driver.
FilterType_e
Definition: qcan_filter.hpp:68
friend CpStatus_tv CpCoreCanMode(CpPort_ts *ptsPortV, uint8_t ubModeV)
Set state of CAN controller.
@ eCP_ERR_FIFO_SIZE
Definition: canpie.h:542
void CpMsgSetData(CpCanMsg_ts *ptsCanMsgV, uint8_t ubPosV, uint8_t ubValueV)
Set Data.
void setSeconds(const uint32_t ulSecondsV)
@ eCAN_CHANNEL_NONE
Definition: qcan_namespace.hpp:148
uint32_t frameCount(void)
Definition: qcan_network.hpp:199
@ eCP_STATE_BUS_PASSIVE
Definition: canpie.h:831
@ eCP_CHANNEL_5
Definition: canpie.h:743
@ eCP_ERR_BITRATE
Definition: canpie.h:571
uint32_t ulBitRateMin
Definition: canpie.h:1186
@ ConnectingState
Definition: qcan_interface.hpp:120
uint32_t ulIndexOut
Definition: cp_fifo.h:97
virtual QCanInterface * getInterface(uint8_t ubInterfaceV=0)=0
bool acceptFrame(const QCanFrame::FrameFormat_e &teFormatR, const uint32_t ulIdentifierLowV, const uint32_t ulIdentifierHighV)
@ eLOG_LEVEL_ERROR
Definition: qcan_namespace.hpp:270
CpState_e
State of CAN controller.
Definition: canpie.h:804
@ eCP_CHANNEL_4
Definition: canpie.h:740
@ eCP_BUFFER_16
Definition: canpie.h:919
State_e
Definition: qcan_server_settings.hpp:102
CpStatus_tv CpCoreBufferGetDlc(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint8_t *pubDlcV)
Get DLC of specified buffer.
uint8_t ubVersionMinor
Definition: canpie.h:1116
@ eCP_ERR_INIT_FAIL
Definition: canpie.h:494
Definition: qcan_socket_canpie_fd.hpp:55
uint8_t ubMsgCtrl
Definition: canpie.h:1061
friend CpStatus_tv CpCoreDriverInit(uint8_t ubPhyIfV, CpPort_ts *ptsPortV, uint8_t ubConfigV)
Initialise the CAN driver.
uint32_t ulErrMsgCount
Definition: canpie.h:1231