Skip to content

Commit

Permalink
const corectness, and nullptr instead of NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
ollie1400 committed Jun 26, 2022
1 parent 509dbaf commit b9c1358
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/utility/HCI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/utility/HCI.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ 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);

virtual void debug(Stream& stream);
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];
Expand Down

0 comments on commit b9c1358

Please sign in to comment.