LMS API Documentation  v18.06.0
Version and update functions

Modules

 Message logging level
 

Data Structures

struct  lms_dev_info_t
 

Typedefs

typedef bool(* lms_prog_callback_t) (int bsent, int btotal, const char *progressMsg)
 
typedef void(* LMS_LogHandler) (int lvl, const char *msg)
 

Functions

API_EXPORT int CALL_CONV LMS_GetProgramModes (lms_device_t *device, lms_name_t *list)
 
API_EXPORT int CALL_CONV LMS_Program (lms_device_t *device, const char *data, size_t size, const lms_name_t mode, lms_prog_callback_t callback)
 
API_EXPORT const lms_dev_info_t *CALL_CONV LMS_GetDeviceInfo (lms_device_t *device)
 
API_EXPORT const char * LMS_GetLibraryVersion ()
 Returns API library version.
 
API_EXPORT const char *CALL_CONV LMS_GetLastErrorMessage (void)
 
API_EXPORT void LMS_RegisterLogHandler (LMS_LogHandler handler)
 

Detailed Description

The functions in this section provides ability to check device version and perform updates

Typedef Documentation

typedef void(* LMS_LogHandler) (int lvl, const char *msg)

Callback function for redirecting API messages

Parameters
lvlMessage logging level.
msgstring containing log message text.

Definition at line 1305 of file LimeSuite.h.

typedef bool(* lms_prog_callback_t) (int bsent, int btotal, const char *progressMsg)

Callback from programming processes

Parameters
bsentnumber of bytes transferred
btotaltotal number of bytes to send
progressMsgstring describing current progress state
Returns
0-continue programming, 1-abort operation

Definition at line 1228 of file LimeSuite.h.

Function Documentation

API_EXPORT const lms_dev_info_t* CALL_CONV LMS_GetDeviceInfo ( lms_device_t device)

Get device serial number and version information

Note
This function returns pointer to internal data structure that gets deallocated when device is closed. Do not attempt to read from it after closing the device. If you need to keep using device info returned by this function after closing the device, make a copy before closing the device.
Parameters
deviceDevice handle previously obtained by LMS_Open().
Returns
pointer to device info structure lms_dev_info_t
API_EXPORT const char* CALL_CONV LMS_GetLastErrorMessage ( void  )

Get the error message detailing why the last error occurred.

Deprecated:
use LMS_RegisterLogHandler() to obtain error messages
Returns
last error message.
API_EXPORT int CALL_CONV LMS_GetProgramModes ( lms_device_t device,
lms_name_t list 
)

Get the list of supported programming modes.

Parameters
deviceDevice handle previously obtained by LMS_Open().
[out]listlist of programming modes (can be NULL).
Returns
number of modes in the list, (-1) on failure
API_EXPORT int CALL_CONV LMS_Program ( lms_device_t device,
const char *  data,
size_t  size,
const lms_name_t  mode,
lms_prog_callback_t  callback 
)

Write binary firmware/bitsteam image to specified device component.

Parameters
deviceDevice handle previously obtained by LMS_Open().
dataPointer to memory containing firmware/bitsteam image
sizeSize of firmware/bitsteam image in bytes.
modeprogramming mode, use LMS_GetProgramModes to get list of modes
callbackcallback function for monitoring progress
Returns
0 on success, (-1) on failure
API_EXPORT void LMS_RegisterLogHandler ( LMS_LogHandler  handler)

Register a new system log handler. Should be called to replace the default stdio handler.

Parameters
handlerfunction for handling API messages