aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Nettle <nettlep@users.noreply.github.com>2019-01-07 12:04:33 -0600
committerGitHub <noreply@github.com>2019-01-07 12:04:33 -0600
commit0c6a75f22539b5cc9f729aeae7df7cf558b53a0c (patch)
tree7abfc7c161355fa2b4690651242d454af833937b
parentImproved handling of connection counts dealing with latent disconnects on sta... (diff)
parentHciAdapter: Endian fixes (diff)
downloadgobbledegook-0c6a75f22539b5cc9f729aeae7df7cf558b53a0c.tar.gz
gobbledegook-0c6a75f22539b5cc9f729aeae7df7cf558b53a0c.tar.bz2
gobbledegook-0c6a75f22539b5cc9f729aeae7df7cf558b53a0c.zip
Merge pull request #14 from br101/endian-fix
HciAdapter: Endian fixes
-rw-r--r--src/HciAdapter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/HciAdapter.cpp b/src/HciAdapter.cpp
index eb1990f..9ab44d1 100644
--- a/src/HciAdapter.cpp
+++ b/src/HciAdapter.cpp
@@ -510,18 +510,21 @@ bool HciAdapter::sendCommand(HciHeader &request)
return false;
}
+ uint16_t code = request.code;
+ uint16_t dataSize = request.dataSize;
+
conditionalValue = -1;
std::future<bool> fut = std::async(std::launch::async,
[&]() mutable
{
- return waitForCommandResponse(request.code, kMaxEventWaitTimeMS);
+ return waitForCommandResponse(code, kMaxEventWaitTimeMS);
});
// Prepare the request to be sent (endianness correction)
request.toNetwork();
uint8_t *pRequest = reinterpret_cast<uint8_t *>(&request);
- std::vector<uint8_t> requestPacket = std::vector<uint8_t>(pRequest, pRequest + sizeof(request) + request.dataSize);
+ std::vector<uint8_t> requestPacket = std::vector<uint8_t>(pRequest, pRequest + sizeof(request) + dataSize);
if (!hciSocket.write(requestPacket))
{
return false;