Robus/src/reception.c
void Recep_InterpretMsgProtocol(msg_t *msg)
{
    uint16_t i = 0;
    // Find if we are concerned by this message.
    switch (msg->header.target_mode)
    {
        case IDACK:
        case ID:
            // Check all ll_service id
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                if (msg->header.target == ctx.ll_service_table[i].id)
                {
                    MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg);
                    return;
                }
            }
            break;
        case TYPE:
            // Check all ll_service type
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                if (msg->header.target == ctx.ll_service_table[i].type)
                {
                    MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg);
                    return;
                }
            }
            break;
        case BROADCAST:
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg);
            }
            return;
            break;
        case MULTICAST:
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                if (Trgt_MulticastTargetBank((ll_service_t *)&ctx.ll_service_table[i], msg->header.target))
                {
                    //TODO manage multiple slave concerned
                    MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg);
                    return;
                }
            }
            break;
        case NODEIDACK:
        case NODEID:
            if (msg->header.target == DEFAULTID) //on default ID it's always a luos command create only one task
            {
                MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[0], msg);
                return;
            }
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg);
            }
            return;
            break;
        default:
            break;
    }
}
/******************************************************************************
 * @brief Parse msg to find all services concerned and create
 * @param msg pointer
 * @return None
 ******************************************************************************/
@brief Parse msg to find all services concerned and create
@param msg pointer
@return None
@brief Parse msg to find all services concerned and create @param msg pointer @return None
void Recep_InterpretMsgProtocol(msg_t *msg)
{
    uint16_t i = 0;
    switch (msg->header.target_mode)
    {
        case IDACK:
        case ID:
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                if (msg->header.target == ctx.ll_service_table[i].id)
                {
                    MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg);
                    return;
                }
            }
            break;
        case TYPE:
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                if (msg->header.target == ctx.ll_service_table[i].type)
                {
                    MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg);
                    return;
                }
            }
            break;
        case BROADCAST:
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg);
            }
            return;
            break;
        case MULTICAST:
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                if (Trgt_MulticastTargetBank((ll_service_t *)&ctx.ll_service_table[i], msg->header.target))
                {
                    MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg);
                    return;
                }
            }
            break;
        case NODEIDACK:
        case NODEID:
            if (msg->header.target == DEFAULTID) 
            {
                MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[0], msg);
                return;
            }
            for (i = 0; i < ctx.ll_service_number; i++)
            {
                MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg);
            }
            return;
            break;
        default:
            break;
    }
}
void Recep_InterpretMsgProtocol ( msg_t * msg ) { uint16_t i = 0 ; switch ( msg -> header . target_mode ) { case IDACK : case ID : for ( i = 0 ; i < ctx . ll_service_number ; i ++ ) { if ( msg -> header . target == ctx . ll_service_table [ i ] . id ) { MsgAlloc_LuosTaskAlloc ( ( ll_service_t * ) & ctx . ll_service_table [ i ] , msg ) ; return ; } } break ; case TYPE : for ( i = 0 ; i < ctx . ll_service_number ; i ++ ) { if ( msg -> header . target == ctx . ll_service_table [ i ] . type ) { MsgAlloc_LuosTaskAlloc ( ( ll_service_t * ) & ctx . ll_service_table [ i ] , msg ) ; return ; } } break ; case BROADCAST : for ( i = 0 ; i < ctx . ll_service_number ; i ++ ) { MsgAlloc_LuosTaskAlloc ( ( ll_service_t * ) & ctx . ll_service_table [ i ] , msg ) ; } return ; break ; case MULTICAST : for ( i = 0 ; i < ctx . ll_service_number ; i ++ ) { if ( Trgt_MulticastTargetBank ( ( ll_service_t * ) & ctx . ll_service_table [ i ] , msg -> header . target ) ) { MsgAlloc_LuosTaskAlloc ( ( ll_service_t * ) & ctx . ll_service_table [ i ] , msg ) ; return ; } } break ; case NODEIDACK : case NODEID : if ( msg -> header . target == DEFAULTID ) { MsgAlloc_LuosTaskAlloc ( ( ll_service_t * ) & ctx . ll_service_table [ 0 ] , msg ) ; return ; } for ( i = 0 ; i < ctx . ll_service_number ; i ++ ) { MsgAlloc_LuosTaskAlloc ( ( ll_service_t * ) & ctx . ll_service_table [ i ] , msg ) ; } return ; break ; default : break ; } }
@brief Parse msg to find all services concerned and create
 @param msg pointer
 @return None
@brief Parse msg to find all services concerned and create @param msg pointer @return None
// Find if we are concerned by this message. // Check all ll_service id // Check all ll_service type //TODO manage multiple slave concerned //on default ID it's always a luos command create only one task