Initialization, reading versions and other information.
More...
|
void | linInitializeLibrary (void) |
|
void | linUnloadLibrary (void) |
|
LinStatus | linGetVersion (int *major, int *minor, int *build) |
|
LinStatus | linGetFirmwareVersion (LinHandle h, unsigned char *bootVerMajor, unsigned char *bootVerMinor, unsigned char *bootVerBuild, unsigned char *appVerMajor, unsigned char *appVerMinor, unsigned char *appVerBuild) |
|
LinStatus | linGetChannelData (int channel, int item, void *buffer, size_t bufsize) |
|
unsigned long | linReadTimer (LinHandle h) |
|
Initialization, reading versions and other information.
◆ linGetChannelData()
LinStatus linGetChannelData |
( |
int |
channel, |
|
|
int |
item, |
|
|
void * |
buffer, |
|
|
size_t |
bufsize |
|
) |
| |
This function can be used to retrieve certain pieces of information about a channel.
- Note
- You must pass a channel number and not a channel handle.
- Parameters
-
[in] | channel | The number of the channel you are interested in. Channel numbers are integers in the interval beginning at 0 |
[in] | item | This parameter specifies what data to obtain for the specified channel. The value is one of the constants linCHANNELDATA_xxx. |
[out] | buffer | The address of a buffer which is to receive the data. |
[in] | bufsize | The size of the buffer to which the buffer parameter points. |
- Returns
- linOK (zero) if success
-
linERR_xxx (negative) if failure
◆ linGetFirmwareVersion()
LinStatus linGetFirmwareVersion |
( |
LinHandle |
h, |
|
|
unsigned char * |
bootVerMajor, |
|
|
unsigned char * |
bootVerMinor, |
|
|
unsigned char * |
bootVerBuild, |
|
|
unsigned char * |
appVerMajor, |
|
|
unsigned char * |
appVerMinor, |
|
|
unsigned char * |
appVerBuild |
|
) |
| |
This function retrieves the firmware version from the LIN interface.
- Note
- For newer interfaces a call to this function will return linERR_NOT_IMPLEMENTED.
Use linGetChannelData() with linCHANNELDATA_CARD_FIRMWARE_REV instead.
-
The version numbers aren't valid until linBusOn() has been called.
-
The firmware in the LIN interface is divided into two parts, the boot code and the application. The boot code is used only when reprogramming (reflashing) the LIN interface. The application handles all LIN communication.
-
Version numbers are, since the precambric era, divided into a major version number, a minor version number and a build number. These are usually written like, for example, 3.2.12. Here the major number is 3, the minor number 2 and the build number 12.
- Parameters
-
[in] | h | A handle to an open LIN channel. |
[out] | bootVerMajor | A pointer to a byte where the major version number of the boot code is stored. |
[out] | bootVerMinor | A pointer to a byte where the minor version number of the boot code is stored. |
[out] | bootVerBuild | A pointer to a byte where the build number of the boot code is stored. |
[out] | appVerMajor | A pointer to a byte where the major version number of the application code is stored. |
[out] | appVerMinor | A pointer to a byte where the minor version number of the application code is stored. |
[out] | appVerBuild | A pointer to a byte where the build number of the application is stored. |
- Returns
- linOK (zero) if success
-
linERR_xxx (negative) if failure
◆ linGetVersion()
LinStatus linGetVersion |
( |
int * |
major, |
|
|
int * |
minor, |
|
|
int * |
build |
|
) |
| |
This function retrieves the LIBLIB library version.
- Parameters
-
[out] | major | A pointer to an int where the major version number of the library is stored. |
[out] | minor | A pointer to an int where the minor version number of the library is stored. |
[out] | build | A pointer to an int where the bulid number of the library is stored. |
- Returns
- linOK (zero) if success
-
linERR_xxx (negative) if failure
◆ linInitializeLibrary()
void linInitializeLibrary |
( |
void |
| ) |
|
This function initializes the LIN library and must be called before any other LIN function is called. If this function isn't called, subsequent calls to the other LIN functions will return linERR_NOTINITIALIZED.
- See also
- linOpenChannel()
◆ linReadTimer()
Return the current timer value (used for timestamps)
- Note
- For convenience, this call returns the timer value instead of passing it in a parameter. This means that if the call fails, it will still return a value (which then is the error code, type casted to a long unsigned integer - e.g. 0xFFFFFFF2 for linERR_INVHANDLE.
- Parameters
-
[in] | h | A handle to an open LIN channel. |
- Returns
- If the call succeeds, the present timer value is returned.
◆ linUnloadLibrary()
void linUnloadLibrary |
( |
void |
| ) |
|
This function de-initializes the LIN library. After this function is called /ref linInitializeLibrary must be called before any other LIN function is called.