Replies: 1 comment
-
Yes you are correct and I missed this for sure. With all the other changes I was focused on this got overlooked. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. First things first:
In my opinion, version 2.1.0 still has some API inconsistencies that I don't understand. Some signatures seem to be C-oriented, but others seem to be C++-oriented. For example, let's look at this callback:
It's obvious that
pCharacteristic
can't be null in this callback, but the C-oriented declaration suggests that you should check for null pointers first. The second argument,connInfo
is just the opposite. It can't be null.So, to be consistent, the signature should look like this:
or
This makes it clear which arguments can be null and which cannot. In fact, null pointers are not allowed by the compiler in this way. You have one less check and the runtime error becomes a compile-time error.
What do you think? Am I wrong?
Beta Was this translation helpful? Give feedback.
All reactions