Kvaser CANLIB: CAN Database
Data Structures | Functions

CAN Database

Data Structures

struct  KvaDbProtocolProperties

Functions

KvaDbStatus kvaDbOpen (KvaDbHnd *dh)
KvaDbStatus kvaDbAddFile (KvaDbHnd dh, const char *filename)
KvaDbStatus kvaDbSetDummyFileName (KvaDbHnd dh, const char *filename)
KvaDbStatus kvaDbCreate (KvaDbHnd dh, const char *localName, const char *filename)
KvaDbStatus kvaDbClose (KvaDbHnd dh)
KvaDbStatus kvaDbWriteFile (KvaDbHnd dh, char *filename)
KvaDbStatus kvaDbReadFile (KvaDbHnd dh, char *filename)
KvaDbStatus kvaDbGetFlags (KvaDbHnd dh, unsigned int *flags)
KvaDbStatus kvaDbGetProtocol (KvaDbHnd dh, KvaDbProtocolType *prot)
KvaDbStatus kvaDbGetProtocolProperties (KvaDbProtocolType prot, KvaDbProtocolProperties *prop)
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 kvaDbSetFlags (KvaDbHnd dh, unsigned int flags)
KvaDbStatus kvaDbSetProtocol (KvaDbHnd dh, KvaDbProtocolType prot)
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 kvaDbGetFirstSignal (KvaDbMessageHnd mh, KvaDbSignalHnd *sh)
KvaDbStatus kvaDbGetNextSignal (KvaDbMessageHnd mh, KvaDbSignalHnd *sh)
KvaDbStatus kvaDbGetSignalByName (KvaDbMessageHnd mh, char *buf, KvaDbSignalHnd *sh)
KvaDbStatus kvaDbSetSignalMode (KvaDbSignalHnd sh, int mux)
KvaDbStatus kvaDbGetSignalMode (KvaDbSignalHnd sh, int *mux)
KvaDbStatus kvaDbGetSignalValueFloat (KvaDbSignalHnd sh, double *f, void *data, size_t len)
KvaDbStatus kvaDbGetSignalValueInteger (KvaDbSignalHnd sh, int *f, void *data, size_t len)
KvaDbStatus kvaDbGetSignalValueEnum (KvaDbSignalHnd sh, char *buf, size_t buflen, void *data, size_t len)
KvaDbStatus kvaDbGetSignalValueLimits (KvaDbSignalHnd sh, double *minval, double *maxval)
KvaDbStatus kvaDbGetSignalValueScaling (KvaDbSignalHnd sh, double *factor, double *offset)
KvaDbStatus kvaDbGetSignalValueSize (KvaDbSignalHnd sh, int *startbit, int *length)
KvaDbStatus kvaDbGetSignalName (KvaDbSignalHnd sh, char *buf, size_t buflen)
KvaDbStatus kvaDbGetSignalQualifiedName (KvaDbSignalHnd sh, char *buf, size_t buflen)
KvaDbStatus kvaDbGetSignalComment (KvaDbSignalHnd sh, char *buf, size_t buflen)
KvaDbStatus kvaDbGetSignalUnit (KvaDbSignalHnd sh, char *buf, size_t buflen)
KvaDbStatus kvaDbGetSignalEncoding (KvaDbSignalHnd sh, KvaDbSignalEncoding *e)
KvaDbStatus kvaDbGetSignalRepresentationType (KvaDbSignalHnd sh, KvaDbSignalType *t)
KvaDbStatus kvaDbGetSignalPresentationType (KvaDbSignalHnd sh, KvaDbSignalType *t)
KvaDbStatus kvaDbAddSignal (KvaDbMessageHnd mh, KvaDbSignalHnd *sh)
KvaDbStatus kvaDbDeleteSignal (KvaDbMessageHnd mh, KvaDbSignalHnd sh)
KvaDbStatus kvaDbSetSignalValueLimits (KvaDbSignalHnd sh, double minval, double maxval)
KvaDbStatus kvaDbSetSignalValueScaling (KvaDbSignalHnd sh, double factor, double offset)
KvaDbStatus kvaDbSetSignalValueSize (KvaDbSignalHnd sh, int startbit, int length)
KvaDbStatus kvaDbSetSignalName (KvaDbSignalHnd sh, char *buf)
KvaDbStatus kvaDbSetSignalComment (KvaDbSignalHnd sh, char *buf)
KvaDbStatus kvaDbSetSignalUnit (KvaDbSignalHnd sh, char *buf)
KvaDbStatus kvaDbSetSignalEncoding (KvaDbSignalHnd sh, KvaDbSignalEncoding e)
KvaDbStatus kvaDbSetSignalRepresentationType (KvaDbSignalHnd sh, KvaDbSignalType t)
KvaDbStatus kvaDbGetFirstNode (KvaDbHnd dh, KvaDbNodeHnd *nh)
KvaDbStatus kvaDbGetNextNode (KvaDbHnd dh, KvaDbNodeHnd *nh)
KvaDbStatus kvaDbGetNodeByName (KvaDbHnd dh, const char *node_name, KvaDbNodeHnd *nh)
KvaDbStatus kvaDbGetNodeAttributeIntByName (KvaDbNodeHnd nh, const char *attrName, int *val)
KvaDbStatus kvaDbAddNode (KvaDbHnd dh, KvaDbNodeHnd *nh)
KvaDbStatus kvaDbDeleteNode (KvaDbHnd dh, KvaDbNodeHnd nh)
KvaDbStatus kvaDbSetNodeName (KvaDbNodeHnd nh, char *buf)
KvaDbStatus kvaDbGetNodeName (KvaDbNodeHnd nh, char *buf, size_t buflen)
KvaDbStatus kvaDbSetNodeComment (KvaDbNodeHnd nh, char *buf)
KvaDbStatus kvaDbAddReceiveNodeToSignal (KvaDbSignalHnd sh, KvaDbNodeHnd nh)
KvaDbStatus kvaDbRemoveReceiveNodeFromSignal (KvaDbSignalHnd sh, KvaDbNodeHnd nh)
KvaDbStatus kvaDbSignalContainsReceiveNode (KvaDbSignalHnd sh, KvaDbNodeHnd nh)
KvaDbStatus kvaDbStoreSignalValuePhys (KvaDbSignalHnd sh, unsigned char *can_data, int dlc, double value)
KvaDbStatus kvaDbStoreSignalValueRaw (KvaDbSignalHnd sh, unsigned char *can_data, int dlc, int value)
KvaDbStatus kvaDbGetFirstAttributeDefinition (KvaDbHnd dh, KvaDbAttributeDefHnd *adh)
KvaDbStatus kvaDbGetAttributeDefinitionByName (KvaDbHnd dh, const char *attrName, KvaDbAttributeDefHnd *adh)
KvaDbStatus kvaDbGetNextAttributeDefinition (KvaDbAttributeDefHnd adh, KvaDbAttributeDefHnd *nadh)
KvaDbStatus kvaDbGetAttributeDefinitionType (KvaDbAttributeDefHnd adh, KvaDbAttributeType *at)
KvaDbStatus kvaDbGetAttributeDefinitionOwner (KvaDbAttributeDefHnd adh, KvaDbAttributeOwner *ao)
KvaDbStatus kvaDbGetAttributeDefinitionName (KvaDbAttributeDefHnd adh, char *buf, size_t buflen)
KvaDbStatus kvaDbGetAttributeDefinitionInt (KvaDbAttributeDefHnd adh, int *def, int *min, int *max)
KvaDbStatus kvaDbGetAttributeDefinitionFloat (KvaDbAttributeDefHnd adh, float *def, float *min, float *max)
KvaDbStatus kvaDbGetAttributeDefinitionString (KvaDbAttributeDefHnd adh, char *buf, size_t buflen)
KvaDbStatus kvaDbGetAttributeDefinitionEnumeration (KvaDbAttributeDefHnd adh, int *def)
KvaDbStatus kvaDbAddAttributeDefinition (KvaDbHnd dh, KvaDbAttributeDefHnd *adh)
KvaDbStatus kvaDbSetAttributeDefinitionName (KvaDbAttributeDefHnd adh, const char *adName)
KvaDbStatus kvaDbSetAttributeDefinitionType (KvaDbAttributeDefHnd adh, KvaDbAttributeType adType)
KvaDbStatus kvaDbSetAttributeDefinitionOwner (KvaDbAttributeDefHnd adh, KvaDbAttributeOwner adOwner)
KvaDbStatus kvaDbAddAttributeDefinitionEnum (KvaDbAttributeDefHnd adh, const char *eName, int eValue)
KvaDbStatus kvaDbSetAttributeDefinitionEnumDefault (KvaDbAttributeDefHnd adh, int dValue)
KvaDbStatus kvaDbSetAttributeDefinitionInt (KvaDbAttributeDefHnd adh, int def, int min, int max)
KvaDbStatus kvaDbSetAttributeDefinitionFloat (KvaDbAttributeDefHnd adh, float def, float min, float max)
KvaDbStatus kvaDbSetAttributeDefinitionString (KvaDbAttributeDefHnd adh, const char *buf)
KvaDbStatus kvaDbAddMsgAttribute (KvaDbMessageHnd mh, KvaDbAttributeDefHnd adh, KvaDbAttributeHnd *ah)
KvaDbStatus kvaDbDeleteMsgAttribute (KvaDbMessageHnd mh, KvaDbAttributeHnd ah)
KvaDbStatus kvaDbAddSignalAttribute (KvaDbSignalHnd sh, KvaDbAttributeDefHnd adh, KvaDbAttributeHnd *ah)
KvaDbStatus kvaDbGetFirstEnumValue (KvaDbSignalHnd sh, KvaDbEnumValueHnd *eh)
KvaDbStatus kvaDbGetNextEnumValue (KvaDbSignalHnd sh, KvaDbEnumValueHnd *eh)
KvaDbStatus kvaDbGetEnumValue (KvaDbEnumValueHnd eh, int *val, char *buf, size_t buflen)
KvaDbStatus kvaDbAddEnumValue (KvaDbSignalHnd sh, int val, const char *name)
KvaDbStatus kvaDbDeleteEnumValue (KvaDbSignalHnd sh, KvaDbEnumValueHnd eh)
KvaDbStatus kvaDbDeleteSignalAttribute (KvaDbSignalHnd sh, KvaDbAttributeHnd ah)
KvaDbStatus kvaDbAddNodeAttribute (KvaDbNodeHnd nh, KvaDbAttributeDefHnd adh, KvaDbAttributeHnd *ah)
KvaDbStatus kvaDbDeleteNodeAttribute (KvaDbNodeHnd nh, KvaDbAttributeHnd ah)
KvaDbStatus kvaDbGetFirstMsgAttribute (KvaDbMessageHnd mh, KvaDbAttributeHnd *ah)
KvaDbStatus kvaDbGetMsgAttributeByName (KvaDbMessageHnd mh, const char *attrName, KvaDbAttributeHnd *ah)
KvaDbStatus kvaDbGetMsgAttributeIntByName (KvaDbMessageHnd mh, const char *attrName, int *val)
KvaDbStatus kvaDbGetFirstSignalAttribute (KvaDbSignalHnd sh, KvaDbAttributeHnd *ah)
KvaDbStatus kvaDbGetSignalAttributeByName (KvaDbSignalHnd sh, const char *attrName, KvaDbAttributeHnd *ah)
KvaDbStatus kvaDbGetFirstNodeAttribute (KvaDbNodeHnd nh, KvaDbAttributeHnd *ah)
KvaDbStatus kvaDbGetNodeAttributeByName (KvaDbNodeHnd nh, const char *attrName, KvaDbAttributeHnd *ah)
KvaDbStatus kvaDbGetNextAttribute (KvaDbAttributeHnd ah, KvaDbAttributeHnd *nah)
KvaDbStatus kvaDbGetAttributeType (KvaDbAttributeHnd ah, KvaDbAttributeType *at)
KvaDbStatus kvaDbGetAttributeName (KvaDbAttributeHnd adh, char *buf, size_t buflen)
KvaDbStatus kvaDbSetAttributeValueInt (KvaDbAttributeHnd ah, int val)
KvaDbStatus kvaDbGetAttributeValueInt (KvaDbAttributeHnd ah, int *val)
KvaDbStatus kvaDbSetAttributeValueFloat (KvaDbAttributeHnd ah, float val)
KvaDbStatus kvaDbGetAttributeValueFloat (KvaDbAttributeHnd ah, float *val)
KvaDbStatus kvaDbSetAttributeValueString (KvaDbAttributeHnd ah, const char *buf, int buflen)
KvaDbStatus kvaDbGetAttributeValueString (KvaDbAttributeHnd ah, char *buf, size_t buflen)
KvaDbStatus kvaDbSetAttributeValueEnumeration (KvaDbAttributeHnd ah, int val)
KvaDbStatus kvaDbGetAttributeValueEnumeration (KvaDbAttributeHnd ah, int *val)
KvaDbStatus kvaDbMsgDlcToBytes (KvaDbProtocolType prot, unsigned int dlc, unsigned int *numBytes)
KvaDbStatus kvaDbBytesToMsgDlc (KvaDbProtocolType prot, unsigned int numBytes, unsigned int *dlc)

kvaDbErr_xxx

The following codes are returned by most CANDB API calls.
Note:
Error codes are always negative.

enum  KvaDbStatus {
  kvaDbOK = 0,
  kvaDbErr_Fail = -1,
  kvaDbErr_NoDatabase = -2,
  kvaDbErr_Param = -3,
  kvaDbErr_NoMsg = -4,
  kvaDbErr_NoSignal = -5,
  kvaDbErr_Internal = -6,
  kvaDbErr_DbFileOpen = -7,
  kvaDbErr_DatabaseInternal = -8,
  kvaDbErr_NoNode = -9,
  kvaDbErr_NoAttrib = -10,
  kvaDbErr_OnlyOneAllowed = -11
}

Kvaser Database Message Flags

The following flags are never used.
#define KVADB_MESSAGE_EXT   0x80000000
#define KVADB_MESSAGE_J1939   0x00000001
#define KVADB_MESSAGE_WAKEUP   0x00000002

CANDBSignalEncoding API Signal Encoding

The following values are used by kvaDbGetSignalEncoding() and kvaDbSetSignalEncoding()
enum  KvaDbSignalEncoding {
  kvaDb_Intel = 0,
  kvaDb_Motorola = 1
}

CANDBSignalRepresentation API Signal Representation

The type KvaDbSignalType is used by e.g. kvaDbGetSignalRepresentationType().
enum  KvaDbSignalType {
  kvaDb_Invalid,
  kvaDb_Signed,
  kvaDb_Unsigned,
  kvaDb_Float,
  kvaDb_Double
}

CANDBAttributeRepresentation API Attribute Representation

The type KvaDbAttributeType is used by e.g. kvaDbGetAttributeDefinitionType() and kvaDbGetAttributeType().
enum  KvaDbAttributeType {
  kvaDb_AttributeInvalid = 0,
  kvaDb_AttributeInteger = 1,
  kvaDb_AttributeFloat = 3,
  kvaDb_AttributeEnumeration = 4,
  kvaDb_AttributeString = 5
}

CANDBAttributeOwner API Attribute Owner

The type KvaDbAttributeOwner is used by e.g. kvaDbGetAttributeDefinitionOwner(),
enum  KvaDbAttributeOwner {
  kvaDb_AttributeOwnerInvalid = 0,
  kvaDb_AttributeOwnerDb = 1,
  kvaDb_AttributeOwnerMessage = 2,
  kvaDb_AttributeOwnerNode = 3,
  kvaDb_AttributeOwnerSignal = 4,
  kvaDb_AttributeOwnerEnv = 5
}

CANDBProtocolType API Protocol Type

The type KvaDbProtocolType is used by e.g. kvaDbGetProtocol() and kvaDbSetProtocol()
enum  KvaDbProtocolType {
  kvaDb_ProtocolCan = 0,
  kvaDb_ProtocolVan = 1,
  kvaDb_ProtocolLin = 2,
  kvaDb_ProtocolMOST = 3,
  kvaDb_ProtocolFlexRay = 4,
  kvaDb_ProtocolBEAN = 5,
  kvaDb_ProtocolEthernet = 6,
  kvaDb_ProtocolAFDX = 7,
  kvaDb_ProtocolJ1708 = 8,
  kvaDb_ProtocolCanFD = 9,
  kvaDb_ProtocolUnknown = 10
}

CANDBDatabaseFlags API Database Flags

The following value is used by kvaDbGetFlags().
typedef void * KvaDbHnd
typedef void * KvaDbMessageHnd
typedef void * KvaDbSignalHnd
typedef void * KvaDbNodeHnd
typedef void * KvaDbAttributeHnd
typedef void * KvaDbAttributeDefHnd
typedef void * KvaDbEnumValueHnd
#define KVADB_DATABASE_J1939   0x0001

Kvaser Database Multiplexer Mode values


#define KVADB_MUX_SIGNAL   -2
#define KVADB_MUX_INDEPENDENT   -1

Define Documentation

#define KVADB_DATABASE_J1939   0x0001

The database uses the J1939 protocol.

#define KVADB_MESSAGE_EXT   0x80000000

Message is an extended CAN message.

#define KVADB_MESSAGE_J1939   0x00000001

Message uses J1939 protocol.

#define KVADB_MESSAGE_WAKEUP   0x00000002

Message is a wake-up frame, Id/msg/dlc are undefined.

#define KVADB_MUX_INDEPENDENT   -1

Miltiplex mode value of an independent signal.

#define KVADB_MUX_SIGNAL   -2

Multiplex mode value of a multiplexer signal.


Typedef Documentation

typedef void* KvaDbAttributeDefHnd

Attribute definition handle.

typedef void* KvaDbAttributeHnd

Attribute handle.

typedef void* KvaDbEnumValueHnd

Enumeration value handle.

typedef void* KvaDbHnd

Database handle.

typedef void* KvaDbMessageHnd

Message handle.

typedef void* KvaDbNodeHnd

Node handle.

typedef void* KvaDbSignalHnd

Signal handle.


Enumeration Type Documentation

Enumerator:
kvaDb_AttributeOwnerInvalid 

Invalid owner.

kvaDb_AttributeOwnerDb 

Database owner.

kvaDb_AttributeOwnerMessage 

Message owner.

kvaDb_AttributeOwnerNode 

Node owner.

kvaDb_AttributeOwnerSignal 

Signal owner.

kvaDb_AttributeOwnerEnv 

Environment owner.

Enumerator:
kvaDb_AttributeInvalid 

Invalid attribute.

kvaDb_AttributeInteger 

Integer attribute.

kvaDb_AttributeFloat 

Float attribute.

kvaDb_AttributeEnumeration 

Enumeration attribute.

kvaDb_AttributeString 

String attribute.

Enumerator:
kvaDb_ProtocolCan 

Can protocol.

kvaDb_ProtocolVan 

Van protocol.

kvaDb_ProtocolLin 

Lin protocol.

kvaDb_ProtocolMOST 

MOST protocol.

kvaDb_ProtocolFlexRay 

FlexRay protocol.

kvaDb_ProtocolBEAN 

BEAN protocol.

kvaDb_ProtocolEthernet 

Ethernet protocol.

kvaDb_ProtocolAFDX 

AFDX protocol.

kvaDb_ProtocolJ1708 

J1708 protocol.

kvaDb_ProtocolCanFD 

Can FD protocol.

kvaDb_ProtocolUnknown 

Unknown or not specified protocol.

Enumerator:
kvaDb_Intel 

Intel.

kvaDb_Motorola 

kvaDb_Motorola

Enumerator:
kvaDb_Invalid 

Invalid representation.

kvaDb_Signed 

Signed integer.

kvaDb_Unsigned 

Unsigned integer.

kvaDb_Float 

Float.

kvaDb_Double 

Double.

Enumerator:
kvaDbOK 

OK - no error.

kvaDbErr_Fail 

General failure.

kvaDbErr_NoDatabase 

No database was found.

kvaDbErr_Param 

One or more of the parameters in call is erronous.

kvaDbErr_NoMsg 

No message was found.

kvaDbErr_NoSignal 

No signal was found.

kvaDbErr_Internal 

An internal error occured in the library.

kvaDbErr_DbFileOpen 

Could not open the database file.

kvaDbErr_DatabaseInternal 

An internal error occured in the database handler.

kvaDbErr_NoNode 

Could not find the database node.

kvaDbErr_NoAttrib 

No attribute found.

kvaDbErr_OnlyOneAllowed 

Only one CANdb structure is allowed.


Function Documentation

KvaDbStatus kvaDbAddAttributeDefinition ( KvaDbHnd  dh,
KvaDbAttributeDefHnd adh 
)

Add a new attribute definition to a database.

Parameters:
[in]dhA handle to a database
[out]adhA handle to a new attribute definition
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbAddAttributeDefinitionEnum ( KvaDbAttributeDefHnd  adh,
const char *  eName,
int  eValue 
)

Add a enumeration value to an attribute definition of enumeration type.

Parameters:
[in]adhA handle to a attribute definition
[in]eNameThe name of the enumeration entry
[in]eValueThe value of the enumeration entry
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbAddEnumValue ( KvaDbSignalHnd  sh,
int  val,
const char *  name 
)

Add a new enumeration value to a signal.

Parameters:
[in]shA signal handle
[out]valThe enumeration value
[out]nameThe enumeration name
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbDeleteEnumValue()
KvaDbStatus kvaDbAddFile ( KvaDbHnd  dh,
const char *  filename 
)

This loads a database file into a handle created with kvaDbOpen().

Note:
This function is deprecated and will be replaced by kvaDbCreate()
Parameters:
[in]dhA handle database handle
[in]filenameA database file
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbCreate()
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.
KvaDbStatus kvaDbAddMsgAttribute ( KvaDbMessageHnd  mh,
KvaDbAttributeDefHnd  adh,
KvaDbAttributeHnd ah 
)

Add an attribute to a message.

Parameters:
[in]mhA handle to a message
[in]adhA handle to an attribute definition
[out]ahAn attribute handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbDeleteMsgAttribute()
KvaDbStatus kvaDbAddNode ( KvaDbHnd  dh,
KvaDbNodeHnd nh 
)

Add a new node to a database.

Parameters:
[in]dhA database handle
[out]nhA handle to the new node
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbAddNodeAttribute ( KvaDbNodeHnd  nh,
KvaDbAttributeDefHnd  adh,
KvaDbAttributeHnd ah 
)

Add an attribute to a node.

Parameters:
[in]nhA handle to a node
[in]adhA handle to an attribute definition
[out]ahAn attribute handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbDeleteNodeAttribute()
KvaDbStatus kvaDbAddReceiveNodeToSignal ( KvaDbSignalHnd  sh,
KvaDbNodeHnd  nh 
)

Add a receiving node to a signal.

Parameters:
[in]shA signal handle
[in]nhA node handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbAddSignal ( KvaDbMessageHnd  mh,
KvaDbSignalHnd sh 
)

Add a new signal to a message.

Parameters:
[in]mhA message handle
[out]shA handle to the new signal
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbDeleteSignal()
Examples:
candb_sample.c.
KvaDbStatus kvaDbAddSignalAttribute ( KvaDbSignalHnd  sh,
KvaDbAttributeDefHnd  adh,
KvaDbAttributeHnd ah 
)

Add an attribute to a signal.

Parameters:
[in]shA handle to a signal
[in]adhA handle to an attribute definition
[out]ahAn attribute handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbDeleteSignalAttribute()
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()
KvaDbStatus kvaDbClose ( KvaDbHnd  dh)

This function closes an open database handle.

Parameters:
[in]dhA handle to a database
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbOpen()
Examples:
candb_sample.c.
KvaDbStatus kvaDbCreate ( KvaDbHnd  dh,
const char *  localName,
const char *  filename 
)

This function creates a new database in a handle created with kvaDbOpen(). There are three ways to call this function:

  • To load data from an existing database file, set localName to NULL and set filename to the database file.
  • To add an empty database, set localName to any name and set filename to NULL.
  • To load data from an existing database file and give it a new name, set localName to the new name and set filename to the database file.
Parameters:
[in]dhA database handle
[in]localNameThe name of the database or NULL
[in]filenameThe database file or NULL
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbOpen()
Examples:
candb_sample.c.
KvaDbStatus kvaDbDeleteEnumValue ( KvaDbSignalHnd  sh,
KvaDbEnumValueHnd  eh 
)

Delete an enumeration value from a signal.

Parameters:
[in]shA signal handle
[in]ehAn enumeration value handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbAddEnumValue()
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.
KvaDbStatus kvaDbDeleteMsgAttribute ( KvaDbMessageHnd  mh,
KvaDbAttributeHnd  ah 
)

Delete an attribute from a message.

Parameters:
[in]mhA handle to a message
[in]ahA handle to an attribute
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbAddMsgAttribute()
KvaDbStatus kvaDbDeleteNode ( KvaDbHnd  dh,
KvaDbNodeHnd  nh 
)

Delete a node from a database.

Parameters:
[in]dhA database handle
[in]nhA handle to the node that will be deleted
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbDeleteNodeAttribute ( KvaDbNodeHnd  nh,
KvaDbAttributeHnd  ah 
)

Delete an attribute from a node.

Parameters:
[in]nhA handle to a node
[in]ahA handle to an attribute
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbAddNodeAttribute()
KvaDbStatus kvaDbDeleteSignal ( KvaDbMessageHnd  mh,
KvaDbSignalHnd  sh 
)

Delete a signal from a message.

Parameters:
[in]mhA message handle
[in]shA handle to the signal to delete
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbAddSignal()
Examples:
candb_sample.c.
KvaDbStatus kvaDbDeleteSignalAttribute ( KvaDbSignalHnd  sh,
KvaDbAttributeHnd  ah 
)

Delete an attribute from a signal.

Parameters:
[in]shA handle to a signal
[in]ahA handle to an attribute
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbAddSignalAttribute()
KvaDbStatus kvaDbGetAttributeDefinitionByName ( KvaDbHnd  dh,
const char *  attrName,
KvaDbAttributeDefHnd adh 
)

Get a handle to an attribute definition with specified name.

Parameters:
[in]dhA handle to a database
[in]attrNameThe attribute name to search for
[out]adhAn attribute definition handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbGetAttributeDefinitionEnumeration ( KvaDbAttributeDefHnd  adh,
int *  def 
)

Get the value for an attribute definition of type enumeration.

Parameters:
[in]adhA handle to an attribute definition
[out]defThe default value of the attribute definition
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbGetAttributeDefinitionFloat ( KvaDbAttributeDefHnd  adh,
float *  def,
float *  min,
float *  max 
)

Get the values for an attribute definition of type float.

Parameters:
[in]adhA handle to an attribute definition
[out]defThe default value of the attribute definition
[out]minThe min value of the attribute definition
[out]maxThe max value of the attribute definition
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbGetAttributeDefinitionInt ( KvaDbAttributeDefHnd  adh,
int *  def,
int *  min,
int *  max 
)

Get the values for an attribute definition of type integer.

Parameters:
[in]adhA handle to an attribute definition
[out]defThe default value of the attribute definition
[out]minThe min value of the attribute definition
[out]maxThe max value of the attribute definition
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbGetAttributeDefinitionName ( KvaDbAttributeDefHnd  adh,
char *  buf,
size_t  buflen 
)

Get the name for an attribute definition.

Parameters:
[in]adhA handle to an attribute
[out]bufThe buffer that will hold the attribute name
[in]buflenThe length of the buffer.
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetAttributeDefinitionType()
KvaDbStatus kvaDbGetAttributeDefinitionOwner ( KvaDbAttributeDefHnd  adh,
KvaDbAttributeOwner ao 
)

Get the type for an attribute definition.

Parameters:
[in]adhA handle to an attribute definition
[out]aoThe owner of the attribute definition, kvadb_AttributeOwnerXXX
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetAttributeDefinitionType()
KvaDbStatus kvaDbGetAttributeDefinitionString ( KvaDbAttributeDefHnd  adh,
char *  buf,
size_t  buflen 
)

Get the value for an attribute definition of type string.

Parameters:
[in]adhA handle to an attribute definition
[out]bufThe buffer that holds the default value of the attribute
[out]buflenThe length of the buffer.
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbGetAttributeDefinitionType ( KvaDbAttributeDefHnd  adh,
KvaDbAttributeType at 
)

Get the type for an attribute definition.

Parameters:
[in]adhA handle to an attribute definition
[out]atThe type of the attribute definition
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetAttributeDefinitionOwner()
KvaDbStatus kvaDbGetAttributeName ( KvaDbAttributeHnd  adh,
char *  buf,
size_t  buflen 
)

Get the name for an attribute.

Parameters:
[in]adhA handle to an attribute
[out]bufThe buffer that will hold the attribute name
[in]buflenThe length of the buffer.
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetAttributeType()
KvaDbStatus kvaDbGetAttributeType ( KvaDbAttributeHnd  ah,
KvaDbAttributeType at 
)

Get the type for an attribute.

Parameters:
[in]ahA handle to an attribute
[out]atThe type of the attribute
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetAttributeName()
KvaDbStatus kvaDbGetAttributeValueEnumeration ( KvaDbAttributeHnd  ah,
int *  val 
)

Get the value for an attribute of type enumeration.

Parameters:
[in]ahA handle to an attribute
[out]valThe value of the attribute
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetAttributeValueEnumeration()
KvaDbStatus kvaDbGetAttributeValueFloat ( KvaDbAttributeHnd  ah,
float *  val 
)

Get the value for an attribute of type float.

Parameters:
[in]ahA handle to an attribute
[out]valThe value of the attribute
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetAttributeValueFloat()
KvaDbStatus kvaDbGetAttributeValueInt ( KvaDbAttributeHnd  ah,
int *  val 
)

Get the value for an attribute of type integer.

Parameters:
[in]ahA handle to an attribute
[out]valThe value of the attribute
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetAttributeValueInt()
KvaDbStatus kvaDbGetAttributeValueString ( KvaDbAttributeHnd  ah,
char *  buf,
size_t  buflen 
)

Get the value for an attribute of type string.

Parameters:
[in]ahA handle to an attribute
[out]bufThe buffer that holds the attribute value
[out]buflenThe length of the buffer.
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetAttributeValueString()
KvaDbStatus kvaDbGetEnumValue ( KvaDbEnumValueHnd  eh,
int *  val,
char *  buf,
size_t  buflen 
)

Get the string and integer from an enumeration value.

Parameters:
[in]ehAn enumeration value handle
[out]valThe enumeration value
[out]bufThe buffer that will hold the enumeration name
[in]buflenThe length of the buffer
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetFirstEnumValue()
KvaDbStatus kvaDbGetFirstAttributeDefinition ( KvaDbHnd  dh,
KvaDbAttributeDefHnd adh 
)

Get a handle to the first attribute defined in the database.

Parameters:
[in]dhA handle to a database
[out]adhFirst attribute definition handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetNextAttributeDefinition()
KvaDbStatus kvaDbGetFirstEnumValue ( KvaDbSignalHnd  sh,
KvaDbEnumValueHnd eh 
)

Get the first enumeration value in a signal.

Parameters:
[in]shA signal handle
[out]ehA handle to the first enumeration value
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetNextEnumValue()
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.
KvaDbStatus kvaDbGetFirstMsgAttribute ( KvaDbMessageHnd  mh,
KvaDbAttributeHnd ah 
)

Get a handle to the first attribute for a message.

Parameters:
[in]mhA handle to a message
[out]ahAn attribute definition handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetNextAttribute()
KvaDbStatus kvaDbGetFirstNode ( KvaDbHnd  dh,
KvaDbNodeHnd nh 
)

Get the first node.

Parameters:
[in]dhA database handle
[out]nhA node handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetNextNode()
KvaDbStatus kvaDbGetFirstNodeAttribute ( KvaDbNodeHnd  nh,
KvaDbAttributeHnd ah 
)

Get a handle to the first attribute for a node.

Parameters:
[in]nhA handle to a node
[out]ahAn attribute definition handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetNextAttribute()
KvaDbStatus kvaDbGetFirstSignal ( KvaDbMessageHnd  mh,
KvaDbSignalHnd sh 
)

Get the first signal in a message.

Parameters:
[in]mhA message handle
[out]shA handle to the first signal
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetNextSignal()
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetFirstSignalAttribute ( KvaDbSignalHnd  sh,
KvaDbAttributeHnd ah 
)

Get a handle to the first attribute for a signal.

Parameters:
[in]shA handle to a signal
[out]ahAn attribute definition handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetNextAttribute()
KvaDbStatus kvaDbGetFlags ( KvaDbHnd  dh,
unsigned int *  flags 
)

Get the database flags.

Parameters:
[in]dhA handle to a database
[out]flagsThe database flags, KVADB_DATABASE_xxx
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbReadFile()
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetMsgAttributeByName ( KvaDbMessageHnd  mh,
const char *  attrName,
KvaDbAttributeHnd ah 
)

Get a handle to an attribute with specified name for a message.

Parameters:
[in]mhA handle to a message
[in]attrNameThe attribute name to search for
[out]ahAn attribute definition handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbGetMsgAttributeIntByName ( KvaDbMessageHnd  mh,
const char *  attrName,
int *  val 
)

Get the integer value of an attribute with specified name for a message.

Parameters:
[in]mhA handle to a message
[in]attrNameThe attribute name to search for
[out]valAn integer
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
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.
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.
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.
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.
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.
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
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.
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.
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()
KvaDbStatus kvaDbGetNextAttribute ( KvaDbAttributeHnd  ah,
KvaDbAttributeHnd nah 
)

Get a handle to the following attribute.

Parameters:
[in]ahA handle to an attribute
[out]nahAn attribute handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetFirstMsgAttribute()
kvaDbGetFirstSignalAttribute()
kvaDbGetFirstNodeAttribute()
KvaDbStatus kvaDbGetNextAttributeDefinition ( KvaDbAttributeDefHnd  adh,
KvaDbAttributeDefHnd nadh 
)

Get a handle to the following attribute defined.

Parameters:
[in]adhAn existing handle to an attribute definition
[out]nadhHandle to next attribute definition
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetFirstAttributeDefinition()
KvaDbStatus kvaDbGetNextEnumValue ( KvaDbSignalHnd  sh,
KvaDbEnumValueHnd eh 
)

Get the next enumeration value in a signal. Should be called after kvaDbGetFirstEnumValue().

Parameters:
[in]shA signal handle
[out]ehA handle to the next enumeration value
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetNextEnumValue
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.
KvaDbStatus kvaDbGetNextNode ( KvaDbHnd  dh,
KvaDbNodeHnd nh 
)

Get the next node. Should be called after kvaDbGetFirstNode().

Parameters:
[in]dhA database handle
[out]nhA handle to the next node
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetNodeByName()
KvaDbStatus kvaDbGetNextSignal ( KvaDbMessageHnd  mh,
KvaDbSignalHnd sh 
)

Get the next signal in a message. Should be called after kvaDbGetFirstSignal().

Parameters:
[in]mhA message handle
[out]shA handle to the next signal
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetFirstSignal
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetNodeAttributeByName ( KvaDbNodeHnd  nh,
const char *  attrName,
KvaDbAttributeHnd ah 
)

Get a handle to an attribute with specified name for a node.

Parameters:
[in]nhA handle to a node
[in]attrNameThe attribute name to search for
[out]ahAn attribute definition handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbGetNodeAttributeIntByName ( KvaDbNodeHnd  nh,
const char *  attrName,
int *  val 
)

Get the value of a node attribute as an integer.

Parameters:
[in]nhA node handle
[in]attrNameThe buffer that contains the attribute name
[out]valThe value of the attribute
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetFirstNode()
KvaDbStatus kvaDbGetNodeByName ( KvaDbHnd  dh,
const char *  node_name,
KvaDbNodeHnd nh 
)

Get a node by seaching for the node's name.

Parameters:
[in]dhA database handle
[in]node_nameThe buffer that contains the node name to search for
[out]nhA node handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetNodeAttributeIntByName()
KvaDbStatus kvaDbGetNodeName ( KvaDbNodeHnd  nh,
char *  buf,
size_t  buflen 
)

Get the node name.

Parameters:
[in]nhA node handle
[out]bufThe buffer that will contain the node name
[in]buflenThe length of the data buffer
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbGetProtocol ( KvaDbHnd  dh,
KvaDbProtocolType prot 
)

Reads the protocol attribute value of a database

Parameters:
[in]dhA handle to a database
[out]protA handle to protocol type, KvaDbProtocolType
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetProtocol(), kvaDbGetProtocolProperties
KvaDbStatus kvaDbGetProtocolProperties ( KvaDbProtocolType  prot,
KvaDbProtocolProperties prop 
)

Returns properties of a given protocol, see KvaDbProtocolProperties

Parameters:
[in]protProtocol type, KvaDbProtocolType
[out]propA handle to protocol properties, KvaDbProtocolProperties
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetProtocol()
KvaDbStatus kvaDbGetSignalAttributeByName ( KvaDbSignalHnd  sh,
const char *  attrName,
KvaDbAttributeHnd ah 
)

Get a handle to an attribute with specified name for a signal.

Parameters:
[in]shA handle to a signal
[in]attrNameThe attribute name to search for
[out]ahAn attribute definition handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbGetSignalByName ( KvaDbMessageHnd  mh,
char *  buf,
KvaDbSignalHnd sh 
)

Get a signal handle by seaching for the signals's name.

Parameters:
[in]mhA message handle
[in]bufThe buffer that contains the name of the signal to search for
[out]shA handle to the signal
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetFirstMsg()
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetSignalComment ( KvaDbSignalHnd  sh,
char *  buf,
size_t  buflen 
)

Get the signal comment.

Parameters:
[in]shA signal handle
[out]bufThe signal comment
[in]buflenThe length of the buffer that will hold the signal comment
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetSignalComment()
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetSignalEncoding ( KvaDbSignalHnd  sh,
KvaDbSignalEncoding e 
)

Get the signal encoding.

Parameters:
[in]shA signal handle
[out]eThe signal encoding, Intel or Motorola, KvaDbSignalEncoding
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetSignalEncoding()
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetSignalMode ( KvaDbSignalHnd  sh,
int *  mux 
)

Sets mux to multiplexer mode value of given signal. See KVADB_MUX_xxx for special (negative) values of multiplexer mode.

Parameters:
[in]shA signal handle
[out]muxSignal's multiplex mode
Returns:
kvaDbOK (zero if success
kvaDbErr_xxx (negative) if failure
See also:
KVADB_MUX_xxx
KvaDbStatus kvaDbGetSignalName ( KvaDbSignalHnd  sh,
char *  buf,
size_t  buflen 
)

Get the signal name.

Parameters:
[in]shA signal handle
[out]bufThe signal name
[in]buflenThe length of the buffer that will hold the signal name
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetSignalName()
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetSignalPresentationType ( KvaDbSignalHnd  sh,
KvaDbSignalType t 
)

Get the signal representation type.

Note:
This function is deprecated and will be replaced by kvaDbGetSignalRepresentationType()
Parameters:
[in]sh
[out]tThe signal representation type, KvaDbSignalType
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetSignalRepresentationType()
KvaDbStatus kvaDbGetSignalQualifiedName ( KvaDbSignalHnd  sh,
char *  buf,
size_t  buflen 
)

Get the qualified signal name. which is the database, message ans signal names separated by dots.

Parameters:
[in]shA signal handle
[out]bufThe qualified signal name
[in]buflenThe length of the buffer that will hold the qualified signal name
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetSignalName()
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetSignalRepresentationType ( KvaDbSignalHnd  sh,
KvaDbSignalType t 
)

Get the signal representation type.

Parameters:
[in]shA signal handle
[out]tThe signal representation type, KvaDbSignalType
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetSignalRepresentationType()
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetSignalUnit ( KvaDbSignalHnd  sh,
char *  buf,
size_t  buflen 
)

Get the signal unit.

Parameters:
[in]shA signal handle
[out]bufThe signal unit
[in]buflenThe length of the buffer that will hold the signal unit
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetSignalUnit()
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetSignalValueEnum ( KvaDbSignalHnd  sh,
char *  buf,
size_t  buflen,
void *  data,
size_t  len 
)

Convert data to a signal's enumeration (string) value.

Parameters:
[in]shA signal handle
[out]bufThe buffer that will hold the enumeration string
[in]buflenThe length of the buffer.
[in]dataThe data buffer to be converted
[in]lenThe length of the data buffer
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbStoreSignalValueRaw()
KvaDbStatus kvaDbGetSignalValueFloat ( KvaDbSignalHnd  sh,
double *  f,
void *  data,
size_t  len 
)

Convert data to a signal's physical (floating-point) value.

Parameters:
[in]shA signal handle
[out]fThe converted value
[in]dataThe data buffer to be converted
[in]lenThe length of the data buffer
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbStoreSignalValuePhys()
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetSignalValueInteger ( KvaDbSignalHnd  sh,
int *  f,
void *  data,
size_t  len 
)

Convert data to a signal's raw (integer) value.

Parameters:
[in]shA signal handle
[out]fThe converted value
[in]dataThe data buffer to be converted
[in]lenThe length of the data buffer
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbStoreSignalValueRaw()
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetSignalValueLimits ( KvaDbSignalHnd  sh,
double *  minval,
double *  maxval 
)

Get the minimum and maximum values from a signal.

Parameters:
[in]shA signal handle
[out]minvalThe minimum value
[out]maxvalThe maximum value
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetSignalValueLimits()
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetSignalValueScaling ( KvaDbSignalHnd  sh,
double *  factor,
double *  offset 
)

Get the scale factor and offset from a signal.

Parameters:
[in]shA signal handle
[out]factorThe signal scale factor
[out]offsetThe signal offset
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetSignalValueScaling()
Examples:
candb_sample.c.
KvaDbStatus kvaDbGetSignalValueSize ( KvaDbSignalHnd  sh,
int *  startbit,
int *  length 
)

Get the size and position of the signal value.

Parameters:
[in]shA signal handle
[out]startbitThe bit where the signal value starts
[out]lengthThe length of the signal value in bits
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbSetSignalValueSize()
Examples:
candb_sample.c.
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()
KvaDbStatus kvaDbOpen ( KvaDbHnd dh)

This function creates a new database handle.

Parameters:
[out]dhA handle to a new database
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbClose()
Examples:
candb_sample.c.
KvaDbStatus kvaDbReadFile ( KvaDbHnd  dh,
char *  filename 
)

Load a database from file into a handle created with kvaDbOpen().

Parameters:
[out]dhA handle to a database
[in]filenameThe name of the database file.
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbCreate()
Examples:
candb_sample.c.
KvaDbStatus kvaDbRemoveReceiveNodeFromSignal ( KvaDbSignalHnd  sh,
KvaDbNodeHnd  nh 
)

Remove a receiving node from a signal.

Parameters:
[in]shA signal handle
[in]nhA node handle
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbSetAttributeDefinitionEnumDefault ( KvaDbAttributeDefHnd  adh,
int  dValue 
)

Set the default enumeration value of an attribute definition of enumeration type.

Parameters:
[in]adhA handle to a attribute definition
[in]dValueThe default value of the enumeration entry
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbSetAttributeDefinitionFloat ( KvaDbAttributeDefHnd  adh,
float  def,
float  min,
float  max 
)

Set max, min and default value of an attribute definition of floating point type.

Parameters:
[in]adhA handle to a attribute definition
[in]defThe default value
[in]minThe minimum value
[in]maxThe maximum value
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbSetAttributeDefinitionInt ( KvaDbAttributeDefHnd  adh,
int  def,
int  min,
int  max 
)

Set max, min and default value of an attribute definition of integer type.

Parameters:
[in]adhA handle to a attribute definition
[in]defThe default value
[in]minThe minimum value
[in]maxThe maximum value
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbSetAttributeDefinitionName ( KvaDbAttributeDefHnd  adh,
const char *  adName 
)

Set the name of an attribute definition.

Parameters:
[in]adhA handle to a attribute definition
[in]adNameThe name of the attribute definition
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbSetAttributeDefinitionOwner ( KvaDbAttributeDefHnd  adh,
KvaDbAttributeOwner  adOwner 
)

Set the owner of an attribute definition.

Parameters:
[in]adhA handle to a attribute definition
[in]adOwnerThe owner of the attribute definition
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbSetAttributeDefinitionString ( KvaDbAttributeDefHnd  adh,
const char *  buf 
)

Set the default value of an attribute definition of string.

Parameters:
[in]adhA handle to a attribute definition
[in]bufThe default value
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbSetAttributeDefinitionType ( KvaDbAttributeDefHnd  adh,
KvaDbAttributeType  adType 
)

Set the type of an attribute definition.

Parameters:
[in]adhA handle to a attribute definition
[in]adTypeThe type of the attribute definition
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbSetAttributeValueEnumeration ( KvaDbAttributeHnd  ah,
int  val 
)

Set the value for an attribute of type enumeration.

Parameters:
[in]ahA handle to an attribute
[in]valThe value to set
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetAttributeValueEnumeration()
KvaDbStatus kvaDbSetAttributeValueFloat ( KvaDbAttributeHnd  ah,
float  val 
)

Set the value for an attribute of type float.

Parameters:
[in]ahA handle to an attribute
[in]valThe value to set
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetAttributeValueFloat()
KvaDbStatus kvaDbSetAttributeValueInt ( KvaDbAttributeHnd  ah,
int  val 
)

Set the value for an attribute of type integer.

Parameters:
[in]ahA handle to an attribute
[in]valThe value to set
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetAttributeValueInt()
KvaDbStatus kvaDbSetAttributeValueString ( KvaDbAttributeHnd  ah,
const char *  buf,
int  buflen 
)

Set the value for an attribute of type string.

Parameters:
[in]ahA handle to an attribute
[in]bufThe buffer that holds the attribute value
[in]buflenThe length of the buffer.
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetAttributeValueString()
KvaDbStatus kvaDbSetDummyFileName ( KvaDbHnd  dh,
const char *  filename 
)

This function creates a new database in a handle created with kvaDbOpen(). It is used when there is no file to read data from.

Note:
This function is deprecated and will be replaced by kvaDbCreate().
Parameters:
[in]dhA database handle
[in]filenameThe the dummy filename to use for this database
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbCreate()
KvaDbStatus kvaDbSetFlags ( KvaDbHnd  dh,
unsigned int  flags 
)

Set the database flags.

Note:
This feature is currently not enabled.
Parameters:
[in]dhA database handle
[in]flagsThe flags to set, KVADB_MESSAGE_xxx
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetFlags()
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.
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.
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.
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.
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()
KvaDbStatus kvaDbSetNodeComment ( KvaDbNodeHnd  nh,
char *  buf 
)

Set the node comment.

Parameters:
[in]nhA node handle
[in]bufThe buffer that contains the node comment
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbSetNodeName ( KvaDbNodeHnd  nh,
char *  buf 
)

Set the node name.

Parameters:
[in]nhA node handle
[in]bufThe buffer that contains the node name.
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbSetProtocol ( KvaDbHnd  dh,
KvaDbProtocolType  prot 
)

Writes the protocol attribute value of a database

Parameters:
[in]dhA handle to a database
[in]protProtocol type value, KvaDbProtocolType
KvaDbStatus kvaDbSetSignalComment ( KvaDbSignalHnd  sh,
char *  buf 
)

Set the signal comment.

Parameters:
[in]shA signal handle
[in]bufThe buffer that contains the signal comment
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetSignalComment()
Examples:
candb_sample.c.
KvaDbStatus kvaDbSetSignalEncoding ( KvaDbSignalHnd  sh,
KvaDbSignalEncoding  e 
)

Set the signal encoding.

Parameters:
[in]shA signal handle
[in]eThe signal encoding, Intel or Motorola, KvaDbSignalEncoding
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetSignalEncoding()
Examples:
candb_sample.c.
KvaDbStatus kvaDbSetSignalMode ( KvaDbSignalHnd  sh,
int  mux 
)

Sets signal's multiplex mode. If value is equal to KVADB_MUX_SIGNAL, marks signal as a multiplexer.

Parameters:
[in]shA signal handle
[in]muxSignal's multiplex mode
Returns:
kvaDbOK (zero if success
kvaDbErr_xxx (negative) if failure
See also:
KVADB_MUX_xxx
KvaDbStatus kvaDbSetSignalName ( KvaDbSignalHnd  sh,
char *  buf 
)

Set the signal name.

Parameters:
[in]shA signal handle
[in]bufThe buffer that contains the signal name
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetSignalName()
Examples:
candb_sample.c.
KvaDbStatus kvaDbSetSignalRepresentationType ( KvaDbSignalHnd  sh,
KvaDbSignalType  t 
)

Set the signal representation type.

Parameters:
[in]shA signal handle
[in]tThe signal representation type, KvaDbSignalType
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetSignalRepresentationType()
Examples:
candb_sample.c.
KvaDbStatus kvaDbSetSignalUnit ( KvaDbSignalHnd  sh,
char *  buf 
)

Set the signal unit.

Parameters:
[in]shA signal handle
[in]bufThe buffer that contains the unit for the signal
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetSignalUnit()
Examples:
candb_sample.c.
KvaDbStatus kvaDbSetSignalValueLimits ( KvaDbSignalHnd  sh,
double  minval,
double  maxval 
)

Set the value limits for a signal.

Parameters:
[in]shA signal handle
[in]minvalThe minimum signal value
[in]maxvalThe maximum signal value
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetSignalValueLimits()
Examples:
candb_sample.c.
KvaDbStatus kvaDbSetSignalValueScaling ( KvaDbSignalHnd  sh,
double  factor,
double  offset 
)

Set the scale factor and offset for a signal.

Parameters:
[in]shA signal handle
[in]factorThe scale factor for the signal value
[in]offsetThe offset for the signal value
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetSignalValueScaling()
Examples:
candb_sample.c.
KvaDbStatus kvaDbSetSignalValueSize ( KvaDbSignalHnd  sh,
int  startbit,
int  length 
)

Set the value position and size for a signal.

Parameters:
[in]shA signal handle
[in]startbitThe starting bit of the signal's value
[in]lengthThe length of the value in bits
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetSignalValueSize()
Examples:
candb_sample.c.
KvaDbStatus kvaDbSignalContainsReceiveNode ( KvaDbSignalHnd  sh,
KvaDbNodeHnd  nh 
)

Check if a signal contains a specific receiving node

Parameters:
[in]shA signal handle
[in]nhA node handle
Returns:
kvaDbOK (zero) if the signal contains the node
kvaDbErr_NoNode if the signal doesn't contain the node
kvaDbErr_xxx (negative) if failure
KvaDbStatus kvaDbStoreSignalValuePhys ( KvaDbSignalHnd  sh,
unsigned char *  can_data,
int  dlc,
double  value 
)

Convert a physical signal value to data bytes.

Parameters:
[in]shA signal handle
[out]can_dataThe buffer that will hold the converted value
[in]dlcThe length of the data buffer
[in]valueThe physical signal value to convert
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetSignalValueFloat()
Examples:
candb_sample.c.
KvaDbStatus kvaDbStoreSignalValueRaw ( KvaDbSignalHnd  sh,
unsigned char *  can_data,
int  dlc,
int  value 
)

Convert a raw signal value to data bytes.

Parameters:
[in]shA signal handle
[out]can_dataThe buffer that will hold the converted value
[in]dlcThe length of the data buffer
[in]valueThe raw signal value to convert
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbGetSignalValueInteger()
KvaDbStatus kvaDbWriteFile ( KvaDbHnd  dh,
char *  filename 
)

Write a database to file.

Parameters:
[in]dhA handle to a database
[in]filenameThe name of the database file
Returns:
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also:
kvaDbReadFile()
Examples:
candb_sample.c.