-
-
Notifications
You must be signed in to change notification settings - Fork 284
Jira 857, 858, BLEPeripherial connect issues #447
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
Conversation
…t triggered 1. Root casue: The callback regiter before the begin and the begin reset the callback. 2. Solution: Remove it from the init method and init it when create.
1. Root casue: the stack need use connected device to get the state. The current code used local address to get the link and get an error. 2. Solution: Use central's address to get connection state.
@bigdinotech , @eriknyquist , please review the code changes. @noelpaz , @russmcinnis , please system test the changes. Please use the sample sketch in the gitHub issues to check out the fixes. |
@@ -21,7 +21,7 @@ | |||
|
|||
#include "BLEPeripheral.h" | |||
|
|||
static BLEPeripheralEventHandler m_eventHandlers[BLEDeviceLastEvent]; | |||
static BLEPeripheralEventHandler m_eventHandlers[BLEDeviceLastEvent] = {NULL, NULL, NULL, 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.
This is unncessary-- m_evenHandlers
is declared static, so it will be located in .bss
All elements will be initialized to 0 by default, so there is no need to explicitly initialize.
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.
Agree. The global variable is in _bss segment and it is clear out on boot. In addition, the initialization is hard code to 4 which may not be true in future.
@sgbihu , please remove the initialization, stay with the previous code for this item. Please make the correction and make another push ASAP. Pencil down this Friday.
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.
@eriknyquist , correction made and it is in a new PR, #455.
Jira 857. BLEPeripheral::connect() return false, git 444.
Jira 858. Cannot trigger BLEConnected and BLEDisconnected events, git 445.
Both related connection issues are address in this PR.