[riot-notifications] [RIOT-OS/RIOT] net/gnrc/netif: Added CC1xxx adaption layer (#10638)

Marian Buschsieweke notifications at github.com
Wed Jan 9 18:30:10 CET 2019


maribu commented on this pull request.



> + *
+ * | Field       | Description                     |
+ * |-------------|---------------------------------|
+ * | Destination | The layer 2 destination address |
+ * | Source      | The layer 2 source address      |
+ * | Payload     | The payload (variable size)     |
+ *
+ * Please note that the payload needs to be able to carry 6LoWPAN frames.
+ *
+ * Layer 2 Broadcast
+ * =================
+ *
+ * This adaption layer assumes that the layer 2 address `0x00` is reserved for
+ * layer 2 broadcast, which is true for CC110x and CC1200 transceivers (provided
+ * they are configured accordingly). If more users of this adaption layers are
+ * added, this behaviour might needs to be more generalized.

+1 on not using a magic number.

But allowing it to be overwritten can cause trouble. Assuming another user of this adaption layer pops up that uses the code unmodified but overwrites the broadcast address e.g. to `0xff`, this device could not be used in conjunction with CC110x or CC1200 transceivers. If this case appears, I would favor to e.g. extend `cc1xxx_t` e.g. to

```C
typedef struct {
    netdev_t netdev;        /**< RIOT's interface to this driver */
    uint8_t addr;           /**< Layer 2 address of this device */
    uint8_t bcast_addr;     /**< Layer 2 address used in broadcasts  */
} cc1xxx_t;
```

(But for now I would save the one byte, as it is not yet required.)

-- 
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/10638#discussion_r246467916
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190109/cc390920/attachment.html>


More information about the notifications mailing list