Robus/src/reception.c
ll_service_t *Recep_GetConcernedLLService(header_t *header)
{
    uint16_t i = 0;
    // Find if we are concerned by this message.
    switch (header->target_mode)
    {
        case IDACK:
        case ID:
            // Check all ll_service id
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                if ((header->target == ctx.ll_service_table[i].id))
                {
                    return (ll_service_t *)&ctx.ll_service_table[i];
                }
            }
            break;
        case TYPE:
            // Check all ll_service type
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                if (header->target == ctx.ll_service_table[i].type)
                {
                    return (ll_service_t *)&ctx.ll_service_table[i];
                }
            }
            break;
        case BROADCAST:
        case NODEIDACK:
        case NODEID:
            return (ll_service_t *)&ctx.ll_service_table[0];
            break;
        case MULTICAST: // For now Multicast is disabled
        default:
            return NULL;
            break;
    }
    return NULL;
}
/******************************************************************************
 * @brief Parse msg to find a service concerned
 * @param header of message
 * @return ll_service pointer
 ******************************************************************************/
@brief Parse msg to find a service concerned
@param header of message
@return ll_service pointer
@brief Parse msg to find a service concerned @param header of message @return ll_service pointer
ll_service_t *Recep_GetConcernedLLService(header_t *header)
{
    uint16_t i = 0;
    switch (header->target_mode)
    {
        case IDACK:
        case ID:
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                if ((header->target == ctx.ll_service_table[i].id))
                {
                    return (ll_service_t *)&ctx.ll_service_table[i];
                }
            }
            break;
        case TYPE:
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                if (header->target == ctx.ll_service_table[i].type)
                {
                    return (ll_service_t *)&ctx.ll_service_table[i];
                }
            }
            break;
        case BROADCAST:
        case NODEIDACK:
        case NODEID:
            return (ll_service_t *)&ctx.ll_service_table[0];
            break;
        case MULTICAST: 
        default:
            return NULL;
            break;
    }
    return NULL;
}
ll_service_t * Recep_GetConcernedLLService ( header_t * header ) { uint16_t i = 0 ; switch ( header -> target_mode ) { case IDACK : case ID : for ( i = 0 ; i < ctx . ll_service_number ; i ++ ) { if ( ( header -> target == ctx . ll_service_table [ i ] . id ) ) { return ( ll_service_t * ) & ctx . ll_service_table [ i ] ; } } break ; case TYPE : for ( i = 0 ; i < ctx . ll_service_number ; i ++ ) { if ( header -> target == ctx . ll_service_table [ i ] . type ) { return ( ll_service_t * ) & ctx . ll_service_table [ i ] ; } } break ; case BROADCAST : case NODEIDACK : case NODEID : return ( ll_service_t * ) & ctx . ll_service_table [ 0 ] ; break ; case MULTICAST : default : return NULL ; break ; } return NULL ; }
@brief Parse msg to find a service concerned
 @param header of message
 @return ll_service pointer
@brief Parse msg to find a service concerned @param header of message @return ll_service pointer
// Find if we are concerned by this message. // Check all ll_service id // Check all ll_service type // For now Multicast is disabled