src/core/thread/mle_tlvs.hpp
uint8_t GetRouteCost(uint8_t aRouterIndex) const
    {
        if (aRouterIndex & 1)
        {
            return mRouteData[aRouterIndex + aRouterIndex / 2 + 1];
        }
        else
        {
            return static_cast<uint8_t>((mRouteData[aRouterIndex + aRouterIndex / 2] & kRouteCostMask)
                                        << kOddEntryOffset) |
                   ((mRouteData[aRouterIndex + aRouterIndex / 2 + 1] &
                     static_cast<uint8_t>(kRouteCostMask << kOddEntryOffset)) >>
                    kOddEntryOffset);
        }
    }
/**
     * This method returns the Route Cost value for a given Router index.
     *
     * @param[in]  aRouterIndex  The Router index.
     *
     * @returns The Route Cost value for a given Router index.
     *
     */
This method returns the Route Cost value for a given Router index.
@param[in]  aRouterIndex  The Router index.

@returns The Route Cost value for a given Router index.
This method returns the Route Cost value for a given Router index . @param [ in ] aRouterIndex The Router index . @returns The Route Cost value for a given Router index .
uint8_t GetRouteCost(uint8_t aRouterIndex) const
    {
        if (aRouterIndex & 1)
        {
            return mRouteData[aRouterIndex + aRouterIndex / 2 + 1];
        }
        else
        {
            return static_cast<uint8_t>((mRouteData[aRouterIndex + aRouterIndex / 2] & kRouteCostMask)
                                        << kOddEntryOffset) |
                   ((mRouteData[aRouterIndex + aRouterIndex / 2 + 1] &
                     static_cast<uint8_t>(kRouteCostMask << kOddEntryOffset)) >>
                    kOddEntryOffset);
        }
    }
uint8_t GetRouteCost ( uint8_t aRouterIndex ) const { if ( aRouterIndex & 1 ) { return mRouteData [ aRouterIndex + aRouterIndex / 2 + 1 ] ; } else { return static_cast < uint8_t > ( ( mRouteData [ aRouterIndex + aRouterIndex / 2 ] & kRouteCostMask ) << kOddEntryOffset ) | ( ( mRouteData [ aRouterIndex + aRouterIndex / 2 + 1 ] & static_cast < uint8_t > ( kRouteCostMask << kOddEntryOffset ) ) >> kOddEntryOffset ) ; } }
This method returns the Route Cost value for a given Router index.
This method returns the Route Cost value for a given Router index .