X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=mc-core%2Fmc%2Fdata_gen%2Fdc_gen.py;h=85b959f9a42b13d341b0363c7f43440a1383b86f;hb=HEAD;hp=36381495463cf64f69f0faa655f0e0acb5a2f929;hpb=31d238a2cba18b87e05a7d9b4820db2c5186c658;p=ric-app%2Fmc.git diff --git a/mc-core/mc/data_gen/dc_gen.py b/mc-core/mc/data_gen/dc_gen.py index 3638149..85b959f 100644 --- a/mc-core/mc/data_gen/dc_gen.py +++ b/mc-core/mc/data_gen/dc_gen.py @@ -18,6 +18,7 @@ import sys import random import time import os +import datetime import sgnb_reconfiguration_complete_pb2 import ue_context_release_pb2 @@ -43,6 +44,13 @@ def process_conn_record(ofl,gnb_id, ue_id, ts): # print "Connected ue_iud="+str(ue_id)+", gnb_id="+str(gnb_id) X2APStreaming = x2ap_streaming_pb2.X2APStreaming() # header message X2APStreaming.header.gNbID.value = "Bar" + sec = ts / 1000 + ms = ts % 1000 + utc_time = datetime.datetime.utcfromtimestamp(sec) + diff = utc_time - datetime.datetime(1900, 1, 1, 0, 0, 0) + ntp_hi = diff.days*24*60*60+diff.seconds + ntp_lo = (ms << 32) / 1000 + X2APStreaming.header.timestamp = ntp_hi << 32 | ntp_lo # root = sgnb_reconfiguration_complete_pb2.SgNBReconfigurationComplete() root = X2APStreaming.sgNBReconfigurationComplete @@ -69,6 +77,13 @@ def process_dis_record(ofl, gnb_id, old_enb_id, new_enb_id, ts): # print "Disconnected old_ue_iud="+str(old_enb_id)+", gnb_id="+str(gnb_id)+", new_ue_id="+str(new_enb_id) X2APStreaming = x2ap_streaming_pb2.X2APStreaming() # header message X2APStreaming.header.gNbID.value = "Bar" + sec = ts / 1000 + ms = ts % 1000 + utc_time = datetime.datetime.utcfromtimestamp(sec) + diff = utc_time - datetime.datetime(1900, 1, 1, 0, 0, 0) + ntp_hi = diff.days*24*60*60+diff.seconds + ntp_lo = (ms << 32) / 1000 + X2APStreaming.header.timestamp = ntp_hi << 32 | ntp_lo # root = ue_context_release_pb2.UEContextRelease() root = X2APStreaming.ueContextRelease