Skip to content

Jira 857, 858, BLEPeripherial connect issues - #447

Closed
sgbihu wants to merge 2 commits into
arduino:masterfrom
sgbihu:peripheralconnect
Closed

Jira 857, 858, BLEPeripherial connect issues#447
sgbihu wants to merge 2 commits into
arduino:masterfrom
sgbihu:peripheralconnect

Conversation

@sgbihu

@sgbihu sgbihu commented Feb 20, 2017

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

#include "BLEPeripheral.h"

static BLEPeripheralEventHandler m_eventHandlers[BLEDeviceLastEvent];
static BLEPeripheralEventHandler m_eventHandlers[BLEDeviceLastEvent] = {NULL, NULL, NULL, NULL};

@eriknyquist eriknyquist Feb 22, 2017

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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