mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cc110x: only set info values if != NULL
This commit is contained in:
parent
e0732a5a81
commit
64ec89e9cb
@ -52,7 +52,6 @@ static int _recv(netdev2_t *dev, char* buf, int len, void *info)
|
||||
DEBUG("%s:%u\n", __func__, __LINE__);
|
||||
|
||||
cc110x_t *cc110x = &((netdev2_cc110x_t*) dev)->cc110x;
|
||||
netdev2_cc110x_rx_info_t *cc110x_info = info;
|
||||
|
||||
cc110x_pkt_t *cc110x_pkt = &cc110x->pkt_buf.packet;
|
||||
if (cc110x_pkt->length > len) {
|
||||
@ -60,8 +59,12 @@ static int _recv(netdev2_t *dev, char* buf, int len, void *info)
|
||||
}
|
||||
|
||||
memcpy(buf, (void*)cc110x_pkt, cc110x_pkt->length);
|
||||
cc110x_info->rssi = cc110x->pkt_buf.rssi;
|
||||
cc110x_info->lqi = cc110x->pkt_buf.lqi;
|
||||
if (info != NULL) {
|
||||
netdev2_cc110x_rx_info_t *cc110x_info = info;
|
||||
|
||||
cc110x_info->rssi = cc110x->pkt_buf.rssi;
|
||||
cc110x_info->lqi = cc110x->pkt_buf.lqi;
|
||||
}
|
||||
return cc110x_pkt->length;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user