Messages

Add, delete and modify messages. More...

Functions

KvaDbStatus kvaDbGetFirstMsg (KvaDbHnd dh, KvaDbMessageHnd *mh)
 
KvaDbStatus kvaDbGetNextMsg (KvaDbHnd dh, KvaDbMessageHnd *mh)
 
KvaDbStatus kvaDbGetMsgById (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 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 kvaDbSetMsgDlc (KvaDbMessageHnd mh, int dlc)
 
KvaDbStatus kvaDbSetMsgSendNode (KvaDbMessageHnd mh, KvaDbNodeHnd nh)
 
KvaDbStatus kvaDbGetMsgMux (KvaDbMessageHnd mh, KvaDbSignalHnd *shh)
 
KvaDbStatus kvaDbMsgDlcToBytes (KvaDbProtocolType prot, unsigned int dlc, unsigned int *numBytes)
 
KvaDbStatus kvaDbBytesToMsgDlc (KvaDbProtocolType prot, unsigned int numBytes, unsigned int *dlc)
 

Detailed Description

Add, delete and modify messages.

Function Documentation

◆ kvaDbAddMsg()

KvaDbStatus kvaDbAddMsg ( KvaDbHnd  dh,
KvaDbMessageHnd mh 
)

Add a new message to a database.

Parameters
[in]dhA database handle
[out]mhA handle to the new message
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbDeleteMsg()
Examples:
candb_sample.c.

◆ kvaDbBytesToMsgDlc()

KvaDbStatus kvaDbBytesToMsgDlc ( KvaDbProtocolType  prot,
unsigned int  numBytes,
unsigned int *  dlc 
)

Translates number of bytes to message dlc for a given protocol

Parameters
[in]protA protocol type
[in]numBytesNumber of bytes
[out]dlcRaw message dlc corresponding to number of bytes
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbGetProtocol()

◆ kvaDbDeleteMsg()

KvaDbStatus kvaDbDeleteMsg ( KvaDbHnd  dh,
KvaDbMessageHnd  mh 
)

Delete a message from a database.

Parameters
[in]dhA database handle
[in]mhA handle to the message that will be deleted
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbAddMsg()
Examples:
candb_sample.c.

◆ kvaDbGetFirstMsg()

KvaDbStatus kvaDbGetFirstMsg ( KvaDbHnd  dh,
KvaDbMessageHnd mh 
)

Get the first message in a database.

Parameters
[in]dhA handle to a database
[out]mhA handle to the first message
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbGetNextMsg()
Examples:
candb_sample.c.

◆ kvaDbGetMsgById()

KvaDbStatus kvaDbGetMsgById ( KvaDbHnd  dh,
unsigned int  id,
KvaDbMessageHnd mh 
)

Get a handle to a message with a specific identifier.

Parameters
[in]dhA database handle
[in]idThe selected message identifier
[out]mhA message handle
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbGetMsgByName()
Examples:
candb_sample.c.

◆ kvaDbGetMsgByName()

KvaDbStatus kvaDbGetMsgByName ( KvaDbHnd  dh,
const char *  msg_name,
KvaDbMessageHnd mh 
)

Get a handle to a message with a specific name.

Parameters
[in]dhA databse handle
[in]msg_nameThe message name to search for
[out]mhA message handle
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbGetMsgById()
Examples:
candb_sample.c.

◆ kvaDbGetMsgComment()

KvaDbStatus kvaDbGetMsgComment ( KvaDbMessageHnd  mh,
char *  buf,
size_t  buflen 
)

Get the message comment.

Parameters
[in]mhA message handle
[out]bufThe buffer that will hold the message comment
[in]buflenThe length of the buffer
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbSetMsgComment()
Examples:
candb_sample.c.

◆ kvaDbGetMsgDlc()

KvaDbStatus kvaDbGetMsgDlc ( KvaDbMessageHnd  mh,
int *  dlc 
)

Get the data length code for a message.

Parameters
[in]mhA message handle
[out]dlcThe data length code
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbSetMsgDlc()
Examples:
candb_sample.c.

◆ kvaDbGetMsgId()

KvaDbStatus kvaDbGetMsgId ( KvaDbMessageHnd  mh,
unsigned int *  id,
unsigned int *  flags 
)

Get message identifier and flags.

Parameters
[in]mhA message handle.
[out]idThe identifier.
[out]flagsThe flags, KVADB_MESSAGE_xxx
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbSetMsgId()
Examples:
candb_sample.c.

◆ kvaDbGetMsgMux()

KvaDbStatus kvaDbGetMsgMux ( KvaDbMessageHnd  mh,
KvaDbSignalHnd shh 
)

Returns handle to a multiplexer signal of a given message

Parameters
[in]mhA message handle
[out]shhMultiplexer signal handle
Returns
kvaDbOK (zero if success
kvaDbErr_xxx (negative) if failure

◆ kvaDbGetMsgName()

KvaDbStatus kvaDbGetMsgName ( KvaDbMessageHnd  mh,
char *  buf,
size_t  buflen 
)

Get the message name.

Parameters
[in]mhA message handle
[out]bufThe buffer that will hold the message name
[in]buflenThe length of the buffer.
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbSetMsgName(), kvaDbGetMsgQualifiedName()
Examples:
candb_sample.c.

◆ kvaDbGetMsgQualifiedName()

KvaDbStatus kvaDbGetMsgQualifiedName ( KvaDbMessageHnd  mh,
char *  buf,
size_t  buflen 
)

Get the qualified message name, which is the database name and the message name separated by a dot.

Parameters
[in]mhA message handle
[out]bufThe buffer that will hold the qualified message name
[in]buflenThe length of the buffer
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbGetMsgName()
Examples:
candb_sample.c.

◆ kvaDbGetMsgSendNode()

KvaDbStatus kvaDbGetMsgSendNode ( KvaDbMessageHnd  mh,
KvaDbNodeHnd nh 
)

Get send node for a message

Parameters
[in]mhA message handle
[out]nhA node handle
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbSetMsgSendNode()

◆ kvaDbGetNextMsg()

KvaDbStatus kvaDbGetNextMsg ( KvaDbHnd  dh,
KvaDbMessageHnd mh 
)

Get a handle to the next message in a database. Should be called after kvaDbGetFirstMsg().

Parameters
[in]dhA database handle
[out]mhA message handle
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbGetFirstMsg()
Examples:
candb_sample.c.

◆ kvaDbMsgDlcToBytes()

KvaDbStatus kvaDbMsgDlcToBytes ( KvaDbProtocolType  prot,
unsigned int  dlc,
unsigned int *  numBytes 
)

Translates message dlc to number of bytes for a given protocol

Parameters
[in]protA protocol type
[in]dlcRaw message dlc
[out]numBytesNumber of bytes corresponding to dlc
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbGetProtocol()

◆ kvaDbSetMsgComment()

KvaDbStatus kvaDbSetMsgComment ( KvaDbMessageHnd  mh,
char *  buf 
)

Set the message comment.

Parameters
[in]mhA message handle
[in]bufThe buffer that contains the message comment
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbGetMsgComment()
Examples:
candb_sample.c.

◆ kvaDbSetMsgDlc()

KvaDbStatus kvaDbSetMsgDlc ( KvaDbMessageHnd  mh,
int  dlc 
)

Set the data length code for a message.

Parameters
[in]mhA message handle
[in]dlcThe data length code
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbGetMsgDlc()
Examples:
candb_sample.c.

◆ kvaDbSetMsgId()

KvaDbStatus kvaDbSetMsgId ( KvaDbMessageHnd  mh,
unsigned int  id,
unsigned int  flags 
)

Set the message identifier and flags.

Parameters
[in]mhA message handle
[in]idThe message identifier
[in]flagsThe message flags, KVADB_MESSAGE_xxx
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbGetMsgId()
Examples:
candb_sample.c.

◆ kvaDbSetMsgName()

KvaDbStatus kvaDbSetMsgName ( KvaDbMessageHnd  mh,
char *  buf 
)

Set the message name.

Parameters
[in]mhA message handle
[in]bufThe buffer that contains the message name.
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbGetMsgName()
Examples:
candb_sample.c.

◆ kvaDbSetMsgSendNode()

KvaDbStatus kvaDbSetMsgSendNode ( KvaDbMessageHnd  mh,
KvaDbNodeHnd  nh 
)

Set send node for a message

Parameters
[in]mhA message handle
[in]nhA node handle
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbGetMsgSendNode()