Signals

Add, delete and modify signals in messages. More...

Functions

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 kvaDbGetSignalMessage (KvaDbSignalHnd sh, KvaDbMessageHnd *mh)
 
KvaDbStatus kvaDbGetSignalValueFloat (KvaDbSignalHnd sh, double *f, void *data, size_t len)
 
KvaDbStatus kvaDbGetSignalValueInteger (KvaDbSignalHnd sh, int *f, void *data, size_t len)
 
KvaDbStatus kvaDbRetrieveSignalValuePhys (KvaDbSignalHnd sh, double *value, void *data, size_t len)
 
KvaDbStatus kvaDbRetrieveSignalValueRaw (KvaDbSignalHnd sh, int *value, void *data, size_t len)
 
KvaDbStatus kvaDbRetrieveSignalValueRaw64 (KvaDbSignalHnd sh, uint64_t *value, 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 kvaDbStoreSignalValuePhys (KvaDbSignalHnd sh, void *can_data, int len, double value)
 
KvaDbStatus kvaDbStoreSignalValueRaw (KvaDbSignalHnd sh, void *can_data, int len, int value)
 
KvaDbStatus kvaDbStoreSignalValueRaw64 (KvaDbSignalHnd sh, void *can_data, int len, uint64_t value)
 
KvaDbStatus kvaDbGetFirstEnumValue (KvaDbSignalHnd sh, KvaDbEnumValueHnd *eh)
 
KvaDbStatus kvaDbGetNextEnumValue (KvaDbSignalHnd sh, KvaDbEnumValueHnd *eh)
 
KvaDbStatus kvaDbGetEnumValue (KvaDbEnumValueHnd eh, int *val, char *buf, size_t buflen)
 
KvaDbStatus kvaDbGetFirstEnumValuePair (KvaDbSignalHnd sh, KvaDbEnumValueHnd *eh, int *val, char *buf, size_t buflen)
 
KvaDbStatus kvaDbGetNextEnumValuePair (KvaDbSignalHnd sh, KvaDbEnumValueHnd *eh, int *val, char *buf, size_t buflen)
 
KvaDbStatus kvaDbAddEnumValue (KvaDbSignalHnd sh, int val, const char *name)
 
KvaDbStatus kvaDbDeleteEnumValue (KvaDbSignalHnd sh, KvaDbEnumValueHnd eh)
 

Detailed Description

Add, delete and modify signals in messages.

Signal bit positions are numbered in a "sawtooth" manner, i.e. indices in a byte decrease from left to right:

+-------------------------+-------------------------+
| 7 6 5 4 3 2 1 0 | 15 14 13 12 11 10 9 8 | ...
+-------------------------+-------------------------+

Byte order formats determine the signal start bit notation and the direction it expands in. There are three of relevance to this API: Intel Standard and Motorola forward MSB/-LSB. The following example shows two signals:

| 7 6 5 4 3 2 1 0
--+-------------------------
0 |<......lsb v Intel Standard
1 | msb.........
2 | | Motorola forward MSB/LSB
3 | v msb............
4 |<...............lsb

Function Documentation

◆ kvaDbAddEnumValue()

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()

◆ kvaDbAddSignal()

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:
example/c/candb_sample.c, and example/c/j1939_db.c.

◆ kvaDbDeleteEnumValue()

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()

◆ kvaDbDeleteSignal()

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:
example/c/candb_sample.c.

◆ kvaDbGetEnumValue()

KvaDbStatus kvaDbGetEnumValue ( KvaDbEnumValueHnd  eh,
int *  val,
char *  buf,
size_t  buflen 
)

Get the enumeration value and name. The name is returned as a null-terminated string. If buf is to small, the name will be truncated and status will be kvaDbOK.

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()

◆ kvaDbGetFirstEnumValue()

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()

◆ kvaDbGetFirstEnumValuePair()

KvaDbStatus kvaDbGetFirstEnumValuePair ( KvaDbSignalHnd  sh,
KvaDbEnumValueHnd eh,
int *  val,
char *  buf,
size_t  buflen 
)

Get the enumeration value and name for the first enumeration value for a signal. The name is returned as a null-terminated string. If buf is to small, the name will be truncated and status will be kvaDbOK.

Parameters
[in]shA signal handle.
[out]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

◆ kvaDbGetFirstSignal()

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:
example/c/candb_sample.c.

◆ kvaDbGetNextEnumValue()

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

◆ kvaDbGetNextEnumValuePair()

KvaDbStatus kvaDbGetNextEnumValuePair ( KvaDbSignalHnd  sh,
KvaDbEnumValueHnd eh,
int *  val,
char *  buf,
size_t  buflen 
)

Get the enumeration value and name for the next enumeration value for a signal. The name is returned as a null-terminated string. If buf is to small, the name will be truncated and status will be kvaDbOK. Should be called after kvaDbGetFirstEnumValuePair().

Parameters
[in]shA signal handle.
[out]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

◆ kvaDbGetNextSignal()

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:
example/c/candb_sample.c.

◆ kvaDbGetSignalByName()

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:
example/c/candb_sample.c.

◆ kvaDbGetSignalComment()

KvaDbStatus kvaDbGetSignalComment ( KvaDbSignalHnd  sh,
char *  buf,
size_t  buflen 
)

Get the comment for a signal as a null-terminated string. A truncated string will be returned if buf is too small and status will be kvaDbOK.

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:
example/c/candb_sample.c.

◆ kvaDbGetSignalEncoding()

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:
example/c/candb_sample.c.

◆ kvaDbGetSignalMessage()

KvaDbStatus kvaDbGetSignalMessage ( KvaDbSignalHnd  sh,
KvaDbMessageHnd mh 
)

Get handle to message, which given signal is associated with.

Parameters
[in]shA signal handle
[out]mhSignal's message
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbStoreSignalValuePhys()

◆ kvaDbGetSignalMode()

KvaDbStatus kvaDbGetSignalMode ( KvaDbSignalHnd  sh,
int *  mux 
)

Gets mux from 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

◆ kvaDbGetSignalName()

KvaDbStatus kvaDbGetSignalName ( KvaDbSignalHnd  sh,
char *  buf,
size_t  buflen 
)

Get the name of a signal as a null-terminated string. A truncated string will be returned if buf is too small and status will be kvaDbOK.

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:
example/c/candb_sample.c.

◆ kvaDbGetSignalPresentationType()

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()

◆ kvaDbGetSignalQualifiedName()

KvaDbStatus kvaDbGetSignalQualifiedName ( KvaDbSignalHnd  sh,
char *  buf,
size_t  buflen 
)

Get the qualified signal name, which is the database, message and signal names separated by dots, as a null-terminated string. An empty string will be returned if buf is too small and status will be kvaDbOK.

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:
example/c/candb_sample.c.

◆ kvaDbGetSignalRepresentationType()

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:
example/c/candb_sample.c.

◆ kvaDbGetSignalUnit()

KvaDbStatus kvaDbGetSignalUnit ( KvaDbSignalHnd  sh,
char *  buf,
size_t  buflen 
)

Get the signal unit as a null-terminated string. A truncated string will be returned if buf is too small and status will be kvaDbOK.

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:
example/c/candb_sample.c.

◆ kvaDbGetSignalValueEnum()

KvaDbStatus kvaDbGetSignalValueEnum ( KvaDbSignalHnd  sh,
char *  buf,
size_t  buflen,
void *  data,
size_t  len 
)

Retrieve signal's enumeration (string) value from can data.

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()

◆ kvaDbGetSignalValueFloat()

KvaDbStatus kvaDbGetSignalValueFloat ( KvaDbSignalHnd  sh,
double *  f,
void *  data,
size_t  len 
)

Retrieve signal's physical (floating-point) value from can data.

This function is deprecated and should not be used. Consider kvaDbRetrieveSignalValuePhys() instead

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:
example/c/candb_sample.c.

◆ kvaDbGetSignalValueInteger()

KvaDbStatus kvaDbGetSignalValueInteger ( KvaDbSignalHnd  sh,
int *  f,
void *  data,
size_t  len 
)

Retrieve signal's raw (integer) value from can data.

This function is deprecated and should not be used. Consider kvaDbRetrieveSignalValueRaw() instead

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:
example/c/candb_sample.c.

◆ kvaDbGetSignalValueLimits()

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:
example/c/candb_sample.c.

◆ kvaDbGetSignalValueScaling()

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:
example/c/candb_sample.c.

◆ kvaDbGetSignalValueSize()

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
Note
In case of Motorola encoding, startbit is in Motorola forward LSB, in contrast to the DBC file format.
See also
kvaDbSetSignalValueSize()
Examples:
example/c/candb_sample.c.

◆ kvaDbRetrieveSignalValuePhys()

KvaDbStatus kvaDbRetrieveSignalValuePhys ( KvaDbSignalHnd  sh,
double *  value,
void *  data,
size_t  len 
)

Retrieve signal's physical (floating-point) value from can data.

Parameters
[in]shA signal handle
[out]valueThe 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()

◆ kvaDbRetrieveSignalValueRaw()

KvaDbStatus kvaDbRetrieveSignalValueRaw ( KvaDbSignalHnd  sh,
int *  value,
void *  data,
size_t  len 
)

Retrieve signal's raw (integer) value from can data.

Parameters
[in]shA signal handle
[out]valueThe 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()

◆ kvaDbRetrieveSignalValueRaw64()

KvaDbStatus kvaDbRetrieveSignalValueRaw64 ( KvaDbSignalHnd  sh,
uint64_t *  value,
void *  data,
size_t  len 
)

Retrieve signal's raw (integer) value from can data.

Parameters
[in]shA signal handle
[out]valueThe converted value (64-bits)
[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
kvaDbStoreSignalValueRaw64()

◆ kvaDbSetSignalComment()

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:
example/c/candb_sample.c, and example/c/j1939_db.c.

◆ kvaDbSetSignalEncoding()

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:
example/c/candb_sample.c, and example/c/j1939_db.c.

◆ kvaDbSetSignalMode()

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

◆ kvaDbSetSignalName()

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
Note
Please note that allowed characters in identiers are digits, letters and "_" (underscore).
Identifiers shall also start with a letter or underscore.
See also
kvaDbGetSignalName()
Examples:
example/c/candb_sample.c, and example/c/j1939_db.c.

◆ kvaDbSetSignalRepresentationType()

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:
example/c/candb_sample.c, and example/c/j1939_db.c.

◆ kvaDbSetSignalUnit()

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:
example/c/candb_sample.c, and example/c/j1939_db.c.

◆ kvaDbSetSignalValueLimits()

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:
example/c/candb_sample.c, and example/c/j1939_db.c.

◆ kvaDbSetSignalValueScaling()

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:
example/c/candb_sample.c.

◆ kvaDbSetSignalValueSize()

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
Note
In case of Motorola encoding, startbit is in Motorola forward LSB, in contrast to the DBC file format.
See also
kvaDbGetSignalValueSize()
Examples:
example/c/candb_sample.c, and example/c/j1939_db.c.

◆ kvaDbStoreSignalValuePhys()

KvaDbStatus kvaDbStoreSignalValuePhys ( KvaDbSignalHnd  sh,
void *  can_data,
int  len,
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]lenThe 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:
example/c/candb_sample.c.

◆ kvaDbStoreSignalValueRaw()

KvaDbStatus kvaDbStoreSignalValueRaw ( KvaDbSignalHnd  sh,
void *  can_data,
int  len,
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]lenThe length of the data buffer
[in]valueThe raw signal value to convert
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbRetrieveSignalValueRaw()

◆ kvaDbStoreSignalValueRaw64()

KvaDbStatus kvaDbStoreSignalValueRaw64 ( KvaDbSignalHnd  sh,
void *  can_data,
int  len,
uint64_t  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]lenThe length of the data buffer
[in]valueThe raw signal value to convert (64-bits)
Returns
kvaDbOK (zero) if success
kvaDbErr_xxx (negative) if failure
See also
kvaDbRetrieveSignalValueRaw64()