-
Notifications
You must be signed in to change notification settings - Fork 488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional Device Informations for ble #336
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your PR, sorry for the wait, I have been busy with other works. Please check out my review comment, I am open for any further discussion.
}; | ||
|
||
public: | ||
BLEDis(void); | ||
|
||
void setModel(const char* model); | ||
void setModel(const char* model,uint8_t length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for using this API with length, I would suggest to
- change the type of 1st parameter to
const uint8_t*
e.gsetModel(const uint8_t model, uint8_t length)
- also please implement the
const char*
as inline function as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Yes, you are right. Then inside function it must be "_model = (const char*)model;"
- Sorry, I don't know what to change, or do you mean "_model = (const char*)model;"
chars.setFixedLen(strlen(_strarr[i])); | ||
|
||
if (_strarr_length[i]) { | ||
chars.setFixedLen(_strarr_length[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- should only use the _strarr_legnth[i], there is no point to use the strlen() function anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right.
VERIFY_STATUS( chars.begin() ); | ||
chars.write(_strarr[i]); | ||
if (_strarr_length[i]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right.
} | ||
} | ||
|
||
if ( _strarr[arrcount(_strarr)-1] != NULL ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I am not familliar with PNP_ID, but why this characteristic isn't included in the above loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last characteristic from the loop is 0x2A2A (IEEE_REGULATORY_CERTIFICATION), PNP_ID is 0x2A50. So there is a big gap between last entry from loop and PNP_ID. I had no better idea than to do it seperatly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah i see the reason now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elral you should update your code then commit and push following my review. However, since you are new to PR, I will merge this and do the clean up myself. Thank you very much for the PR. Looking forward to more of your contribution in the future.
- inline function for no-length API - clean up using strarr_len - handle PNP_ID char
Added some methods for setting more device informations.
See also Issue #335