Skip to content

Commit 70bcf37

Browse files
cparatafpistm
authored andcommitted
fix(HCI): SetAdvertise only if enabled
Signed-off-by: Carlo Parata <[email protected]> Co-Auhthored-by: Frederic Pillon <[email protected]>
1 parent be02723 commit 70bcf37

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/utility/HCI.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,10 @@ void HCIClass::handleEventPkt(uint8_t /*plen*/, uint8_t pdata[])
820820
ATT.removeConnection(disconnComplete->handle, disconnComplete->reason);
821821
L2CAPSignaling.removeConnection(disconnComplete->handle, disconnComplete->reason);
822822

823-
HCI.leSetAdvertiseEnable(0x01);
823+
if (GAP.advertising())
824+
{
825+
HCI.leSetAdvertiseEnable(0x01);
826+
}
824827
}
825828
else if (eventHdr->evt == EVT_ENCRYPTION_CHANGE)
826829
{

0 commit comments

Comments
 (0)