Skip to content

Conversation

@adaskar
Copy link

@adaskar adaskar commented Dec 6, 2025

  • Add 7 configurable OSDP timeout/retry constants to CMakeLists.txt
  • Update osdp_config.h.in to use CMake variable substitution for configurable constants
  • Add command-line options to configure.sh for configurable constants
  • Keep 10 constants hardcoded (buffer sizes, limits, offsets, short timeouts) as they should not be changed
  • Maintain full backward compatibility with existing builds
  • All configurable constants default to their original hardcoded values

Configurable constants:

  • OSDP_PD_SC_RETRY_MS
  • OSDP_PD_SC_TIMEOUT_MS
  • OSDP_PD_ONLINE_TOUT_MS
  • OSDP_CMD_MAX_RETRIES
  • OSDP_ONLINE_RETRY_WAIT_MAX_MS
  • OSDP_CMD_RETRY_WAIT_MS
  • OSDP_FILE_ERROR_RETRY_MAX

Hardcoded constants (not configurable):

  • OSDP_PD_POLL_TIMEOUT_MS (50)
  • OSDP_RESP_TOUT_MS (200)
  • OSDP_PACKET_BUF_SIZE (256)
  • OSDP_RX_RB_SIZE (512)
  • OSDP_CP_CMD_POOL_SIZE (4)
  • OSDP_PD_MAX (126)
  • OSDP_CMD_ID_OFFSET (5)
  • OSDP_PCAP_LINK_TYPE (162)
  • OSDP_PD_NAME_MAXLEN (16)
  • OSDP_MINIMUM_PACKET_SIZE (128)

Users can now configure timeout/retry values via:

  • CMake: -DOSDP_ONLINE_RETRY_WAIT_MAX_MS=3000
  • configure.sh: --osdp-online-retry-wait-max-ms 3000

- Add 7 configurable OSDP timeout/retry constants to CMakeLists.txt
- Update osdp_config.h.in to use CMake variable substitution for configurable constants
- Add command-line options to configure.sh for configurable constants
- Keep 10 constants hardcoded (buffer sizes, limits, offsets, short timeouts) as they should not be changed
- Maintain full backward compatibility with existing builds
- All configurable constants default to their original hardcoded values

Configurable constants:
- OSDP_PD_SC_RETRY_MS
- OSDP_PD_SC_TIMEOUT_MS
- OSDP_PD_ONLINE_TOUT_MS
- OSDP_CMD_MAX_RETRIES
- OSDP_ONLINE_RETRY_WAIT_MAX_MS
- OSDP_CMD_RETRY_WAIT_MS
- OSDP_FILE_ERROR_RETRY_MAX

Hardcoded constants (not configurable):
- OSDP_PD_POLL_TIMEOUT_MS (50)
- OSDP_RESP_TOUT_MS (200)
- OSDP_PACKET_BUF_SIZE (256)
- OSDP_RX_RB_SIZE (512)
- OSDP_CP_CMD_POOL_SIZE (4)
- OSDP_PD_MAX (126)
- OSDP_CMD_ID_OFFSET (5)
- OSDP_PCAP_LINK_TYPE (162)
- OSDP_PD_NAME_MAXLEN (16)
- OSDP_MINIMUM_PACKET_SIZE (128)

Users can now configure timeout/retry values via:
- CMake: -DOSDP_ONLINE_RETRY_WAIT_MAX_MS=3000
- configure.sh: --osdp-online-retry-wait-max-ms 3000
@adaskar
Copy link
Author

adaskar commented Dec 6, 2025

Fixes #263

@sidcha
Copy link
Member

sidcha commented Dec 13, 2025

Thanks for the PR, looks good, but the approach may not be the best. Closing this PR for now, let's discuss this further in that thread and if needed we can reopen this PR.

@sidcha sidcha closed this Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants