Added send_mac_slot_indications() and updated timing info procedure
This commit is contained in:
@@ -802,7 +802,7 @@ void vnf_handle_vendor_extension(void* pRecvMsg, int recvMsgLen, nfapi_vnf_confi
|
||||
if(msg)
|
||||
{
|
||||
if(nfapi_p5_message_unpack(pRecvMsg, recvMsgLen, msg, msg_size, &config->codec_config) >= 0)
|
||||
{
|
||||
{ṭ
|
||||
if(config->vendor_ext)
|
||||
config->vendor_ext(config, p5_idx, msg);
|
||||
}
|
||||
|
||||
@@ -367,6 +367,26 @@ uint16_t increment_sfn_sf_by(uint16_t sfn_sf, uint8_t increment)
|
||||
return sfn_sf;
|
||||
}
|
||||
|
||||
int send_mac_slot_indications(vnf_p7_t* vnf_p7)
|
||||
{
|
||||
nfapi_vnf_p7_connection_info_t* curr = vnf_p7->p7_connections;
|
||||
while(curr != 0)
|
||||
{
|
||||
if(curr->in_sync == 1)
|
||||
{
|
||||
// ask for subframes in the future
|
||||
//uint16_t sfn_sf_adv = increment_sfn_sf_by(curr->sfn_sf, 2);
|
||||
|
||||
//vnf_p7->_public.subframe_indication(&(vnf_p7->_public), curr->phy_id, sfn_sf_adv);
|
||||
// suggestion fix by Haruki NAOI
|
||||
vnf_p7->_public.slot_indication(&(vnf_p7->_public), curr->phy_id, curr->sfn,curr->slot);
|
||||
}
|
||||
|
||||
curr = curr->next;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int send_mac_subframe_indications(vnf_p7_t* vnf_p7)
|
||||
{
|
||||
@@ -1268,17 +1288,18 @@ void vnf_handle_timing_info(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7)
|
||||
|
||||
if (vnf_p7 && vnf_p7->p7_connections)
|
||||
{
|
||||
int16_t vnf_pnf_sfnsf_delta = NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf) - NFAPI_SFNSF2DEC(ind.last_sfn_sf);
|
||||
|
||||
//int16_t vnf_pnf_sfnsf_delta = NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf) - NFAPI_SFNSF2DEC(ind.last_sfn_sf);
|
||||
int16_t vnf_pnf_sfnslot_delta = NFAPI_SFNSLOT2DEC(vnf_p7->p7_connections[0].sfn,vnf_p7->p7_connections[0].slot) - NFAPI_SFNSLOT2DEC(ind.last_sfn,ind.last_slot);
|
||||
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PNF:SFN/SF:%d VNF:SFN/SF:%d deltaSFNSF:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind.last_sfn_sf), NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), vnf_pnf_sfnsf_delta);
|
||||
|
||||
// Panos: Careful here!!! Modification of the original nfapi-code
|
||||
//if (vnf_pnf_sfnsf_delta>1 || vnf_pnf_sfnsf_delta < -1)
|
||||
if (vnf_pnf_sfnsf_delta>0 || vnf_pnf_sfnsf_delta < 0)
|
||||
if (vnf_pnf_sfnslot_delta>0 || vnf_pnf_sfnslot_delta < 0)
|
||||
{
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SF DELTA between PNF and VNF delta:%d VNF:%d PNF:%d\n\n\n\n\n\n\n\n\n", __FUNCTION__, vnf_pnf_sfnsf_delta, NFAPI_SFNSF2DEC(vnf_p7->p7_connections[0].sfn_sf), NFAPI_SFNSF2DEC(ind.last_sfn_sf));
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() LARGE SFN/SF DELTA between PNF and VNF delta:%d VNF:%d PNF:%d\n\n\n\n\n\n\n\n\n", __FUNCTION__, vnf_pnf_sfnslot_delta,NFAPI_SFNSLOT2DEC(vnf_p7->p7_connections[0].sfn,vnf_p7->p7_connections[0].slot),NFAPI_SFNSLOT2DEC(ind.last_sfn,ind.last_slot)) ;
|
||||
// Panos: Careful here!!! Modification of the original nfapi-code
|
||||
vnf_p7->p7_connections[0].sfn_sf = ind.last_sfn_sf;
|
||||
vnf_p7->p7_connections[0].sfn = ind.last_sfn;
|
||||
vnf_p7->p7_connections[0].slot = ind.last_slot;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,13 +158,13 @@ int nfapi_vnf_p7_start(nfapi_vnf_p7_config_t* config)
|
||||
|
||||
struct timespec sf_duration;
|
||||
sf_duration.tv_sec = 0;
|
||||
sf_duration.tv_nsec = 1e6; // We want 1ms pause
|
||||
sf_duration.tv_nsec = 0.5e6; // We want 1ms pause //We want 0.5 ms pause for NR
|
||||
|
||||
struct timespec sf_start;
|
||||
clock_gettime(CLOCK_MONOTONIC, &sf_start);
|
||||
long millisecond = sf_start.tv_nsec / 1e6;
|
||||
long millisecond = sf_start.tv_nsec / 1e6; //Check if we have to change
|
||||
sf_start = timespec_add(sf_start, sf_duration);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "next subframe will start at %d.%d\n", sf_start.tv_sec, sf_start.tv_nsec);
|
||||
NFAPI_TRACE(NFAPI_TRACE_INFO, "next slot will start at %d.%d\n", sf_start.tv_sec, sf_start.tv_nsec);
|
||||
|
||||
while(vnf_p7->terminate == 0)
|
||||
{
|
||||
@@ -361,14 +361,28 @@ if (selectRetval==-1 && errno == 22)
|
||||
|
||||
while(curr != 0)
|
||||
{
|
||||
curr->sfn_sf = increment_sfn_sf(curr->sfn_sf);
|
||||
|
||||
if (curr->slot == 19)
|
||||
{
|
||||
curr->sfn++;
|
||||
}
|
||||
else if(curr->slot > 19)
|
||||
{
|
||||
//error
|
||||
}
|
||||
else
|
||||
{
|
||||
curr->slot++;
|
||||
}
|
||||
//curr->sfn_sf = increment_sfn_sf(curr->sfn_sf);
|
||||
|
||||
vnf_sync(vnf_p7, curr);
|
||||
|
||||
curr = curr->next;
|
||||
}
|
||||
|
||||
send_mac_subframe_indications(vnf_p7);
|
||||
//send_mac_subframe_indications(vnf_p7);
|
||||
send_mac_slot_indications(vnf_p7);
|
||||
|
||||
}
|
||||
else if(selectRetval > 0)
|
||||
|
||||
Reference in New Issue
Block a user