Skip to content

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

Closed
wants to merge 2 commits into from

Conversation

sgbihu
Copy link
Contributor

@sgbihu sgbihu commented Feb 20, 2017

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.

…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.
@kitsunami kitsunami requested a review from SidLeung February 21, 2017 23:29
@kitsunami kitsunami added this to the Deneb milestone Feb 21, 2017
@SidLeung
Copy link
Contributor

@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};
Copy link
Contributor

@eriknyquist eriknyquist Feb 22, 2017

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

@SidLeung SidLeung changed the title BLEPeripherial connect related bugs Jira 857, 858, BLEPeripherial connect issues Feb 23, 2017
@SidLeung SidLeung added the bug label Feb 23, 2017
@SidLeung
Copy link
Contributor

This PR is replaced by two separated PRs: #454 and #455.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants