[LoRaWAN] Fix typecast
This commit is contained in:
parent
0cd69b2e6f
commit
269eb2fe38
1 changed files with 1 additions and 2 deletions
|
@ -2417,8 +2417,7 @@ void LoRaWANNode::postprocessMacLinkAdr(uint8_t* ack, uint8_t cLen) {
|
||||||
int16_t LoRaWANNode::getMacCommand(uint8_t cid, LoRaWANMacCommand_t* cmd) {
|
int16_t LoRaWANNode::getMacCommand(uint8_t cid, LoRaWANMacCommand_t* cmd) {
|
||||||
for(size_t i = 0; i < RADIOLIB_LORAWAN_NUM_MAC_COMMANDS; i++) {
|
for(size_t i = 0; i < RADIOLIB_LORAWAN_NUM_MAC_COMMANDS; i++) {
|
||||||
if(MacTable[i].cid == cid) {
|
if(MacTable[i].cid == cid) {
|
||||||
LoRaWANMacCommand_t* cmdPtr = const_cast<LoRaWANMacCommand_t*>(&MacTable[i]);
|
memcpy(reinterpret_cast<void*>(cmd), reinterpret_cast<void*>(const_cast<LoRaWANMacCommand_t*>(&MacTable[i])), sizeof(LoRaWANMacCommand_t));
|
||||||
memcpy(reinterpret_cast<void*>(cmd), reinterpret_cast<void*>(cmdPtr), sizeof(LoRaWANMacCommand_t));
|
|
||||||
return(RADIOLIB_ERR_NONE);
|
return(RADIOLIB_ERR_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue