LED Functions

This section describes the LED functions. They are used to control and monitor the LED module of a DLN-series adapter.

Actual control of the device is due to use of commands and responses. Each function utilizes respective commands and responses. You can send such commands directly if necessary.

DlnLedGetCount()

Retrieves the total number of user-controlled LEDs

DlnLedSetState()

Configures the LED state.

DlnLedGetState()

Retrieves the current LED state.

All the functions are declared in the dln_led.h file.

Rating: 
Средняя: 1 (1 оценка)

DlnLedGetCount() Function

The DlnLedGetCount() function retrieves the total number of user-controlled LEDs available in the device.

Syntax
C/C++
DLN_RESULT DlnLedGetCount(
   HDLN handle,
   uint8_t* count
);
Parameters
handle

A handle to the DLN-series adapter.

count

A pointer to an unsigned 8-bit integer. After the function execution, this integer stores the number of user-controlled LEDs.

Return Value
DLN_RES_SUCCESS (0x00)

The function was successful.

Remarks

The DlnLedGetCount() function is declared in the dln_led.h file.

DlnLedGetState() Function

The DlnLedGetState() function retrieves the current state of the LED.

Syntax
C/C++
DLN_RESULT DlnLedGetState(
   HDLN handle,
   uint8_t ledNumber
   DLN_LED_STATE* state
);
Parameters
handle

A handle to the DLN-series adapter.

ledNumber

A number of the LED which state you want to know.

state

A pointer to the DLN_LED_STATE type, where the LED state is stored.

Return Value
DLN_RES_SUCCESS (0x00)

The function was successful.

DLN_RES_INVALID_LED_NUMBER (0xA6)

The specified LED number is not valid. Use the DlnLedGetCount()function to find the maximum possible LED number.

Remarks

The DlnLedGetState() function is declared in the dln_led.h file.

DlnLedSetState() Function

The DlnLedSetState() function sets a new state of the specified user-controlled LED.

Syntax
C/C++
DLN_RESULT DlnLedSetState(
   HDLN handle,
   uint8_t ledNumber,
   DLN_LED_STATE state
);
Parameters
handle

A handle to the DLN-series adapter.

ledNumber

The id of the LED which state you want to change.

state

The state of a LED that you want to set.

Return Value
DLN_RES_SUCCESS (0x00)

The function was successful.

DLN_RES_INVALID_LED_NUMBER (0xA6)

The specified LED number is not valid. Use the DlnLedGetCount()function to find the maximum possible LED number.

Remarks

The DlnLedSetState() function is declared in the dln_led.h file.