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.ECGI; |
| 4 | import org.onosproject.xran.codecs.api.PRBUsage; |
| 5 | import org.onosproject.xran.codecs.api.QCI; |
| 6 | import org.onosproject.xran.codecs.pdu.*; |
| 7 | import org.openmuc.jasn1.ber.types.BerInteger; |
| 8 | import org.openmuc.jasn1.ber.types.string.BerUTF8String; |
| 9 | |
| 10 | import java.io.UnsupportedEncodingException; |
| 11 | |
| 12 | public class SchedReportPerCell { |
| 13 | |
| 14 | public XrancPdu setPacketProperties(XrancPdu recv_pdu) { |
| 15 | ECGI ecgi = recv_pdu.getBody().getL2MeasConfig().getEcgi(); |
| 16 | |
| 17 | SchedMeasReportPerCell.QciVals qciVals = new SchedMeasReportPerCell.QciVals(); |
| 18 | qciVals.setQCI(new QCI(1)); |
| 19 | qciVals.setQCI(new QCI(2)); |
| 20 | |
| 21 | PRBUsage pcell = new PRBUsage(); |
| 22 | PRBUsage.PrbUsageDl prbUsageDl = new PRBUsage.PrbUsageDl(); |
| 23 | prbUsageDl.setBerInteger(new BerInteger(50)); |
| 24 | prbUsageDl.setBerInteger(new BerInteger(100)); |
| 25 | pcell.setPrbUsageDl(prbUsageDl); |
| 26 | |
| 27 | PRBUsage.PrbUsageUl prbUsageUl = new PRBUsage.PrbUsageUl(); |
| 28 | prbUsageUl.setBerInteger(new BerInteger(50)); |
| 29 | prbUsageUl.setBerInteger(new BerInteger(100)); |
| 30 | pcell.setPrbUsageUl(prbUsageUl); |
| 31 | |
| 32 | PRBUsage scell = new PRBUsage(); |
| 33 | prbUsageDl.setBerInteger(new BerInteger(50)); |
| 34 | prbUsageDl.setBerInteger(new BerInteger(100)); |
| 35 | scell.setPrbUsageDl(prbUsageDl); |
| 36 | |
| 37 | prbUsageUl.setBerInteger(new BerInteger(50)); |
| 38 | prbUsageUl.setBerInteger(new BerInteger(100)); |
| 39 | scell.setPrbUsageUl(prbUsageUl); |
| 40 | |
| 41 | SchedMeasReportPerCell schedMeasReportPerCell = new SchedMeasReportPerCell(); |
| 42 | schedMeasReportPerCell.setEcgi(ecgi); |
| 43 | schedMeasReportPerCell.setQciVals(qciVals); |
| 44 | schedMeasReportPerCell.setPrbUsagePcell(pcell); |
| 45 | schedMeasReportPerCell.setPrbUsageScell(scell); |
| 46 | |
| 47 | XrancPduBody body = new XrancPduBody(); |
| 48 | body.setSchedMeasReportPerCell(schedMeasReportPerCell); |
| 49 | |
| 50 | BerUTF8String ver = null; |
| 51 | try { |
| 52 | ver = new BerUTF8String("4"); |
| 53 | } catch (UnsupportedEncodingException e) { |
| 54 | e.printStackTrace(); |
| 55 | } |
| 56 | |
| 57 | XrancApiID apiID = new XrancApiID(23); |
| 58 | XrancPduHdr hdr = new XrancPduHdr(); |
| 59 | hdr.setVer(ver); |
| 60 | hdr.setApiId(apiID); |
| 61 | |
| 62 | XrancPdu pdu = new XrancPdu(); |
| 63 | pdu.setHdr(hdr); |
| 64 | pdu.setBody(body); |
| 65 | |
| 66 | return pdu; |
| 67 | |
| 68 | } |
| 69 | } |