Skip to content

Weak signal doesn't trigger disconnect() and hangs in multiple places #45

Open
@fgaetani

Description

@fgaetani

I noticed several problems when disconnecting on Arduino Nano 33 BLE board. Code execution remained locked in the writeValue() function, specifically in the HCIClass::sendAclPkt() function. The code remained locked in the while loop, because the device is disconnected.

This is the original code:

while (_pendingPkt> = _maxPkt) {
    poll (); 
}

I solved this way:

int k = 0;
while (_pendingPkt> = _maxPkt) {
    k ++;
    if (k> _maxPkt) break;
    poll ();
}

Everything seems to work well, when it freezes in the cycle if the counter k exceeds _maxPkt exits the cycle.

Is this the right way to correct? Has anyone found similar problems?

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: waiting for informationMore information must be provided before work can proceedtopic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions