Skip to content

Conversation

@songmeo
Copy link
Contributor

@songmeo songmeo commented Aug 12, 2025

closes #221

@songmeo songmeo linked an issue Aug 12, 2025 that may be closed by this pull request
@songmeo songmeo marked this pull request as ready for review August 12, 2025 10:35
@songmeo songmeo requested a review from pavel-kirienko August 12, 2025 10:35
#define CRC_INITIAL 0xFFFFU
#define CRC_RESIDUE 0x0000U
#define CRC_SIZE_BYTES 2U
#define PORT_ID_MINIMUM 49152
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this for?

Comment on lines 1390 to 1391
(((transfer_kind == CanardTransferKindMessage) && (port_id <= CANARD_SUBJECT_ID_MAX)) ||
(port_id <= CANARD_SERVICE_ID_MAX)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract these into a port_id_ok variable to enhance readability, and remove the extra blank line.

@sonarqubecloud
Copy link

@songmeo songmeo requested a review from pavel-kirienko August 12, 2025 13:54
@pavel-kirienko pavel-kirienko merged commit a421943 into master Aug 12, 2025
17 checks passed
@pavel-kirienko pavel-kirienko deleted the 221-check-port-id-range branch August 12, 2025 13:59
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.

canardRxSubscribe: check if port_id is within allowed range

3 participants