Robus/src/reception.c
luos_localhost_t Recep_NodeConcerned(header_t *header)
{
    uint16_t i = 0;
    // Find if we are concerned by this message.
    switch (header->target_mode)
    {
        case IDACK:
            ctx.rx.status.rx_error = false;
        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 LOCALHOST;
                }
            }
            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 MULTIHOST;
                }
            }
            break;
        case BROADCAST:
            if (header->target == BROADCAST_VAL)
            {
                return MULTIHOST;
            }
            break;
        case NODEIDACK:
            ctx.rx.status.rx_error = false;
        case NODEID:
            if ((header->target == 0) && (ctx.port.activ != NBR_PORT) && (ctx.port.keepLine == false))
            {
                return LOCALHOST; // discard message if ID = 0 and no Port activ
            }
            else
            {
                if ((header->target == ctx.node.node_id) && (header->target != 0))
                {
                    return LOCALHOST;
                }
            }
            break;
        case MULTICAST: // For now Multicast is disabled
        default:
            return EXTERNALHOST;
            break;
    }
    return EXTERNALHOST;
}
/******************************************************************************
 * @brief Parse msg to find a service concerne
 * @param header of message
 * @return None
 ******************************************************************************/
@brief Parse msg to find a service concerne
@param header of message
@return None
@brief Parse msg to find a service concerne @param header of message @return None
luos_localhost_t Recep_NodeConcerned(header_t *header)
{
    uint16_t i = 0;
    switch (header->target_mode)
    {
        case IDACK:
            ctx.rx.status.rx_error = false;
        case ID:
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                if ((header->target == ctx.ll_service_table[i].id))
                {
                    return LOCALHOST;
                }
            }
            break;
        case TYPE:
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                if (header->target == ctx.ll_service_table[i].type)
                {
                    return MULTIHOST;
                }
            }
            break;
        case BROADCAST:
            if (header->target == BROADCAST_VAL)
            {
                return MULTIHOST;
            }
            break;
        case NODEIDACK:
            ctx.rx.status.rx_error = false;
        case NODEID:
            if ((header->target == 0) && (ctx.port.activ != NBR_PORT) && (ctx.port.keepLine == false))
            {
                return LOCALHOST; 
            }
            else
            {
                if ((header->target == ctx.node.node_id) && (header->target != 0))
                {
                    return LOCALHOST;
                }
            }
            break;
        case MULTICAST: 
        default:
            return EXTERNALHOST;
            break;
    }
    return EXTERNALHOST;
}
luos_localhost_t Recep_NodeConcerned ( header_t * header ) { uint16_t i = 0 ; switch ( header -> target_mode ) { case IDACK : ctx . rx . status . rx_error = false ; case ID : for ( i = 0 ; i < ctx . ll_service_number ; i ++ ) { if ( ( header -> target == ctx . ll_service_table [ i ] . id ) ) { return LOCALHOST ; } } break ; case TYPE : for ( i = 0 ; i < ctx . ll_service_number ; i ++ ) { if ( header -> target == ctx . ll_service_table [ i ] . type ) { return MULTIHOST ; } } break ; case BROADCAST : if ( header -> target == BROADCAST_VAL ) { return MULTIHOST ; } break ; case NODEIDACK : ctx . rx . status . rx_error = false ; case NODEID : if ( ( header -> target == 0 ) && ( ctx . port . activ != NBR_PORT ) && ( ctx . port . keepLine == false ) ) { return LOCALHOST ; } else { if ( ( header -> target == ctx . node . node_id ) && ( header -> target != 0 ) ) { return LOCALHOST ; } } break ; case MULTICAST : default : return EXTERNALHOST ; break ; } return EXTERNALHOST ; }
@brief Parse msg to find a service concerne
 @param header of message
 @return None
@brief Parse msg to find a service concerne @param header of message @return None
// Find if we are concerned by this message. // Check all ll_service id // Check all ll_service type // discard message if ID = 0 and no Port activ // For now Multicast is disabled