Skip to content

Commit f16ceb3

Browse files
committed
drivers/sx126x: always report back that netdev is LoRa
No network stack in RIOT is prepared for hardware to change its device type at runtime. Especially the unknown network device is just not handled and causes assertions to blow. Instead, the driver now just returns to be a LoRa radio regardless of configured modulation.
1 parent ea23157 commit f16ceb3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/sx126x/sx126x_netdev.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,7 @@ static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)
245245

246246
case NETOPT_DEVICE_TYPE:
247247
assert(max_len >= sizeof(uint16_t));
248-
sx126x_pkt_type_t pkt_type;
249-
sx126x_get_pkt_type(dev, &pkt_type);
250-
*((uint16_t *)val) =
251-
(pkt_type == SX126X_PKT_TYPE_LORA) ? NETDEV_TYPE_LORA : NETDEV_TYPE_UNKNOWN;
248+
*((uint16_t *)val) = NETDEV_TYPE_LORA;
252249
return sizeof(uint16_t);
253250

254251
case NETOPT_CHANNEL_FREQUENCY:

0 commit comments

Comments
 (0)