Skip to content

Commit 377e9ca

Browse files
committed
Fix to receive shared data and protocol version.
1 parent d01d1c9 commit 377e9ca

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

MbitMoreService.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,17 @@ void MbitMoreService::onDataWritten(const GattWriteCallbackParams *params)
258258
listenPinEventOn((int)data[2], (int)data[3]);
259259
}
260260
}
261-
}
262-
else if (data[0] == ScratchBLECommand::CMD_SHARED_DATA)
263-
{
264-
// value is read as int16_t little-endian.
265-
int16_t value;
266-
memcpy(&value, &(data[2]), 2);
267-
sharedData[data[1]] = value;
268-
}
269-
else if (data[0] == ScratchBLECommand::CMD_PROTOCOL)
270-
{
271-
mbitMoreProtocol = data[1];
261+
else if (data[0] == ScratchBLECommand::CMD_SHARED_DATA)
262+
{
263+
// value is read as int16_t little-endian.
264+
int16_t value;
265+
memcpy(&value, &(data[2]), 2);
266+
sharedData[data[1]] = value;
267+
}
268+
else if (data[0] == ScratchBLECommand::CMD_PROTOCOL)
269+
{
270+
mbitMoreProtocol = data[1];
271+
}
272272
}
273273
}
274274

0 commit comments

Comments
 (0)