[riot-notifications] [RIOT-OS/RIOT] ethernet: Add address flag helper functions (#11666)

Martine Lenders notifications at github.com
Mon Jun 10 16:56:56 CEST 2019


miri64 commented on this pull request.

Some nit-picking about naming.

> + * @param   addr    ethernet address
+ */
+static inline void ethernet_set_locally_admin(uint8_t *addr)
+{
+    addr[0] |= ETHERNET_ADDR_LOCAL_ADMIN;
+}
+
+/**
+ * @brief Clear the group address bit to signal the address as individual
+ * address
+ *
+ * @see ieee 802-2001 section 9.2
+ *
+ * @param   addr    ethernet address
+ */
+static inline void ethernet_set_individual_addr(uint8_t *addr)

`…_clear_group()` is more intuitive.

> @@ -47,6 +47,31 @@ extern "C" {
  */
 #define ETHERNET_MAX_LEN        (ETHERNET_FRAME_LEN + ETHERNET_FCS_LEN)
 
+/**
+ * @brief Set the locally administrated bit in the ethernet address.
+ *
+ * @see ieee 802-2001 section 9.2
+ *
+ * @param   addr    ethernet address
+ */
+static inline void ethernet_set_locally_admin(uint8_t *addr)

`_set_local()` is shorter ;-).

-- 
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/11666#pullrequestreview-247662290
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190610/ad0494ef/attachment.html>


More information about the notifications mailing list