DLN_SET_DEVICE_ID

DLN_SET_DEVICE_ID Command

Go to response

The DLN_SET_DEVICE_ID command sets a new ID to the DLN-series adapter.

  typedef struct
  {
     DLN_MSG_HEADER header;
     uint32_t id;
  } __PACKED_ATTR DLN_SET_DEVICE_ID_CMD;

Parameters:

header

Defines the DLN message header DLN_MSG_HEADER. The header contains several predefined fields and is used to identify and route messages. When sending the command, a user must fill the following fields:

  • size - The size of the message. Must be equal to the size of the DLN_SET_DEVICE_ID_CMD structure.
  • msgId - Defines the message. For the DLN_SET_DEVICE_ID command it must be set to 0x0032. You can use the DLN_MSG_ID_SET_DEVICE_ID constant.
  • echoCounter - Can be used to link a command to a response. The response will have the same echoCounter value. This field can be any numerical value from 0 to 0xFFFF (65536).
  • handle - A handle to the DLN-series adapter. You may specify either a handle to a specific device (stream) or the HDLN_ALL_DEVICES value.
id
A new device ID to be set.

DLN_SET_DEVICE_ID Response

Go to command

The adapter sends the DLN_SET_DEVICE_ID response after the command execution. The result field informs a user if the device ID has been successfully set.

typedef struct
 {
    DLN_MSG_HEADER header;
    DLN_RESULT result;
 } __PACKED_ATTR DLN_SET_DEVICE_ID_RSP;

Parameters:

header

Defines the DLN message header DLN_MSG_HEADER. The response header contains the following fields:

  • size< - The size of the message. It is equal to the size of the DLN_SET_DEVICE_ID_RSP structure.
  • msgId - Defines the message. For the DLN_SET_DEVICE_ID response it is set to 0x0032. The DLN_MSG_ID_SET_DEVICE_ID constant can be used.
  • echoCounter - Links a command to a response. The echoCounter value is copied from the respective command header.
  • handle - A handle to the DLN-series adapter. Can be either a handle to a specific device (stream) or the HDLN_ALL_DEVICES value.
result

Contains the result of the command execution. The following values are available:

  • DLN_RES_SUCCESS - the device ID was successfully set.