Add, delete and modify messages.
More...
|
| KvaDbStatus | kvaDbGetFirstMsg (KvaDbHnd dh, KvaDbMessageHnd *mh) |
| |
| KvaDbStatus | kvaDbGetNextMsg (KvaDbHnd dh, KvaDbMessageHnd *mh) |
| |
| KvaDbStatus | kvaDbGetMsgById (KvaDbHnd dh, unsigned int id, KvaDbMessageHnd *mh) |
| |
| KvaDbStatus | kvaDbGetMsgByIdEx (KvaDbHnd dh, unsigned int id, unsigned int flags, KvaDbMessageHnd *mh) |
| |
| KvaDbStatus | kvaDbGetMsgByPGN (KvaDbHnd dh, unsigned int id, KvaDbMessageHnd *mh) |
| |
| KvaDbStatus | kvaDbGetMsgByPGNEx (KvaDbHnd dh, unsigned int id, KvaDbMessageHnd *mh) |
| |
| KvaDbStatus | kvaDbGetMsgByName (KvaDbHnd dh, const char *msg_name, KvaDbMessageHnd *mh) |
| |
| KvaDbStatus | kvaDbGetMsgName (KvaDbMessageHnd mh, char *buf, size_t buflen) |
| |
| KvaDbStatus | kvaDbGetMsgQualifiedName (KvaDbMessageHnd mh, char *buf, size_t buflen) |
| |
| KvaDbStatus | kvaDbGetMsgComment (KvaDbMessageHnd mh, char *buf, size_t buflen) |
| |
| KvaDbStatus | kvaDbGetMsgId (KvaDbMessageHnd mh, unsigned int *id, unsigned int *flags) |
| |
| KvaDbStatus | kvaDbGetMsgIdEx (KvaDbMessageHnd mh, unsigned int *id) |
| |
| KvaDbStatus | kvaDbGetMsgFlags (KvaDbMessageHnd mh, unsigned int *flags) |
| |
| KvaDbStatus | kvaDbGetCanMsgFlags (KvaDbMessageHnd mh, unsigned int *flags) |
| |
| KvaDbStatus | kvaDbGetMsgDlc (KvaDbMessageHnd mh, int *dlc) |
| |
| KvaDbStatus | kvaDbGetMsgSendNode (KvaDbMessageHnd mh, KvaDbNodeHnd *nh) |
| |
| KvaDbStatus | kvaDbAddMsg (KvaDbHnd dh, KvaDbMessageHnd *mh) |
| |
| KvaDbStatus | kvaDbDeleteMsg (KvaDbHnd dh, KvaDbMessageHnd mh) |
| |
| KvaDbStatus | kvaDbSetMsgName (KvaDbMessageHnd mh, char *buf) |
| |
| KvaDbStatus | kvaDbSetMsgComment (KvaDbMessageHnd mh, char *buf) |
| |
| KvaDbStatus | kvaDbSetMsgId (KvaDbMessageHnd mh, unsigned int id, unsigned int flags) |
| |
| KvaDbStatus | kvaDbSetMsgIdEx (KvaDbMessageHnd mh, unsigned int id) |
| |
| KvaDbStatus | kvaDbSetMsgFlags (KvaDbMessageHnd mh, unsigned int flags) |
| |
| KvaDbStatus | kvaDbSetMsgDlc (KvaDbMessageHnd mh, int dlc) |
| |
| KvaDbStatus | kvaDbSetMsgSendNode (KvaDbMessageHnd mh, KvaDbNodeHnd nh) |
| |
| KvaDbStatus | kvaDbGetMsgMux (KvaDbMessageHnd mh, KvaDbSignalHnd *sh) |
| |
| KvaDbStatus | kvaDbMsgDlcToBytes (KvaDbProtocolType prot, unsigned int dlc, unsigned int *numBytes) |
| |
| KvaDbStatus | kvaDbBytesToMsgDlc (KvaDbProtocolType prot, unsigned int numBytes, unsigned int *dlc) |
| |
Add, delete and modify messages.
◆ kvaDbAddMsg()
◆ kvaDbBytesToMsgDlc()
Translates number of bytes to message dlc for a given protocol
- Parameters
-
| [in] | prot | A protocol type |
| [in] | numBytes | Number of bytes |
| [out] | dlc | Raw message dlc |
- Returns
- kvaDbOK (zero) if success
-
kvaDbErr_xxx (negative) if failure
- See also
- kvaDbGetProtocol()
◆ kvaDbDeleteMsg()
◆ kvaDbGetCanMsgFlags()
Get relevant message attributes expressed as CAN message flags, see canMSG_xxx and canFDMSG_xxx
Note that canFDMSG_BRS will never be returned for non-CAN FD frames, even though the CANFD_BRS attribute was set in the .dbc file.
- Parameters
-
| [in] | mh | A message handle |
| [out] | flags | The message flags, canMSG_xxx |
- Returns
- kvaDbOK (zero) if success
-
kvaDbErr_xxx (negative) if failure
◆ kvaDbGetFirstMsg()
◆ kvaDbGetMsgById()
◆ kvaDbGetMsgByIdEx()
Get a handle to a message with a specific identifier. If the requested message has an extended id, KVADB_MESSAGE_EXT should be set on the flags parameter. Bits 31..29 of the id are ignored.
- Parameters
-
| [in] | dh | A database handle |
| [in] | id | The selected message identifier |
| [in] | flags | The flags, KVADB_MESSAGE_xxx |
| [out] | mh | A message handle |
- Returns
- kvaDbOK (zero) if success
-
kvaDbErr_xxx (negative) if failure
- See also
- kvaDbGetMsgByName()
◆ kvaDbGetMsgByName()
◆ kvaDbGetMsgByPGN()
Get a handle to a message with a specific PGN-identifier. If the message is marked as J1939, checks if the PGN-part is equal. The message identifier needs to contain the KVADB_MESSAGE_EXT flag.
- Parameters
-
| [in] | dh | A database handle |
| [in] | id | The selected message identifier |
| [out] | mh | A message handle |
- Returns
- kvaDbOK (zero) if success
-
kvaDbErr_xxx (negative) if failure
- See also
- kvaDbGetMsgByName()
-
kvaDbGetMsgByPGNEx()
◆ kvaDbGetMsgByPGNEx()
Get a handle to a J1939 message using the PGN-identifier within the CAN id. All bits in the id that are not part of the PGN are ignored.
- Parameters
-
| [in] | dh | A database handle |
| [in] | id | The selected message identifier |
| [out] | mh | A message handle |
- Returns
- kvaDbOK (zero) if success
-
kvaDbErr_xxx (negative) if failure
- See also
- kvaDbGetMsgByName()
◆ kvaDbGetMsgComment()
Get the comment for a message as a null-terminated string. A truncated string will be returned if buf is too small and status will be kvaDbOK.
- Parameters
-
| [in] | mh | A message handle |
| [out] | buf | The buffer that will hold the message comment |
| [in] | buflen | The length of the buffer |
- Returns
- kvaDbOK (zero) if success
-
kvaDbErr_xxx (negative) if failure
- See also
- kvaDbSetMsgComment()
- Examples:
- example/c/candb_sample.c.
◆ kvaDbGetMsgDlc()
◆ kvaDbGetMsgFlags()
◆ kvaDbGetMsgId()
◆ kvaDbGetMsgIdEx()
Get the message identifier. The message identifier will not contain any flags.
- Parameters
-
| [in] | mh | A message handle |
| [out] | id | The message identifier |
- Returns
- kvaDbOK (zero) if success
-
kvaDbErr_xxx (negative) if failure
- See also
- kvaDbSetMsgIdEx()
◆ kvaDbGetMsgMux()
Returns handle to a multiplexer signal of a given message. If there are no multiplexer signal, KvaDbOk will be returned and *sh will be NULL.
- Parameters
-
| [in] | mh | A message handle |
| [out] | sh | Multiplexer signal handle |
- Returns
- kvaDbOK (zero) if success
-
kvaDbErr_xxx (negative) if failure
◆ kvaDbGetMsgName()
◆ kvaDbGetMsgQualifiedName()
Get the qualified message name, which is the database name and the message name separated by a dot, as a null-terminated string. An empty string will be returned if buf is too small and status will be kvaDbOK.
- Parameters
-
| [in] | mh | A message handle |
| [out] | buf | The buffer that will hold the qualified message name |
| [in] | buflen | The length of the buffer |
- Returns
- kvaDbOK (zero) if success
-
kvaDbErr_xxx (negative) if failure
- See also
- kvaDbGetMsgName()
- Examples:
- example/c/candb_sample.c.
◆ kvaDbGetMsgSendNode()
◆ kvaDbGetNextMsg()
◆ kvaDbMsgDlcToBytes()
Translates message dlc to number of bytes for a given protocol
- Parameters
-
| [in] | prot | A protocol type |
| [in] | dlc | Raw message dlc |
| [out] | numBytes | Number of bytes |
- Returns
- kvaDbOK (zero) if success
-
kvaDbErr_xxx (negative) if failure
- See also
- kvaDbGetProtocol()
◆ kvaDbSetMsgComment()
◆ kvaDbSetMsgDlc()
◆ kvaDbSetMsgFlags()
◆ kvaDbSetMsgId()
◆ kvaDbSetMsgIdEx()
◆ kvaDbSetMsgName()
Set the message name.
- Parameters
-
| [in] | mh | A message handle |
| [in] | buf | The buffer that contains the message name. |
- Returns
- kvaDbOK (zero) if success
-
kvaDbErr_xxx (negative) if failure
- Note
- Please note that allowed characters in identiers are digits, letters and "_" (underscore).
Identifiers shall also start with a letter or underscore.
- See also
- kvaDbGetMsgName()
- Examples:
- example/c/candb_sample.c, and example/c/j1939_db.c.
◆ kvaDbSetMsgSendNode()