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 Nov 14, 2020
1 parent 2fcda9c commit 0be0d09
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 @@ -413,7 +413,7 @@ int HCIClass::leConnUpdate(uint16_t handle, uint16_t minInterval, uint16_t maxIn
return sendCommand(OGF_LE_CTL << 10 | OCF_LE_CONN_UPDATE, sizeof(leConnUpdateData), &leConnUpdateData);
}

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 @@ -462,7 +462,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 @@ -64,15 +64,15 @@ class HCIClass {
virtual int leCancelConn();


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();

private:
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);

virtual void handleAclDataPkt(uint8_t plen, uint8_t pdata[]);
virtual void handleNumCompPkts(uint16_t handle, uint16_t numPkts);
Expand Down

0 comments on commit 0be0d09

Please sign in to comment.