slowr | 13fa5b0 | 2017-08-08 16:32:31 -0700 | [diff] [blame^] | 1 | package org.onosproject.xran.samplemessages; |
| 2 | |
| 3 | import org.onosproject.xran.codecs.api.*; |
| 4 | import org.onosproject.xran.codecs.pdu.*; |
| 5 | import org.openmuc.jasn1.ber.types.BerInteger; |
| 6 | import org.openmuc.jasn1.ber.types.string.BerUTF8String; |
| 7 | |
| 8 | import java.io.UnsupportedEncodingException; |
| 9 | |
| 10 | public class SchedReportPerUE { |
| 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 | |
| 18 | SchedMeasRepPerServCell schedMeasRepPerServCell = new SchedMeasRepPerServCell(); |
| 19 | PCIARFCN pciarfcn = new PCIARFCN(); |
| 20 | pciarfcn.setPci(new PhysCellId(500)); |
| 21 | pciarfcn.setEarfcnDl(new ARFCNValue(2100)); |
| 22 | |
| 23 | SchedMeasRepPerServCell.QciVals qciVals = new SchedMeasRepPerServCell.QciVals(); |
| 24 | qciVals.setQCI(new QCI(1)); |
| 25 | qciVals.setQCI(new QCI(2)); |
| 26 | |
| 27 | PRBUsage prbUsage = new PRBUsage(); |
| 28 | PRBUsage.PrbUsageDl prbUsageDl = new PRBUsage.PrbUsageDl(); |
| 29 | prbUsageDl.setBerInteger(new BerInteger(50)); |
| 30 | prbUsageDl.setBerInteger(new BerInteger(100)); |
| 31 | prbUsage.setPrbUsageDl(prbUsageDl); |
| 32 | |
| 33 | PRBUsage.PrbUsageUl prbUsageUl = new PRBUsage.PrbUsageUl(); |
| 34 | prbUsageUl.setBerInteger(new BerInteger(50)); |
| 35 | prbUsageUl.setBerInteger(new BerInteger(100)); |
| 36 | prbUsage.setPrbUsageUl(prbUsageUl); |
| 37 | |
| 38 | SchedMeasRepPerServCell.McsDl mcsDl = new SchedMeasRepPerServCell.McsDl(); |
| 39 | mcsDl.setBerInteger(new BerInteger(1)); |
| 40 | mcsDl.setBerInteger(new BerInteger(4)); |
| 41 | |
| 42 | SchedMeasRepPerServCell.McsUl mcsUl = new SchedMeasRepPerServCell.McsUl(); |
| 43 | mcsUl.setBerInteger(new BerInteger(5)); |
| 44 | mcsUl.setBerInteger(new BerInteger(6)); |
| 45 | |
| 46 | SchedMeasRepPerServCell.NumSchedTtisDl numSchedTtisDl = new SchedMeasRepPerServCell.NumSchedTtisDl(); |
| 47 | numSchedTtisDl.setBerInteger(new BerInteger(1000)); |
| 48 | numSchedTtisDl.setBerInteger(new BerInteger(1000)); |
| 49 | |
| 50 | SchedMeasRepPerServCell.NumSchedTtisUl numSchedTtisUl = new SchedMeasRepPerServCell.NumSchedTtisUl(); |
| 51 | numSchedTtisUl.setBerInteger(new BerInteger(1000)); |
| 52 | numSchedTtisUl.setBerInteger(new BerInteger(1000)); |
| 53 | |
| 54 | SchedMeasRepPerServCell.RankDl1 rankDl1 = new SchedMeasRepPerServCell.RankDl1(); |
| 55 | rankDl1.setBerInteger(new BerInteger(1)); |
| 56 | rankDl1.setBerInteger(new BerInteger(1)); |
| 57 | |
| 58 | SchedMeasRepPerServCell.RankDl2 rankDl2 = new SchedMeasRepPerServCell.RankDl2(); |
| 59 | rankDl2.setBerInteger(new BerInteger(1)); |
| 60 | rankDl2.setBerInteger(new BerInteger(1)); |
| 61 | |
| 62 | schedMeasRepPerServCell.setPciArfcn(pciarfcn); |
| 63 | schedMeasRepPerServCell.setQciVals(qciVals); |
| 64 | schedMeasRepPerServCell.setPrbUsage(prbUsage); |
| 65 | schedMeasRepPerServCell.setMcsDl(mcsDl); |
| 66 | schedMeasRepPerServCell.setMcsUl(mcsUl); |
| 67 | schedMeasRepPerServCell.setNumSchedTtisDl(numSchedTtisDl); |
| 68 | schedMeasRepPerServCell.setNumSchedTtisUl(numSchedTtisUl); |
| 69 | schedMeasRepPerServCell.setRankDl1(rankDl1); |
| 70 | schedMeasRepPerServCell.setRankDl2(rankDl2); |
| 71 | |
| 72 | SchedMeasReportPerUE.SchedReportServCells schedReportServCells = new SchedMeasReportPerUE.SchedReportServCells(); |
| 73 | schedReportServCells.setSchedMeasRepPerServCell(schedMeasRepPerServCell); |
| 74 | |
| 75 | SchedMeasReportPerUE schedMeasReportPerUE = new SchedMeasReportPerUE(); |
| 76 | schedMeasReportPerUE.setCrnti(crnti); |
| 77 | schedMeasReportPerUE.setEcgi(ecgi); |
| 78 | schedMeasReportPerUE.setSchedReportServCells(schedReportServCells); |
| 79 | |
| 80 | XrancPduBody body = new XrancPduBody(); |
| 81 | body.setSchedMeasReportPerUE(schedMeasReportPerUE); |
| 82 | |
| 83 | BerUTF8String ver = null; |
| 84 | try { |
| 85 | ver = new BerUTF8String("4"); |
| 86 | } catch (UnsupportedEncodingException e) { |
| 87 | e.printStackTrace(); |
| 88 | } |
| 89 | |
| 90 | XrancApiID apiID = new XrancApiID(22); |
| 91 | XrancPduHdr hdr = new XrancPduHdr(); |
| 92 | hdr.setVer(ver); |
| 93 | hdr.setApiId(apiID); |
| 94 | |
| 95 | XrancPdu pdu = new XrancPdu(); |
| 96 | pdu.setHdr(hdr); |
| 97 | pdu.setBody(body); |
| 98 | |
| 99 | return pdu; |
| 100 | |
| 101 | |
| 102 | } |
| 103 | } |