[riot-notifications] [RIOT-OS/RIOT] RPL: API update suggestions (#11560)

Cenk Gündoğan notifications at github.com
Thu May 23 17:02:12 CEST 2019


cgundogan commented on this pull request.



> @@ -259,8 +259,17 @@ struct gnrc_rpl_parent {
  */
 typedef struct {
     uint16_t ocp;   /**< objective code point */
-    uint16_t (*calc_rank)(gnrc_rpl_parent_t *parent, uint16_t base_rank); /**< calculate the rank */
-    gnrc_rpl_parent_t *(*which_parent)(gnrc_rpl_parent_t *, gnrc_rpl_parent_t *); /**< retrieve the better parent */
+
+    /**
+     * @brief Calculate the rank of this node.
+     *
+     * @param[in]   dodag       RPL DODAG to calculate rank from.
+     * @param[in]   base_rank   BASE_RANK parameter as in rfc6550
+     *
+     * @return      RPL Rank of this node.
+     * @return      GNRC_RPL_INFINITE_RANK, if no rank calculation is possible.
+     */
+    uint16_t (*calc_rank)(gnrc_rpl_dodag_t *dodag, uint16_t base_rank);

I don't see the benefit of this change. The current state on master is much more flexible in the way, that a user can calculate the rank from the point of any parent. Though, whether it's needed or not I cannot judge currently. For now, we don't use the function for anything else than calculating the rank with the preferred parent as a base.

Btw: It's possible to retrieve the dodag from the parent struct.

I won't object this change, I would like to have a good explanation, though.

-- 
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/11560#pullrequestreview-241263915
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190523/2963380e/attachment.html>


More information about the notifications mailing list