Ejemplo n.º 1
0
/*!
*******************************************************************************
\brief  La fonction formate en un message les parametres de la fonction
        rrm_rb_establish_req().
\return message formate
*/
msg_t *msg_rrm_rb_establish_req(
    Instance_t               inst              , //!< instance ID
    const LCHAN_DESC        *Lchan_desc        , //!< Logical Channel Descriptor Array
    const MAC_RLC_MEAS_DESC *Mac_rlc_meas_desc , //!< MAC/RLC Measurement descriptors for RB
    L2_ID                   *L2_id             , //!< Layer 2 (MAC) IDs for link
    Transaction_t            Trans_id          , //!< Transaction ID
    unsigned char           *L3_info           , //!< Optional L3 Information
    L3_INFO_T                L3_info_t           //!< Type of L3 Information
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        rrm_rb_establish_req_t *p = RRM_CALLOC(rrm_rb_establish_req_t ,1 ) ;

        if ( p != NULL )
        {
            init_rrc_msg_head(&(msg->head),inst,RRM_RB_ESTABLISH_REQ, sizeof( rrm_rb_establish_req_t) ,Trans_id);

            memcpy(&(p->Lchan_desc), Lchan_desc, sizeof(LCHAN_DESC) );
            memcpy(&(p->Mac_rlc_meas_desc), Mac_rlc_meas_desc, sizeof(MAC_RLC_MEAS_DESC) );
            memcpy(&(p->L2_id[0]), L2_id, 2*sizeof(L2_ID) ); // SRC+DST
            p->L3_info_t    = L3_info_t ;
            if ( L3_info_t != NONE_L3 )
                memcpy( p->L3_info, L3_info, L3_info_t );
        }
        msg->data = (char *) p ;
    }
    return msg ;
}
Ejemplo n.º 2
0
/*!
*******************************************************************************
\brief  La fonction formate en un message les parametres de la fonction
        rrm_init_ch_req().
\return message formate
*/
msg_t *msg_rrm_init_ch_req(
    Instance_t        inst            , //!< instance ID
    Transaction_t     Trans_id        , //!< Transaction ID
    const LCHAN_DESC *Lchan_desc_srb0 , //!< Logical Channel Descriptor - SRB0
    const LCHAN_DESC *Lchan_desc_srb1 , //!< Logical Channel Descriptor - SRB1
    L2_ID             L2_id
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        rrm_init_ch_req_t *p = RRM_CALLOC(rrm_init_ch_req_t , 1 ) ;

        if ( p != NULL )
        {
            init_rrc_msg_head(&(msg->head),inst,RRM_INIT_CH_REQ, sizeof( rrm_init_ch_req_t ) ,Trans_id);

            memcpy(&(p->Lchan_desc_srb0), Lchan_desc_srb0, sizeof(LCHAN_DESC) );
            memcpy(&(p->Lchan_desc_srb1), Lchan_desc_srb1, sizeof(LCHAN_DESC) );
            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
        }
        msg->data = (char *) p ;
    }
    return msg ;

}
Ejemplo n.º 3
0
/*!
*******************************************************************************
\brief  La fonction formate en un message les parametres de la fonction 
        ask_freq_to_CH_3().
\return message formate
*/
msg_t *msg_ask_freq_to_CH_3( 
    Instance_t    inst, 
    L2_ID         L2_id           ,
    L2_ID         L2_id_dest      ,
    QOS_CLASS_T   QoS             ,
    Transaction_t Trans_id 
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        ask_freq_to_CH_t *p = RRM_CALLOC(ask_freq_to_CH_t , 1 ) ;

        if ( p != NULL )
        {
            init_ip_msg_head(&(msg->head),inst,ASK_FREQ_TO_CH_3, sizeof( ask_freq_to_CH_t ) ,Trans_id);
            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
            memcpy( p->L2_id_dest.L2_id, L2_id_dest.L2_id, sizeof(L2_ID) )  ;
            p->QoS = QoS;
        }
        msg->data = (char *) p ;
    }
    return msg ;
}
Ejemplo n.º 4
0
/*!
*******************************************************************************
\brief  La fonction formate en un message les parametres de la fonction
        rrm_rb_modify_req().
\return message formate
*/
msg_t *msg_rrm_rb_modify_req(
    Instance_t               inst          , //!< instance ID
	const LCHAN_DESC        *Lchan_desc    , //!< Logical Channel Descriptor Array
	const MAC_RLC_MEAS_DESC *Mac_meas_desc , //!< MAC/RLC Measurement descriptors for RB
	RB_ID                    Rb_id         , //!< Radio Bearer ID
	Transaction_t            Trans_id        //!< Transaction ID
	)
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        rrm_rb_modify_req_t *p = RRM_CALLOC(rrm_rb_modify_req_t , 1) ;

        if ( p != NULL )
        {
            init_rrc_msg_head(&(msg->head),inst,RRM_RB_MODIFY_REQ, sizeof( rrm_rb_modify_req_t) ,Trans_id);

            memcpy(&(p->Lchan_desc), Lchan_desc, sizeof(LCHAN_DESC) );
            memcpy(&(p->Mac_meas_desc), Mac_meas_desc, sizeof(MAC_RLC_MEAS_DESC) );

            p->Rb_id    = Rb_id ;
        }
        msg->data = (char *) p ;
    }
    return msg ;
}
Ejemplo n.º 5
0
/*!
*******************************************************************************
\brief  La fonction formate en un message les parametres de la fonction
        rrm_sensing_meas_req().
\return message formate
*/
msg_t *msg_rrm_sensing_meas_req(
    Instance_t          inst              , //!< instance ID
    L2_ID               L2_id             , //!< Layer 2 (MAC) ID
    SENSING_MEAS_DESC   Sensing_meas_desc , //!< Sensing Measurement Descriptor
    Transaction_t       Trans_id            //!< Transaction ID
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        rrm_sensing_meas_req_t *p = RRM_CALLOC(rrm_sensing_meas_req_t , 1 ) ;

        if ( p != NULL )
        {
            init_rrc_msg_head(&(msg->head),inst,RRM_SENSING_MEAS_REQ, sizeof( rrm_sensing_meas_req_t) ,Trans_id);

            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
            memcpy(&(p->Sensing_meas_desc), &Sensing_meas_desc, sizeof(SENSING_MEAS_DESC)) ;
        }
        msg->data = (char *) p ;
    }
    return msg ;

}
Ejemplo n.º 6
0
msg_t *msg_rrci_init_mr_req(
    Instance_t        inst            , //!< instance ID
    Transaction_t     Trans_id        , //!< Transaction ID
    const LCHAN_DESC *Lchan_desc_srb0 , //!< Logical Channel Descriptor - SRB0
    const LCHAN_DESC *Lchan_desc_srb1 , //!< Logical Channel Descriptor - SRB1
    unsigned char     CH_index          //!< index to identify the CH
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        rrci_init_mr_req_t *p = RRM_CALLOC(rrci_init_mr_req_t , 1 ) ;

        if ( p != NULL )
        {
            init_rrc_msg_head(&(msg->head),inst,RRCI_INIT_MR_REQ, sizeof( rrci_init_mr_req_t ) ,Trans_id);

            memcpy(&(p->Lchan_desc_srb0), Lchan_desc_srb0, sizeof(LCHAN_DESC) );
            memcpy(&(p->Lchan_desc_srb1), Lchan_desc_srb1, sizeof(LCHAN_DESC) );
            p->CH_index = CH_index ;
        }
        msg->data = (char *) p ;
    }
    return msg ;
}
Ejemplo n.º 7
0
/*!
*******************************************************************************
\brief  La fonction formate en un message les parametres de la fonction
          rrci_cx_establish_resp().
\return message formate
*/
msg_t * msg_rrci_cx_establish_resp(
    Instance_t     inst      , //!< instance ID
	Transaction_t  Trans_id  , //!< Transaction ID
	L2_ID          L2_id     , //!< Layer 2 (MAC) ID
	unsigned char *L3_info   , //!< Optional L3 Information
	L3_INFO_T      L3_info_t   //!< Type of L3 Information
        )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        rrci_cx_establish_resp_t *p = RRM_CALLOC(rrci_cx_establish_resp_t , 1 ) ;

        if ( p != NULL )
        {
            init_rrc_msg_head(&(msg->head),inst,RRCI_CX_ESTABLISH_RESP, sizeof( rrci_cx_establish_resp_t ) ,Trans_id);

            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
            p->L3_info_t    = L3_info_t     ;
            if ( L3_info_t != NONE_L3 )
                memcpy( p->L3_info, L3_info, L3_info_t );
        }
        msg->data = (char *) p ;
    }
    return msg ;
}
Ejemplo n.º 8
0
/*!
*******************************************************************************
\brief  La fonction formate en un message les parametres de la fonction 
        rrm_open_freq().
\return message formate
*/
msg_t *msg_update_open_freq_7( 
    Instance_t    inst, 
    L2_ID         L2_id           ,
    unsigned int NB_ch,
    CHANNELS_DB_T *channels, //mod_lor_10_05_17
    Transaction_t Trans_id 
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        unsigned int size = sizeof( update_open_freq_t );// + (NB_free_ch-1) * sizeof(CHANNEL_T) ;//mod_lor_10_04_23
        
        update_open_freq_t *p = RRM_CALLOC2(update_open_freq_t , size ) ;

        if ( p != NULL )
        {
            init_ip_msg_head(&(msg->head),inst,UPDATE_OPEN_FREQ_7, size ,Trans_id);
            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
            p->NB_chan       = NB_ch    ;
            
            if ( NB_ch > 0 )
            {
                memcpy( p->channels , channels, NB_ch * sizeof(CHANNELS_DB_T) )  ;
            }
        }
        msg->data = (char *) p ;
    }
    return msg ;
}
Ejemplo n.º 9
0
msg_t *msg_rrm_up_freq_ass(
        Instance_t inst             , //!< instance ID 
        L2_ID L2_id                 , //!< Layer 2 (MAC) ID of SU
        unsigned int NB_chan        , 
        CHANNEL_T *ass_channels
        )
            
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        unsigned int size = sizeof(  rrm_up_freq_ass_t );// + (NB_chan-1) * sizeof(CHANNEL_T) ;//mod_lor_10_04_23
        rrm_up_freq_ass_t *p = RRM_CALLOC2( rrm_up_freq_ass_t , size ) ;


        if ( p != NULL )
        {
        
            
            init_rrc_msg_head(&(msg->head),inst,RRM_UP_FREQ_ASS, size,0);
            p->NB_chan = NB_chan;
            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
            memcpy( p->ass_channels, ass_channels, NB_chan*sizeof(CHANNEL_T) );

        }
        msg->data = (char *) p ;
        
    }
    return msg ;
}
Ejemplo n.º 10
0
/*!
*******************************************************************************
\brief  La fonction ajoute un rb dans la liste des RB ouverts du Cluster head.

\return  retourne la valeur du nouvel element
*/
RB_desc_t *add_rb( 
        RB_desc_t     **rb_entry  , ///< pointeur sur l'entree de la liste des RB
        Transaction_t   Trans_id  , ///< transaction associee
        QOS_CLASS_T     QoS_class , ///< index de la classe de QoS
        L2_ID          *L2_id       ///< ID de niveau 2  des noeuds associes au RB
     ) 
{
    RB_desc_t *pOldEntry = *rb_entry;
    RB_desc_t *pNewItem = RRM_CALLOC( RB_desc_t , 1 ) ;
    
    PNULL(pNewItem) ;
    if ( pNewItem == NULL ) 
        return NULL ;

    pNewItem->QoS_class  =  QoS_class   ;
    
    memcpy( &(pNewItem->L2_id[0]) , L2_id, 2*sizeof(L2_ID) ) ;
    
    pNewItem->Trans_id  =  Trans_id ;
    pNewItem->Rb_id     =  0        ;
    pNewItem->RB_type   =  0;

    *rb_entry           =  pNewItem ;
    pNewItem->next      =  pOldEntry;   
    
    PRINT_RB_DB( *rb_entry );
    return pNewItem ;   
}
Ejemplo n.º 11
0
/*!
*******************************************************************************
\brief  La fonction formate en un message les parametres de la fonction 
        cmm_stop_sensing.
\return message formate
*/
msg_t *msg_stop_coll_sens_conf( 
    Instance_t inst,        //!< identification de l'instance
    L2_ID L2_id
    )
{
    msg_t *msg = RRM_CALLOC(msg_t ,1 ) ; 
    
    if ( msg != NULL )
    {
        stop_coll_sens_conf_t *p = RRM_CALLOC(stop_coll_sens_conf_t , 1 ) ;

        if ( p != NULL )
        {
            init_ip_msg_head(&(msg->head),inst,STOP_COLL_SENS_CONF, sizeof( stop_coll_sens_conf_t) ,0);            
            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
        }
        msg->data = (char *) p ;
    }
    return msg  ;
}
Ejemplo n.º 12
0
msg_t *msg_rrm_end_scan_req( 
    Instance_t    inst, 
    L2_ID         L2_id           ,
    Transaction_t Trans_id 
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        rrm_end_scan_req_t *p = RRM_CALLOC(rrm_end_scan_req_t , 1 ) ;

        if ( p != NULL )
        {
            init_rrc_msg_head(&(msg->head),inst,RRM_END_SCAN_REQ, sizeof( rrm_end_scan_req_t ) ,Trans_id);
            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
        }
        msg->data = (char *) p ;
    }
    return msg ;
}
Ejemplo n.º 13
0
/*!
*******************************************************************************
\brief  La fonction formate en un message les parametres de la fonction 
        cmm_stop_sensing.
\return message formate
*/
msg_t *msg_stop_coll_sens( 
    Instance_t inst        //!< identification de l'instance
    )
{
    msg_t *msg = RRM_CALLOC(msg_t ,1 ) ; 
    
    if ( msg != NULL )
    {
        init_ip_msg_head(&(msg->head),inst,STOP_COLL_SENS, 0 ,0);            
        msg->data = NULL ;
    }
    return msg  ;
}
Ejemplo n.º 14
0
/*!
*******************************************************************************
\brief  La fonction formate en un message les parametres de la fonction
        rrm_rb_release_req().
\return message formate
*/
msg_t *msg_rrm_rb_release_req(
    Instance_t    inst     , //!< instance ID
	RB_ID         Rb_id    , //!< Radio Bearer ID
	Transaction_t Trans_id   //!< Transaction ID
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        rrm_rb_release_req_t *p = RRM_CALLOC(rrm_rb_release_req_t , 1 ) ;

        if ( p != NULL )
        {
            init_rrc_msg_head(&(msg->head),inst,RRM_RB_RELEASE_REQ, sizeof( rrm_rb_release_req_t) ,Trans_id);

            p->Rb_id    = Rb_id ;
        }
        msg->data = (char *) p ;
    }
    return msg ;
}
Ejemplo n.º 15
0
/*!add_lor_10_11_09
*******************************************************************************
\brief  La fonction formate en un message les parametres de la fonction 
        user_disconnect.
\return message formate
*/
msg_t *msg_user_disconnect_9( 
    Instance_t inst,        //!< identification de l'instance
    L2_ID L2_id,            //!< L2_id of the user that wants to disconnect
    Transaction_t Trans_id
    )
{
    msg_t *msg = RRM_CALLOC(msg_t ,1 ) ; 
    
    if ( msg != NULL )
    {
        user_disconnect_t *p = RRM_CALLOC(user_disconnect_t , 1 ) ;

        if ( p != NULL )
        {
            init_ip_msg_head(&(msg->head),inst,USER_DISCONNECT_9, sizeof( user_disconnect_t) ,Trans_id);            
            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
        }
        msg->data = (char *) p ;
    }  
    return msg  ;

}
Ejemplo n.º 16
0
msg_t *msg_rrm_init_scan_req(
    Instance_t       inst            , //!< instance ID
    unsigned int     Start_fr,
    unsigned int     Stop_fr,
    unsigned int     Meas_band,
    unsigned int     Meas_tpf,
    unsigned int     Nb_channels,
    unsigned int     Overlap,
    unsigned int     Sampl_freq,
    Transaction_t    Trans_id          //!< Transaction ID
    
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        rrm_init_scan_req_t *p = RRM_CALLOC(rrm_init_scan_req_t , 1 ) ;

        if ( p != NULL )
        {
            init_rrc_msg_head(&(msg->head),inst,RRM_INIT_SCAN_REQ, sizeof( rrm_init_scan_req_t ) ,Trans_id);

            //mod_lor_10_03_12++
            p->Start_fr     = Start_fr;
            p->Stop_fr      = Stop_fr;
            p->Meas_band    = Meas_band;
            p->Meas_tpf     = Meas_tpf;
            p->Nb_channels  = Nb_channels;
            p->Overlap      = Overlap;
            p->Sampl_freq   = Sampl_freq;
            //mod_lor_10_03_12--
       
        }
        msg->data = (char *) p ;
    }
    return msg ;
}
Ejemplo n.º 17
0
/*!
*******************************************************************************
\brief  La fonction formate en un message les parametres de la fonction 
        open_freq_query_4().
\return message formate
*/
msg_t *msg_open_freq_query_4( 
    Instance_t    inst, 
    L2_ID         L2_id           ,
    QOS_CLASS_T   QoS             ,
    Transaction_t Trans_id 
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        open_freq_query_t *p = RRM_CALLOC(open_freq_query_t , 1 ) ;

        if ( p != NULL )
        {
            init_ip_msg_head(&(msg->head),inst,OPEN_FREQ_QUERY_4, sizeof( open_freq_query_t ) ,Trans_id);
            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
            p->QoS = QoS;
        }
        msg->data = (char *) p ;
    }
    return msg ;
}
Ejemplo n.º 18
0
/*!
*******************************************************************************
\brief  Message to be sent to a CH that will collaborate in sensing operation.
\return message formate
*/
msg_t *msg_init_coll_sens_req( 
    Instance_t       inst,        //!< instance ID of asking CH
    L2_ID L2_id                 , //!< Layer 2 (MAC) ID of asking CH
    unsigned int     Start_fr,
    unsigned int     Stop_fr,
    unsigned int     Meas_band,
    unsigned int     Meas_tpf,
    unsigned int     Nb_channels,
    unsigned int     Overlap,
    unsigned int     Sampl_freq,
    Transaction_t    Trans_id        //!< Transaction ID
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ; 
    
    if ( msg != NULL )
    {
        init_coll_sens_req_t *p = RRM_CALLOC(init_coll_sens_req_t , 1 ) ;

        if ( p != NULL )
        {
            init_ip_msg_head(&(msg->head),inst, INIT_COLL_SENS_REQ, sizeof( init_coll_sens_req_t) ,0);
            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
            p->Start_fr     = Start_fr;
            p->Stop_fr      = Stop_fr;
            p->Meas_band    = Meas_band;
            p->Meas_tpf     = Meas_tpf;
            p->Nb_channels  = Nb_channels;
            p->Overlap      = Overlap;
            p->Sampl_freq   = Sampl_freq;

        }       
        msg->data = (char *) p ;
    }
    return msg ;
}
Ejemplo n.º 19
0
/*!
*******************************************************************************
\brief  La fonction formate en un message generique de reponse pour les
          fonctions :
            - msg_rrm_sensing_meas_resp(),  msg_rrm_rb_meas_resp().
\return message formate
*/
static msg_t *msg_rrm_generic_resp(
    Instance_t    inst     , //!< instance ID
    MSG_RRC_RRM_T msg_type , //!< type of message
    Transaction_t Trans_id   //!< Transaction ID
        )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        init_rrc_msg_head(&(msg->head),inst,msg_type, 0, Trans_id);
        msg->data = NULL ;
    }
    return msg ;
}
Ejemplo n.º 20
0
/*!add_lor_10_11_09
*******************************************************************************
\brief  La fonction formate en un message les parametres de la fonction 
        user_disconnect.
\return message formate
*/
msg_t *msg_close_link( 
    Instance_t inst,        //!< identification de l'instance
    L2_ID L2_id,            //!< L2_id of the user that wants to stop the link
    L2_ID L2_id_dest,       //!< L2_id of the destination
    Transaction_t Trans_id
    )
{
    msg_t *msg = RRM_CALLOC(msg_t ,1 ) ; 
    
    if ( msg != NULL )
    {
        close_link_t *p = RRM_CALLOC(close_link_t , 1 ) ;

        if ( p != NULL )
        {
            init_ip_msg_head(&(msg->head),inst,CLOSE_LINK, sizeof( close_link_t) ,Trans_id);            
            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
            memcpy( p->L2_id_dest.L2_id, L2_id_dest.L2_id, sizeof(L2_ID) )  ;
        }
        msg->data = (char *) p ;
    }  
    return msg  ;

}
Ejemplo n.º 21
0
msg_t *msg_rrm_scan_ord( 
			Instance_t inst             , ///< instance ID 
			unsigned int NB_chan        , ///< Number of channels to sens
			unsigned int Meas_tpf       , ///< time on each carrier           //mod_lor_10_02_19
			unsigned int Overlap        , ///< overlap factor (percentage)    //mod_lor_10_02_19
			unsigned int Sampl_nb       , ///< number of samples per sub-band //mod_lor_10_04_01
			Sens_ch_t    *ch_to_scan    , ///< Vector of channels to scan     //mod_lor_10_02_19 
			Transaction_t Trans_id        ///< Transaction ID
			
        )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        unsigned int size;
        /*if ( NB_chan != 0 ){
            size = sizeof( rrm_scan_ord_t ) + (NB_chan-1) * sizeof(unsigned int) ;
            
        }else*/
            size =  sizeof( rrm_scan_ord_t );
        rrm_scan_ord_t *p = RRM_CALLOC2(rrm_scan_ord_t , size ) ;
       

        if ( p != NULL )
        {
            init_sensing_msg_head(&(msg->head),inst,RRM_SCAN_ORD, size ,Trans_id);

            p->Meas_tpf = Meas_tpf;     //mod_lor_10_02_19
            p->Overlap = Overlap;       //mod_lor_10_02_19
            p->Sampl_nb = Sampl_nb; //mod_lor_10_02_19
            p->NB_chan = NB_chan;
            
          
            if ( NB_chan != 0 ){
                
                memcpy( p->ch_to_scan, ch_to_scan, NB_chan*sizeof(Sens_ch_t) );
                
            }
			for (int i=0; i<NB_chan;i++)
				printf("scan_ord i :%d, start %d, end %d sampl %d\n",i,p->ch_to_scan[i].Start_f,p->ch_to_scan[i].Final_f,Sampl_nb);
       
        }
        msg->data = (char *) p ;
    }
    return msg ;
}
Ejemplo n.º 22
0
msg_t *msg_update_sens_results_3( 
    Instance_t inst, 
    L2_ID L2_id,                //!< FC L2_id
    unsigned int NB_info,
    Sens_ch_t *Sens_meas, 
    Transaction_t Trans_id
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ; 
        
    if ( msg != NULL )
    {
        unsigned int size = sizeof( rrm_update_sens_t );// + (NB_info-1) * sizeof(Sens_ch_t) ; //mod_lor_10_04_23
        
        rrm_update_sens_t *p = RRM_CALLOC2(rrm_update_sens_t , size ) ;

        if ( p != NULL )
        {
            //fprintf(stderr,"rrmUSR 1 \n");//dbg
            init_ip_msg_head(&(msg->head),inst, UPDATE_SENS_RESULTS_3, size ,Trans_id);

            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
        
            p->NB_info       = NB_info    ;
            p->info_time     = 0 ;
            
            if ( NB_info > 0 )
            {
                memcpy( p->Sens_meas , Sens_meas, NB_info * sizeof(Sens_ch_t) )  ;
            }
            //fprintf(stdout,"msg_rrm_update_sens()2 : NB_chan %d\n", p->NB_info);//dbg
            //fprintf(stdout,"NB_chan %d\n", p->NB_info);
              //  for (int i=0; i<NB_info; i++)
               // Sens_ch_t *ch = p->Sens_meas; ch!=NULL; ch=ch->next)
            //fprintf(stdout,"channel in msg arr: %d\n", ch->Ch_id); //dbg
            
        }
        //fprintf(stderr,"rrmUSR end \n");//dbg
        msg->data = (char *) p ;
    }
    
    return msg ;

}
Ejemplo n.º 23
0
msg_t *msg_update_SN_occ_freq_5(
        Instance_t inst             , //!< instance ID 
        L2_ID L2_id                 , //!< Layer 2 (MAC) ID of FC
        unsigned int NB_chan        ,
        unsigned int *occ_channels      , 
        Transaction_t Trans_id        //!< Transaction ID
        )
            
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;
    //fprintf(stdout,"rrc_end_scan_ord() cp1\n"); //dbg

    if ( msg != NULL )
    {
        unsigned int size = sizeof( update_SN_occ_freq_t );// + (NB_chan-1) * sizeof(unsigned int) ;//mod_lor_10_04_23
        update_SN_occ_freq_t *p = RRM_CALLOC2(update_SN_occ_freq_t , size ) ;

        if ( p != NULL )
        {
        
            
            init_ip_msg_head(&(msg->head),inst,UPDATE_SN_OCC_FREQ_5, size,Trans_id);
            
            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
            
        
            p->NB_chan = NB_chan;
            if ( NB_chan != 0 ){
                
                memcpy( p->occ_channels, occ_channels, NB_chan*sizeof(unsigned int) );
                
            }
  
       
        }
        msg->data = (char *) p ;
        
    }
    return msg ;
}
msg_t *msg_rrm_up_freq_ass_sec(
  Instance_t inst             , //!< instance ID
  L2_ID *L2_id                , //!< Layer 2 (MAC) ID vector of SUs starting tx
  L2_ID *L2_id_dest           , //!< Layer 2 (MAC) ID vector of SUs receiving tx
  unsigned int NB_all         , //!< Number of allocated links
  CHANNEL_T *ass_channels       //!< Vector of allocated links
)

{
  msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;
  int i;

  if ( msg != NULL ) {
    unsigned int size = sizeof(  rrm_up_freq_ass_sec_t );
    //printf ("size rrm_up_freq_ass_t %d\n", size);//dbg
    rrm_up_freq_ass_sec_t *p = RRM_CALLOC2( rrm_up_freq_ass_sec_t , size ) ;


    if ( p != NULL ) {


      init_rrc_msg_head(&(msg->head),inst,RRM_UP_FREQ_ASS_SEC, size,0);
      p->NB_all = NB_all;

      for (i=0; i<NB_all; i++) {
        memcpy( p->L2_id[i].L2_id, L2_id[i].L2_id, sizeof(L2_ID) )  ;
        memcpy( p->L2_id_dest[i].L2_id, L2_id_dest[i].L2_id, sizeof(L2_ID) )  ;
      }

      memcpy( p->ass_channels, ass_channels, NB_all*sizeof(CHANNEL_T) );

    }

    msg->data = (char *) p ;

  }

  return msg ;
}
Ejemplo n.º 25
0
msg_t *msg_rrm_init_mon_req(
    Instance_t        inst            , //!< instance ID
    L2_ID             L2_id           ,
    unsigned int      NB_chan         , 
    unsigned int      interval        ,
    unsigned int      *ch_to_scan     ,
    Transaction_t     Trans_id          //!< Transaction ID
    
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;

    if ( msg != NULL )
    {
        unsigned int size = sizeof( rrm_init_mon_req_t ) + (NB_chan-1) * sizeof(unsigned int) ;

        rrm_init_mon_req_t *p = RRM_CALLOC2(rrm_init_mon_req_t , size ) ;

        if ( p != NULL )
        {
            
            //for (int i=0; i<NB_chan; i++)
              //  fprintf(stdout,"msg_rrm_init_mon_req(), chan: %d\n", ch_to_scan[i]); //dbg
            init_rrc_msg_head(&(msg->head),inst,RRM_INIT_MON_REQ, size ,Trans_id);
            
            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
            p->NB_chan = NB_chan;
            p->interval = interval;
            
            if ( NB_chan != 0 )
                memcpy( p->ch_to_scan, ch_to_scan, NB_chan*sizeof(unsigned int) );
                
           
        }
        msg->data = (char *) p ;
    }
    return msg ;
}
Ejemplo n.º 26
0
msg_t *msg_up_clust_sens_results( 
    Instance_t inst, 
    L2_ID L2_id,                //!< FC L2_id
    unsigned int NB_info,
    unsigned int info_value,
    Sens_ch_t *Sens_meas, 
    Transaction_t Trans_id
    )
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ; 
        
    if ( msg != NULL )
    {
        unsigned int size = sizeof( update_coll_sens_t );// + (NB_info-1) * sizeof(Sens_ch_t) ; //mod_lor_10_04_23
        
        update_coll_sens_t *p = RRM_CALLOC2(update_coll_sens_t , size ) ;

        if ( p != NULL )
        {
            init_ip_msg_head(&(msg->head),inst, UP_CLUST_SENS_RESULTS, size ,Trans_id);

            memcpy( p->L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) )  ;
        
            p->NB_info       = NB_info    ;
            p->info_time     = 0 ;
            p->info_value    = info_value;
            
            if ( NB_info > 0 )
            {
                memcpy( p->Sens_meas , Sens_meas, NB_info * sizeof(Sens_ch_t) )  ;
            }
        }
        msg->data = (char *) p ;
    }
    
    return msg ;

}
Ejemplo n.º 27
0
msg_t *msg_rrm_end_scan_ord(
        Instance_t inst             , //!< instance ID 
        unsigned int NB_chan        ,
        unsigned int *channels      , 
        Transaction_t Trans_id        //!< Transaction ID
        )
            
{
    msg_t *msg = RRM_CALLOC(msg_t , 1 ) ;
    //fprintf(stdout,"rrc_end_scan_ord() cp1\n"); //dbg

    if ( msg != NULL )
    {
        unsigned int size = sizeof( rrm_end_scan_ord_t ); //+ (NB_chan-1) * sizeof(unsigned int) ;
        rrm_end_scan_ord_t *p = RRM_CALLOC2(rrm_end_scan_ord_t , size ) ;

        if ( p != NULL )
        {
        
            
            init_sensing_msg_head(&(msg->head),inst,RRM_END_SCAN_ORD, size,Trans_id);
            
        
            p->NB_chan = NB_chan;
            if ( NB_chan != 0 ){
                
                memcpy( p->channels, channels, NB_chan*sizeof(unsigned int) );
                
            }
  
       
        }
        msg->data = (char *) p ;
        
    }
    return msg ;
}