Connectivity events and API#1159
Conversation
There was a problem hiding this comment.
Cppcheck (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
18e4182 to
9b3d7f6
Compare
f27d29e to
67437ee
Compare
| */ | ||
| void z_closure_zid_call(const z_loaned_closure_zid_t *closure, const z_id_t *id); | ||
|
|
||
| #if Z_FEATURE_CONNECTIVITY == 1 |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 2009 with no text in the supplied rule-texts-file Warning
|
|
||
| _Z_OWNED_FUNCTIONS_DEF(cancellation_token) | ||
|
|
||
| #if Z_FEATURE_CONNECTIVITY == 1 |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 2009 with no text in the supplied rule-texts-file Warning
| _Z_OWNED_FUNCTIONS_CLOSURE_DEF(closure_zid) | ||
| _Z_OWNED_FUNCTIONS_CLOSURE_DEF(closure_matching_status) | ||
| _Z_OWNED_FUNCTIONS_CLOSURE_DEF_PREFIX(ze, closure_miss) | ||
| #if Z_FEATURE_CONNECTIVITY == 1 |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 2009 with no text in the supplied rule-texts-file Warning
| */ | ||
| z_id_t z_info_zid(const z_loaned_session_t *zs); | ||
|
|
||
| #if Z_FEATURE_CONNECTIVITY == 1 |
Check warning
Code scanning / Cppcheck (reported by Codacy)
misra violation 2009 with no text in the supplied rule-texts-file Warning
4d5affd to
9687c3d
Compare
There was a problem hiding this comment.
I have some concerns about style inconsistencies here that should be cleaned up one way or another.
I’m also concerned about the introduction of goto, which the existing codebase has generally avoided to date. While goto can sometimes make control flow cleaner in C (and I think it does in this case), MISRA C:2023 (e.g. rule 15.1) discourages its use, and I do not think we should start introducing it without an explicit decision on whether we want to allow that pattern going forward. At the moment this feels inconsistent with the current style of the codebase.
Replied in the code comment. Repeating here: Using gotos here is a usual C-style rollback path, to avoid duplicating lots of code on error paths, it improves readability in general. |
|
The example doesn't demonstrate listeners functionality unlike examples in other binding, e.g. https://github.com/eclipse-zenoh/zenoh-c/blob/main/examples/z_info.c |
Connectivity status and events support for zenoh-pico, introduced in eclipse-zenoh/zenoh#2301
Z_FEATURE_UNSTABLE_API).
Related Issues
#333
#369
#1007
🏷️ Label-Based Checklist
Based on the labels applied to this PR, please complete these additional requirements:
Labels:
new feature🆕 New Feature Requirements
Since this PR adds a new feature:
Consider: Can this feature be split into smaller, incremental PRs?
Instructions:
- [ ]to- [x])This checklist updates automatically when labels change, but preserves your checked boxes.