Configuration

This is the default configuration of the middleware. When any of the settings shall be modified, it shall be done in dedicated application config lwpkt_opts.h file.

Note

Check Getting started for guidelines on how to create and use configuration file.

group LWPKT_OPT

Default configuration setup.

Defines

LWPKT_MEMSET(dst, val, len)

Memory set function.

Note

Function footprint is the same as memset

LWPKT_MEMCPY(dst, src, len)

Memory copy function.

Note

Function footprint is the same as memcpy

LWPKT_CFG_MAX_DATA_LEN

Maximum length of data part of the packet in units of bytes.

LWPKT_CFG_ADDR_BROADCAST

Address identifying broadcast message to all devices.

LWPKT_CFG_USE_ADDR

Enables > 0 or disables 0 from and to fields in the protocol.

This features is useful if communication is between 2 devices exclusively, without addressing requirements

Configuration options:

  • LWPKT_OFF: Feature is globally disabled in the library

  • LWPKT_ON_STATIC: Feature is globally enabled in the library

  • LWPKT_ON_DYNAMIC: Feature is dynamically enabled/disabled in the library, according to the LwPKT object instance. If set to LWPKT_ON_DYNAMIC, feature is by default enabled, but it can be disabled with appropriate API function.

LWPKT_CFG_ADDR_EXTENDED

Enables > 0 or disables 0 extended address length.

When enabled, multi-byte variable length encoding is used for data storage. Maximum address is limited to 32-bits.

When disabled, simple 8-bit address is fixed with single byte.

Configuration options:

  • LWPKT_OFF: Feature is globally disabled in the library

  • LWPKT_ON_STATIC: Feature is globally enabled in the library

  • LWPKT_ON_DYNAMIC: Feature is dynamically enabled/disabled in the library, according to the LwPKT object instance. If set to LWPKT_ON_DYNAMIC, feature is by default enabled, but it can be disabled with appropriate API function.

Note

LWPKT_CFG_USE_ADDR must be enabled for this feature to work

Note

Feature is disabled by default to keep architecture compatibility

LWPKT_CFG_USE_CMD

Enables > 0 or disables 0 cmd field in the protocol.

When disabled, command part is not used

Configuration options:

  • LWPKT_OFF: Feature is globally disabled in the library

  • LWPKT_ON_STATIC: Feature is globally enabled in the library

  • LWPKT_ON_DYNAMIC: Feature is dynamically enabled/disabled in the library, according to the LwPKT object instance. If set to LWPKT_ON_DYNAMIC, feature is by default enabled, but it can be disabled with appropriate API function.

LWPKT_CFG_CMD_EXTENDED

Enables > 0 or disables 0 extended command length.

When enabled, multi-byte command length is supported in the protocol and is variable length integer encoded.

When disabled, simple 8-bit address is fixed with single byte.

Configuration options:

  • LWPKT_OFF: Feature is globally disabled in the library

  • LWPKT_ON_STATIC: Feature is globally enabled in the library

  • LWPKT_ON_DYNAMIC: Feature is dynamically enabled/disabled in the library, according to the LwPKT object instance. If set to LWPKT_ON_DYNAMIC, feature is by default enabled, but it can be disabled with appropriate API function.

Note

LWPKT_CFG_USE_CMD must be enabled for this feature to work

Note

Feature is disabled by default to keep architecture compatibility

LWPKT_CFG_USE_CRC

Enables > 0 or disables 0 CRC check in the protocol.

Configuration options:

  • LWPKT_OFF: Feature is globally disabled in the library

  • LWPKT_ON_STATIC: Feature is globally enabled in the library

  • LWPKT_ON_DYNAMIC: Feature is dynamically enabled/disabled in the library, according to the LwPKT object instance. If set to LWPKT_ON_DYNAMIC, feature is by default enabled, but it can be disabled with appropriate API function.

LWPKT_CFG_CRC32

Enables > 0 or disables 0 CRC-32 type.

It controls if CRC type is set to 8-bits or 32-bits

Configuration options:

  • LWPKT_OFF: CRC is ˙8-bits, fixed value. -LWPKT_ON_STATIC: Feature is globally enabled in the library and CRC is set fixed to32-bits -LWPKT_ON_DYNAMIC: Feature is dynamically enabled/disabled in the library, according to the LwPKT object instance. If set toLWPKT_ON_DYNAMIC`, feature is by default enabled, but it can be disabled with appropriate API function.

Note

LWPKT_CFG_USE_CRC must be enabled for this feature to work

LWPKT_CFG_USE_FLAGS

Enables > 0 or disables 0 flags field in the protocol.

When enabled, multi-byte addresses are supported with MSB codification. Maximum address is limited to 32-bits.

Configuration options:

  • LWPKT_OFF: Feature is globally disabled in the library

  • LWPKT_ON_STATIC: Feature is globally enabled in the library

  • LWPKT_ON_DYNAMIC: Feature is dynamically enabled/disabled in the library, according to the LwPKT object instance. If set to LWPKT_ON_DYNAMIC, feature is by default enabled, but it can be disabled with appropriate API function.

Note

Feature is disabled by default to keep architecture compatibility

LWPKT_CFG_PROCESS_INPROG_TIMEOUT

Defines timeout time before packet is considered as not valid when too long time in data-read mode.

Used with lwpkt_process function

LWPKT_CFG_USE_EVT

Enables 1 or disables 0 event functions for read and write operations.