Skip to content

Commit 71e51a4

Browse files
polldogiulcioffi
authored andcommitted
[WIP] Add comments and print for revisions
1 parent d4362dd commit 71e51a4

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

Diff for: src/local/BLELocalCharacteristic.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ int BLELocalCharacteristic::writeValue(const uint8_t value[], int length)
123123

124124
GAP.setAdvertisedServiceData(serviceUuid, value, length);
125125

126+
// TO BE REVISIONED
127+
// could advertise also if connected
126128
if (!ATT.connected() && GAP.advertising()) {
129+
// if it is already advertising it should stop before requesting advertising again
127130
GAP.advertise();
128131
}
129132
}

Diff for: src/utility/HCI.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,10 @@ void HCIClass::handleEventPkt(uint8_t /*plen*/, uint8_t pdata[])
620620
uint16_t supervisionTimeout;
621621
uint8_t masterClockAccuracy;
622622
} *leConnectionComplete = (EvtLeConnectionComplete*)&pdata[sizeof(HCIEventHdr) + sizeof(LeMetaEventHeader)];
623+
624+
// CLIENT: 0x01 / PERIPHERAL: 0x00
625+
Serial.println("role:");
626+
Serial.println(leConnectionComplete->role);
623627

624628
if (leConnectionComplete->status == 0x00) {
625629
ATT.addConnection(leConnectionComplete->handle,

Diff for: src/utility/HCICordioTransport.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ size_t HCICordioTransportClass::write(const uint8_t* data, size_t length)
286286
void HCICordioTransportClass::handleRxData(uint8_t* data, uint8_t len)
287287
{
288288
if (_rxBuf.availableForStore() < len) {
289+
// This drop can cause many problems
290+
Serial.println("DROP");
289291
// drop!
290292
return;
291293
}

0 commit comments

Comments
 (0)