Add, delete and modify signals in messages. More...
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:
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:
The upper signal uses the "Intel" format and is 7 bits long.
The start bit position is that of the least-significant bit (=5).
The lower signal uses the "Motorola" format and is 11 bits long.
The DBC file format uses Motorola forward MSB where the start bit is the position of the most-significant bit (8*3 + 4 = 28), in contrast to the getters and setters of this API, which use Motorola forward LSB with the start bit being the position of the least-significant bit (8*4 + 2 = 34).
Function Documentation
kvaDbAddEnumValue()
| KvaDbStatus kvaDbAddEnumValue | ( | KvaDbSignalHnd | sh, |
| int | val, | ||
| const char * | name | ||
| ) |
Add a new enumeration value to a signal.
- Parameters
-
[in] sh A signal handle [out] val The enumeration value [out] name The 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] mh A message handle [out] sh A 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.
kvaDbAddSignalMuxRange()
| KvaDbStatus kvaDbAddSignalMuxRange | ( | KvaDbSignalHnd | sh, |
| unsigned int | from, | ||
| unsigned int | to | ||
| ) |
Adds an extended multiplexor value range to a signal.
- Parameters
-
[in] sh A signal handle [in] from Lower bound, inclusive [in] to Upper bound, inclusive
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
kvaDbClearSignalMuxRanges()
| KvaDbStatus kvaDbClearSignalMuxRanges | ( | KvaDbSignalHnd | sh | ) |
Removes all extended multiplexor value ranges from a signal.
- Parameters
-
[in] sh A signal handle
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
kvaDbDeleteEnumValue()
| KvaDbStatus kvaDbDeleteEnumValue | ( | KvaDbSignalHnd | sh, |
| KvaDbEnumValueHnd | eh | ||
| ) |
Delete an enumeration value from a signal.
- Parameters
-
[in] sh A signal handle [in] eh An 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] mh A message handle [in] sh A 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] eh An enumeration value handle [out] val The enumeration value [out] buf The buffer that will hold the enumeration name [in] buflen The 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] sh A signal handle [out] eh A 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] sh A signal handle. [out] eh An enumeration value handle. [out] val The enumeration value. [out] buf The buffer that will hold the enumeration name. [in] buflen The 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] mh A message handle [out] sh A 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] sh A signal handle [out] eh A 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] sh A signal handle. [out] eh An enumeration value handle. [out] val The enumeration value. [out] buf The buffer that will hold the enumeration name. [in] buflen The 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] mh A message handle [out] sh A 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] mh A message handle [in] buf The buffer that contains the name of the signal to search for [out] sh A 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] sh A signal handle [out] buf The signal comment [in] buflen The 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] sh A signal handle [out] e The 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] sh A signal handle [out] mh Signal's message
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
- See also
- kvaDbStoreSignalValuePhys()
kvaDbGetSignalMode()
| KvaDbStatus kvaDbGetSignalMode | ( | KvaDbSignalHnd | sh, |
| int * | mux | ||
| ) |
Gets the legacy multiplex mode value of given signal. See KVADB_MUX_xxx for special (negative) values of multiplexer mode.
This function preserves the historical API contract. Any selector signal, including a signal of the form `m<N>M`, is reported as KVADB_MUX_SIGNAL. Use kvaDbGetSignalMuxState for the exact selector/dependent state.
- Parameters
-
[in] sh A signal handle [out] mux Signal's multiplex mode
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
- See also
- KVADB_MUX_xxx
kvaDbGetSignalMux()
| KvaDbStatus kvaDbGetSignalMux | ( | KvaDbSignalHnd | sh, |
| KvaDbSignalHnd * | msh | ||
| ) |
Returns handle to the immediate parent selector signal used by an extended multiplexed signal. If the signal has no selector signal, KvaDbOk will be returned and *msh will be NULL.
- Parameters
-
[in] sh A signal handle [out] msh Selector signal handle
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
kvaDbGetSignalMuxRange()
| KvaDbStatus kvaDbGetSignalMuxRange | ( | KvaDbSignalHnd | sh, |
| size_t | index, | ||
| unsigned int * | from, | ||
| unsigned int * | to | ||
| ) |
Returns one extended multiplexor value range by index.
- Parameters
-
[in] sh A signal handle [in] index Zero-based value range index [out] from Lower bound, inclusive [out] to Upper bound, inclusive
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
kvaDbGetSignalMuxRangeCount()
| KvaDbStatus kvaDbGetSignalMuxRangeCount | ( | KvaDbSignalHnd | sh, |
| size_t * | count | ||
| ) |
Returns the number of extended multiplexor value ranges associated with a signal.
- Parameters
-
[in] sh A signal handle [out] count Number of value ranges
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
kvaDbGetSignalMuxState()
| KvaDbStatus kvaDbGetSignalMuxState | ( | KvaDbSignalHnd | sh, |
| int * | is_selector, | ||
| int * | mode | ||
| ) |
Gets the exact multiplexing state of a signal.
*is_selector is non-zero if the signal is a selector signal (`M` or `m<N>M` in DBC form). *mode is KVADB_MUX_INDEPENDENT if the signal is not mode-dependent, otherwise it is the dependent mode value (`m<N>` or `m<N>M` in DBC form).
- Parameters
-
[in] sh A signal handle [out] is_selector Non-zero if the signal is a selector signal [out] mode KVADB_MUX_INDEPENDENT or the dependent mode value
- 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] sh A signal handle. [out] buf The signal name. [in] buflen The 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] t The signal representation type, KvaDbSignalType
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
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] sh A signal handle [out] buf The qualified signal name [in] buflen The 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] sh A signal handle [out] t The signal representation type, KvaDbSignalType
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
- 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] sh A signal handle [out] buf The signal unit [in] buflen The 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] sh A signal handle [out] buf The buffer that will hold the enumeration string [in] buflen The length of the buffer. [in] data The data buffer to be converted [in] len The 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] sh A signal handle [out] f The converted value [in] data The data buffer to be converted [in] len The 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] sh A signal handle [out] f The converted value [in] data The data buffer to be converted [in] len The 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] sh A signal handle [out] minval The minimum value [out] maxval The 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] sh A signal handle [out] factor The signal scale factor [out] offset The 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] sh A signal handle [out] startbit The bit where the signal value starts [out] length The length of the signal value in bits
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
- Note
- In case of Motorola encoding,
startbitis 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] sh A signal handle [out] value The converted value [in] data The data buffer to be converted [in] len The 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] sh A signal handle [out] value The converted value [in] data The data buffer to be converted [in] len The 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] sh A signal handle [out] value The converted value (64-bits) [in] data The data buffer to be converted [in] len The 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] sh A signal handle [in] buf The 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] sh A signal handle [in] e The 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 legacy multiplex mode. If value is equal to KVADB_MUX_SIGNAL, marks signal as a selector signal.
This function preserves the historical API contract, which can express only one of the selector/dependent aspects directly. For full extended multiplexing state, including signals of the form `m<N>M`, use kvaDbSetSignalMuxState.
- Parameters
-
[in] sh A signal handle [in] mux Signal's multiplex mode
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
- See also
- KVADB_MUX_xxx
kvaDbSetSignalMux()
| KvaDbStatus kvaDbSetSignalMux | ( | KvaDbSignalHnd | sh, |
| KvaDbSignalHnd | msh | ||
| ) |
Sets the immediate parent selector signal for an extended multiplexed signal. Pass NULL in msh to clear the selector reference.
Both signals must belong to the same message.
- Parameters
-
[in] sh A signal handle [in] msh Selector signal handle, or NULL
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
kvaDbSetSignalMuxState()
| KvaDbStatus kvaDbSetSignalMuxState | ( | KvaDbSignalHnd | sh, |
| int | is_selector, | ||
| int | mode | ||
| ) |
Sets the exact multiplexing state of a signal.
Pass non-zero in is_selector to mark the signal as a selector signal. Pass KVADB_MUX_INDEPENDENT in mode for a non-dependent signal, or a non-negative value for a dependent signal. This allows expressing `M`, `m<N>`, and `m<N>M`.
- Parameters
-
[in] sh A signal handle [in] is_selector Non-zero if the signal should act as a selector [in] mode KVADB_MUX_INDEPENDENT or the dependent mode value
- 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] sh A signal handle [in] buf The 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] sh A signal handle [in] t The signal representation type, KvaDbSignalType
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
- 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] sh A signal handle [in] buf The 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] sh A signal handle [in] minval The minimum signal value [in] maxval The 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] sh A signal handle [in] factor The scale factor for the signal value [in] offset The 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] sh A signal handle [in] startbit The starting bit of the signal's value [in] length The length of the value in bits
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
- Note
- In case of Motorola encoding,
startbitis 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] sh A signal handle [out] can_data The buffer that will hold the converted value [in] len The length of the data buffer [in] value The 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] sh A signal handle [out] can_data The buffer that will hold the converted value [in] len The length of the data buffer [in] value The 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] sh A signal handle [out] can_data The buffer that will hold the converted value [in] len The length of the data buffer [in] value The raw signal value to convert (64-bits)
- Returns
- kvaDbOK (zero) if success
- kvaDbErr_xxx (negative) if failure
- See also
- kvaDbRetrieveSignalValueRaw64()