[riot-notifications] [RIOT-OS/RIOT] drivers/nrf24l01p: Netdev driver for nrf24l01p (#13743)

Marian Buschsieweke notifications at github.com
Mon May 4 15:06:08 CEST 2020


@maribu commented on this pull request.



> +    if (nrf24l01p_ng_acquire(dev) < 0) {
+        DEBUG("[nrf24l01p_ng] _init(): nrf24l01p_ng_acquire() failed\n");
+        return -EIO;
+    }
+    if (dev->state != NRF24L01P_NG_STATE_POWER_DOWN) {
+        nrf24l01p_ng_transition_to_power_down(dev);
+    }
+    nrf24l01p_ng_flush_tx(dev);
+    nrf24l01p_ng_flush_rx(dev);
+    uint8_t addr_size = NRF24L01P_NG_ADDR_WIDTH;
+    uint8_t pipes = 0;
+    uint8_t cnt = 1; /* counter assures that the LSB is different
+                        for all pipe addresses*/
+    uint8_t addr_p0[] = NRF24L01P_NG_L2ADDR_AUTO;
+    if (!memcmp(dev->params.urxaddr.rxaddrpx.rx_p0, addr_p0, addr_size)) {
+        luid_base(dev->params.urxaddr.rxaddrpx.rx_p0, addr_size);

> Sorry but I do not feel well with this either because having `0xff, 0xff, 0xff, 0xff, 0xff` as broadcast address was a proprietary decision.

What do you mean by that?

> but I do not feel well with this because having 6 addresses is a key characteristic of this device.

There is no need to provide every feature the hardware has in a driver. It is more important to provide the features for which valid use cases are. Features without use cases only increase ROM size, runtime overhead, and source code complexity. This in turn often results in more bugs.

E.g. IEEE 802.11 or IEEE 802.3 devices only have one L2 address, but you can have arbitrary IPv6 and IPv4 addresses on top. I really see no use case for multiple addresses in the context of a `netdev` driver, as this will just not be exploited by that API anyway. (But having broadcast would be very valuable.)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/13743#discussion_r419420173
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200504/4bb607f5/attachment.htm>


More information about the notifications mailing list