blob: 003d973bb49c8d7156b81a1fc26419c10e0698a5 [file] [log] [blame]
slowr13fa5b02017-08-08 16:32:31 -07001package org.onosproject.xran.samplemessages;
2
3import org.onosproject.xran.codecs.api.*;
4import org.onosproject.xran.codecs.pdu.*;
5import org.openmuc.jasn1.ber.types.BerInteger;
6import org.openmuc.jasn1.ber.types.string.BerUTF8String;
7
8import java.io.UnsupportedEncodingException;
9
10public class RadioReportPerUE {
11
12 public XrancPdu setPacketProperties(XrancPdu recv_pdu) {
13 ECGI ecgi = recv_pdu.getBody().getL2MeasConfig().getEcgi();
14
15 //Need to get this from UE.
16 CRNTI crnti = new CRNTI(new byte[]{(byte) 0x44, (byte) 0x44}, 16);
17 RadioRepPerServCell radioRepPerServCell = new RadioRepPerServCell();
18 PCIARFCN pciarfcn = new PCIARFCN();
19 pciarfcn.setPci(new PhysCellId(500));
20 pciarfcn.setEarfcnDl(new ARFCNValue(2100));
21 radioRepPerServCell.setPciArfcn(pciarfcn);
22
23 RadioRepPerServCell.CqiHist cqiHist = new RadioRepPerServCell.CqiHist();
24 cqiHist.setBerInteger(new BerInteger(1));
25 cqiHist.setBerInteger(new BerInteger(2));
26 cqiHist.setBerInteger(new BerInteger(3));
27 cqiHist.setBerInteger(new BerInteger(4));
28 cqiHist.setBerInteger(new BerInteger(5));
29 cqiHist.setBerInteger(new BerInteger(6));
30 cqiHist.setBerInteger(new BerInteger(7));
31 cqiHist.setBerInteger(new BerInteger(8));
32 cqiHist.setBerInteger(new BerInteger(9));
33 cqiHist.setBerInteger(new BerInteger(10));
34 cqiHist.setBerInteger(new BerInteger(11));
35 cqiHist.setBerInteger(new BerInteger(12));
36 cqiHist.setBerInteger(new BerInteger(13));
37 cqiHist.setBerInteger(new BerInteger(14));
38 cqiHist.setBerInteger(new BerInteger(15));
39 cqiHist.setBerInteger(new BerInteger(16));
40 radioRepPerServCell.setCqiHist(cqiHist);
41
42 RadioRepPerServCell.RiHist riHist = new RadioRepPerServCell.RiHist();
43 riHist.setBerInteger(new BerInteger(1));
44 riHist.setBerInteger(new BerInteger(1));
45 radioRepPerServCell.setRiHist(riHist);
46
47 RadioRepPerServCell.PuschSinrHist puschSinrHist = new RadioRepPerServCell.PuschSinrHist();
48 puschSinrHist.setBerInteger(new BerInteger(1));
49 puschSinrHist.setBerInteger(new BerInteger(2));
50 puschSinrHist.setBerInteger(new BerInteger(3));
51 puschSinrHist.setBerInteger(new BerInteger(4));
52 puschSinrHist.setBerInteger(new BerInteger(5));
53 puschSinrHist.setBerInteger(new BerInteger(6));
54 puschSinrHist.setBerInteger(new BerInteger(7));
55 puschSinrHist.setBerInteger(new BerInteger(8));
56 puschSinrHist.setBerInteger(new BerInteger(9));
57 puschSinrHist.setBerInteger(new BerInteger(10));
58 puschSinrHist.setBerInteger(new BerInteger(11));
59 puschSinrHist.setBerInteger(new BerInteger(12));
60 puschSinrHist.setBerInteger(new BerInteger(13));
61 puschSinrHist.setBerInteger(new BerInteger(14));
62 radioRepPerServCell.setPuschSinrHist(puschSinrHist);
63
64 RadioRepPerServCell.PucchSinrHist pucchSinrHist = new RadioRepPerServCell.PucchSinrHist();
65 pucchSinrHist.setBerInteger(new BerInteger(1));
66 pucchSinrHist.setBerInteger(new BerInteger(2));
67 pucchSinrHist.setBerInteger(new BerInteger(3));
68 pucchSinrHist.setBerInteger(new BerInteger(4));
69 pucchSinrHist.setBerInteger(new BerInteger(5));
70 pucchSinrHist.setBerInteger(new BerInteger(6));
71 pucchSinrHist.setBerInteger(new BerInteger(7));
72 pucchSinrHist.setBerInteger(new BerInteger(8));
73 pucchSinrHist.setBerInteger(new BerInteger(9));
74 pucchSinrHist.setBerInteger(new BerInteger(10));
75 pucchSinrHist.setBerInteger(new BerInteger(11));
76 pucchSinrHist.setBerInteger(new BerInteger(12));
77 pucchSinrHist.setBerInteger(new BerInteger(13));
78 pucchSinrHist.setBerInteger(new BerInteger(14));
79 radioRepPerServCell.setPucchSinrHist(pucchSinrHist);
80
81
82 RadioMeasReportPerUE.RadioReportServCells radioReportServCells = new RadioMeasReportPerUE.RadioReportServCells();
83 radioReportServCells.setRadioRepPerServCell(radioRepPerServCell);
84
85 RadioMeasReportPerUE radioMeasReportPerUE = new RadioMeasReportPerUE();
86 radioMeasReportPerUE.setRadioReportServCells(radioReportServCells);
87 radioMeasReportPerUE.setCrnti(crnti);
88 radioMeasReportPerUE.setEcgi(ecgi);
89
90 XrancPduBody body = new XrancPduBody();
91 body.setRadioMeasReportPerUE(radioMeasReportPerUE);
92
93 BerUTF8String ver = null;
94 try {
95 ver = new BerUTF8String("4");
96 } catch (UnsupportedEncodingException e) {
97 e.printStackTrace();
98 }
99
100 XrancApiID apiID = new XrancApiID(20);
101 XrancPduHdr hdr = new XrancPduHdr();
102 hdr.setVer(ver);
103 hdr.setApiId(apiID);
104
105 XrancPdu pdu = new XrancPdu();
106 pdu.setHdr(hdr);
107 pdu.setBody(body);
108
109 return pdu;
110
111 }
112}