Skip to content

Conversation

@thekurtovic
Copy link
Collaborator

@thekurtovic thekurtovic commented Jan 11, 2025

  • Renamed desc_filter_t to NimBLEDescriptorFilter
  • Added NimBLERemoteDescriptor pointer to NimBLEDescriptorFilter
  • retrieveDescriptors changed to take NimBLEDescriptorFilter pointer
  • General cleanup

@thekurtovic thekurtovic marked this pull request as draft January 11, 2025 04:00
Copy link
Owner

@h2zero h2zero left a comment

Choose a reason for hiding this comment

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

Nice cleanup, thanks! Need to make some changes to retrieveDescriptors though.

@thekurtovic thekurtovic marked this pull request as ready for review January 11, 2025 20:27
@thekurtovic thekurtovic requested a review from h2zero January 11, 2025 20:27
@thekurtovic
Copy link
Collaborator Author

thekurtovic commented Jan 11, 2025

Only part I'm unsure about right now is whether

if (rc == BLE_HS_EDONE) {
    NimBLEUtils::taskRelease(*pTaskData, rc);
}

should be

if (rc != 0) {
    NimBLEUtils::taskRelease(*pTaskData, rc);
}

Also not sure if it's safe to group this check up with the others. Should it always return zero here or is it fine to return error->status by jumping to the end?

if (pChr->getHandle() != chr_val_handle) {
    return 0; // Descriptor not for this characteristic
}

Copy link
Owner

@h2zero h2zero left a comment

Choose a reason for hiding this comment

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

Almost there 👍

Copy link
Owner

@h2zero h2zero left a comment

Choose a reason for hiding this comment

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

Couple of thoughts to extend the changes, let me know what you think.

@thekurtovic
Copy link
Collaborator Author

thekurtovic commented Jan 13, 2025

Moved things around in descriptorDiscCB to avoid goto.
Had to change the definition of desc_filter_t to make the forward declaration work.
Updated documentation.

@thekurtovic thekurtovic force-pushed the refactor branch 2 times, most recently from 101fbb9 to ee374e7 Compare January 13, 2025 19:44
Copy link
Owner

@h2zero h2zero left a comment

Choose a reason for hiding this comment

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

Sorry to be a pain, just a couple minor items.

@thekurtovic thekurtovic force-pushed the refactor branch 3 times, most recently from 07d07e2 to d64e087 Compare January 13, 2025 20:47
@thekurtovic thekurtovic requested a review from h2zero January 13, 2025 20:47
Copy link
Owner

@h2zero h2zero left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@h2zero
Copy link
Owner

h2zero commented Jan 26, 2025

@thekurtovic Could you please rebase this? Master added a check that should remain.

@thekurtovic thekurtovic force-pushed the refactor branch 2 times, most recently from b9a59e4 to ca7502b Compare January 26, 2025 16:10
@thekurtovic
Copy link
Collaborator Author

thekurtovic commented Jan 26, 2025

Still contains the change desc_filter_t

@h2zero
Copy link
Owner

h2zero commented Jan 26, 2025

Might need to try again, I fixed the build issue but there is a merge conflict.

@thekurtovic thekurtovic force-pushed the refactor branch 2 times, most recently from 167b73a to ca7502b Compare January 26, 2025 16:58
@thekurtovic
Copy link
Collaborator Author

If I resolve the conflict then it adds an additional commit to this PR. Am I supposed to squash everything into my main commit?

@h2zero
Copy link
Owner

h2zero commented Jan 26, 2025

I can squash the commits after when merging.

* Renamed desc_filter_t to NimBLEDescriptorFilter
* Added NimBLERemoteDescriptor pointer to NimBLEDescriptorFilter
* retrieveDescriptors changed to take NimBLEDescriptorFilter pointer
* General cleanup
@h2zero
Copy link
Owner

h2zero commented Jan 26, 2025

Thanks, I rebased it and pushed back to your branch.

@thekurtovic
Copy link
Collaborator Author

thekurtovic commented Jan 26, 2025

Thanks, I was just about to try something myself.

For future reference, would this have worked?

git checkout refactor
git checkout -b temp-squash-branch
...squash commits back my original commit...
git push --force-with-lease origin refactor

Normally I just do git rebase -i HEAD~2 to handle back-to-back commits I've made, but it didn't seem so straight forward this time around since there were other unrelated commits. I guess I'll find out next time

@h2zero
Copy link
Owner

h2zero commented Jan 26, 2025

All I did was:
git rebase master,
fixed the conflicts,
git add .
git rebase --continue
git push -f origin refactor

You could squash before or after this, usually easier before.

@h2zero h2zero merged commit ffa8414 into h2zero:master Jan 26, 2025
59 checks passed
@thekurtovic
Copy link
Collaborator Author

Thanks. I was trying to rebase my branch after fixing the conflict but the rebase kept showing me commits from master only for whatever reason. I thought master was being merged into the branch opposed to the other way around. I need to lookup a git tutorial

@thekurtovic thekurtovic deleted the refactor branch January 26, 2025 19:26
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