Skip to content

Commit

Permalink
drivers/atwinc15x0: adapt NETOPT_RSSI to int16_t
Browse files Browse the repository at this point in the history
  • Loading branch information
jia200x committed Jan 17, 2022
1 parent 9955a35 commit d6899f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/atwinc15x0/atwinc15x0_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static int _atwinc15x0_get(netdev_t *netdev, netopt_t opt, void *val,
return sizeof(uint16_t);

case NETOPT_RSSI:
assert(max_len == sizeof(int8_t));
assert(max_len == sizeof(int16_t));
_rssi_info_ready = false;
/* trigger the request current RSSI (asynchronous function) */
if (m2m_wifi_req_curr_rssi() != M2M_SUCCESS) {
Expand All @@ -384,8 +384,8 @@ static int _atwinc15x0_get(netdev_t *netdev, netopt_t opt, void *val,
ztimer_sleep(ZTIMER_MSEC, ATWINC15X0_WAIT_TIME_MS);
}
/* return the RSSI */
*((int8_t *)val) = dev->rssi;
return sizeof(int8_t);
*((int16_t *)val) = dev->rssi;
return sizeof(int16_t);

default:
return netdev_eth_get(netdev, opt, val, max_len);
Expand Down

0 comments on commit d6899f4

Please sign in to comment.