kvDiag.h File Reference
The CANtegrity API is based on high frequency sampling of the CAN bus. This allows it to be used for various purposes, such as calculating the bitrate on the bus and measuring clock speeds of devices on the bus. More...
Go to the source code of this file.
Data Structures | |
| struct | bitrate_t |
| struct | bitrates_t |
| struct | kvDiagSample |
| struct | kvAnalyzerInfo_t |
| struct | kvDiagSample.header |
| struct | kvDiagSample.msg |
| struct | kvDiagSample.sample |
Macros | |
DIAG_ANALYZER_TYPE_xxx | |
| #define | DIAG_ANALYZER_TYPE_DEFAULT 0 |
DIAG_PROGRAM_TYPE | |
Possible programs that can be run on an analyzer. Used with kvDiagSetProgram(). | |
| #define | DIAG_PROGRAM_TYPE_NORMAL 0 |
| #define | DIAG_PROGRAM_TYPE_AUTOBAUD 1 |
Functions | |
| canStatus | kvDiagGetNumberOfAnalyzers (const canHandle canHnd, int *analyzerCount) |
| canStatus | kvDiagGetAnalyzerInfo (const canHandle canHnd, kvAnalyzerInfo_t *info) |
| canStatus | kvDiagAttachAnalyzer (const canHandle canHnd, int type) |
| canStatus | kvDiagDetachAnalyzer (const canHandle canHnd) |
| canStatus | kvDiagSetProgram (const canHandle canHnd, int programType, const char *const configBuffer) |
| canStatus | kvDiagStart (const canHandle canHnd) |
| canStatus | kvDiagStop (const canHandle canHnd) |
| canStatus | kvDiagReadSample (const canHandle canHnd, kvDiagSample *sample) |
| canStatus | kvDiagReadSampleWait (const canHandle canHnd, kvDiagSample *sample, int timeout) |
| canStatus | kvDiagCalculateBitrate (const canHandle canHnd, bitrates_t *btr) |
| canStatus | kvDiagResetBitrateCalculation (const canHandle canHnd) |
| canStatus | kvDiagCalculateClockOffset (const canHandle canHnd, int id, double *fMin, double *fMax, double *fMean, double *fStd, int *n) |
| canStatus | kvDiagResetClockOffsetCalculation (const canHandle canHnd) |
Detailed Description
The CANtegrity API is based on high frequency sampling of the CAN bus. This allows it to be used for various purposes, such as calculating the bitrate on the bus and measuring clock speeds of devices on the bus.
- Note
- Not supported in linux!
- Note
- The CANtegrity API is preliminary and will change!
Data Structure Documentation
bitrate_t
| struct bitrate_t |
Output when using kvDiagCalculateBitrate(), housed in bitrates_t.
| Data Fields | ||
|---|---|---|
| double | bitrate | Bitrate in kBit/s. |
| int | quality | Quality value in % (0..100) |
bitrates_t
| struct bitrates_t |
Output when using kvDiagCalculateBitrate().
- Examples:
- example/c/kvdiag/autobaud.c.
| Data Fields | ||
|---|---|---|
| bitrate_t | bitrate | Bitrate, arbitration bitrate if using FD with BRS. |
| bitrate_t | bitrate_brs | Data bitrate if using FD with BRS. |
kvDiagSample
| struct kvDiagSample |
Output when using kvDiagReadSample() and kvDiagReadSampleWait().
- Examples:
- example/c/kvdiag/normal.c.
| Data Fields | ||
|---|---|---|
| struct kvDiagSample | header | |
| struct kvDiagSample | msg | |
| struct kvDiagSample | sample | |
kvAnalyzerInfo_t
kvDiagSample.header
| struct kvDiagSample.header |
kvDiagSample.msg
| struct kvDiagSample.msg |
| Data Fields | ||
|---|---|---|
| char | data[64] | CAN data. |
| int | dlc | CAN DLC. |
| int | flag | CAN flags, canMSG_STD, canMSG_EXT, canMSG_RTR. |
| int | id | CAN id. |
| int64_t | time | CPU ticks since device boot. |
kvDiagSample.sample
| struct kvDiagSample.sample |
Macro Definition Documentation
DIAG_ANALYZER_TYPE_DEFAULT
| #define DIAG_ANALYZER_TYPE_DEFAULT 0 |
Default.
- Examples:
- example/c/kvdiag/autobaud.c, and example/c/kvdiag/normal.c.
DIAG_PROGRAM_TYPE_AUTOBAUD
| #define DIAG_PROGRAM_TYPE_AUTOBAUD 1 |
- Examples:
- example/c/kvdiag/autobaud.c.
DIAG_PROGRAM_TYPE_NORMAL
| #define DIAG_PROGRAM_TYPE_NORMAL 0 |
- Examples:
- example/c/kvdiag/normal.c.