From b9c1358b8b057cdd41361151057b3d6b50df2f70 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 14 Nov 2020 14:28:33 +0000 Subject: [PATCH] const corectness, and nullptr instead of NULL --- src/utility/HCI.cpp | 4 ++-- src/utility/HCI.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utility/HCI.cpp b/src/utility/HCI.cpp index a99ffaf1..6101a6c9 100644 --- a/src/utility/HCI.cpp +++ b/src/utility/HCI.cpp @@ -616,7 +616,7 @@ int HCIClass::tryResolveAddress(uint8_t* BDAddr, uint8_t* address){ return 0; } -int HCIClass::sendAclPkt(uint16_t handle, uint8_t cid, uint8_t plen, void* data) +int HCIClass::sendAclPkt(uint16_t handle, uint8_t cid, uint8_t plen, const void* data) { while (_pendingPkt >= _maxPkt) { poll(); @@ -673,7 +673,7 @@ void HCIClass::noDebug() _debug = NULL; } -int HCIClass::sendCommand(uint16_t opcode, uint8_t plen, void* parameters) +int HCIClass::sendCommand(uint16_t opcode, uint8_t plen, const void* parameters) { struct __attribute__ ((packed)) { uint8_t pktType; diff --git a/src/utility/HCI.h b/src/utility/HCI.h index b8f88538..f07ed3d7 100644 --- a/src/utility/HCI.h +++ b/src/utility/HCI.h @@ -110,7 +110,7 @@ class HCIClass { virtual int writeLK(uint8_t peerAddress[], uint8_t LK[]); virtual int tryResolveAddress(uint8_t* BDAddr, uint8_t* address); - virtual int sendAclPkt(uint16_t handle, uint8_t cid, uint8_t plen, void* data); + virtual int sendAclPkt(uint16_t handle, uint8_t cid, uint8_t plen, const void* data); virtual int disconnect(uint16_t handle); @@ -118,7 +118,7 @@ class HCIClass { virtual void noDebug(); // TODO: Send command be private again & use ATT implementation of send command within ATT. - virtual int sendCommand(uint16_t opcode, uint8_t plen = 0, void* parameters = NULL); + virtual int sendCommand(uint16_t opcode, uint8_t plen = 0, const void* parameters = nullptr); uint8_t remotePublicKeyBuffer[64]; uint8_t localPublicKeyBuffer[64]; uint8_t remoteDHKeyCheckBuffer[16];