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 1 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:

  • 0: Feature is globally disabled in the library

  • 1: Feature is globally enabled in the library

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

LWPKT_CFG_ADDR_EXTENDED

Enables 1 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:

  • 0: Feature is globally disabled in the library

  • 1: Feature is globally enabled in the library

  • 2: Feature is dynamically enabled/disabled in the library, according to the LwPKT object instance. If set to 2, 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 1 or disables 0 cmd field in the protocol.

When disabled, command part is not used

Configuration options:

  • 0: Feature is globally disabled in the library

  • 1: Feature is globally enabled in the library

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

LWPKT_CFG_CMD_EXTENDED

Enables 1 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:

  • 0: Feature is globally disabled in the library

  • 1: Feature is globally enabled in the library

  • 2: Feature is dynamically enabled/disabled in the library, according to the LwPKT object instance. If set to 2, 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 1 or disables 0 CRC check in the protocol.

Configuration options:

  • 0: Feature is globally disabled in the library

  • 1: Feature is globally enabled in the library

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

LWPKT_CFG_CRC32

Enables 1 or disables 0 CRC-32 type.

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

Configuration options:

  • 0: CRC is ˙8-bits, fixed value. -1: Feature is globally enabled in the library and CRC is set fixed to32-bits -2: Feature is dynamically enabled/disabled in the library, according to the LwPKT object instance. If set to2`, 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 1 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:

  • 0: Feature is globally disabled in the library

  • 1: Feature is globally enabled in the library

  • 2: Feature is dynamically enabled/disabled in the library, according to the LwPKT object instance. If set to 2, 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.