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.CRNTI; |
| 4 | import org.onosproject.xran.codecs.api.ECGI; |
| 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 PDCPReportPerUE { |
| 13 | |
| 14 | public XrancPdu setPacketProperties(XrancPdu recv_pdu) { |
| 15 | ECGI ecgi = recv_pdu.getBody().getL2MeasConfig().getEcgi(); |
| 16 | |
| 17 | //Need to get this from UE. |
| 18 | CRNTI crnti = new CRNTI(new byte[]{(byte) 0x44, (byte) 0x44}, 16); |
| 19 | |
| 20 | PDCPMeasReportPerUe.QciVals qciVals = new PDCPMeasReportPerUe.QciVals(); |
| 21 | qciVals.setQCI(new QCI(1)); |
| 22 | qciVals.setQCI(new QCI(2)); |
| 23 | |
| 24 | PDCPMeasReportPerUe.DataVolDl dataVolDl = new PDCPMeasReportPerUe.DataVolDl(); |
| 25 | dataVolDl.setBerInteger(new BerInteger(500)); |
| 26 | dataVolDl.setBerInteger(new BerInteger(500)); |
| 27 | |
| 28 | PDCPMeasReportPerUe.DataVolUl dataVolUl = new PDCPMeasReportPerUe.DataVolUl(); |
| 29 | dataVolUl.setBerInteger(new BerInteger(500)); |
| 30 | dataVolUl.setBerInteger(new BerInteger(500)); |
| 31 | |
| 32 | PDCPMeasReportPerUe.PktDelayDl pktDelayDl = new PDCPMeasReportPerUe.PktDelayDl(); |
| 33 | pktDelayDl.setBerInteger(new BerInteger(314)); |
| 34 | pktDelayDl.setBerInteger(new BerInteger(314)); |
| 35 | |
| 36 | PDCPMeasReportPerUe.PktDelayUl pktDelayUl = new PDCPMeasReportPerUe.PktDelayUl(); |
| 37 | pktDelayUl.setBerInteger(new BerInteger(314)); |
| 38 | pktDelayUl.setBerInteger(new BerInteger(314)); |
| 39 | |
| 40 | PDCPMeasReportPerUe.PktDiscardRateDl pktDiscardRateDl = new PDCPMeasReportPerUe.PktDiscardRateDl(); |
| 41 | pktDiscardRateDl.setBerInteger(new BerInteger(10)); |
| 42 | pktDiscardRateDl.setBerInteger(new BerInteger(5)); |
| 43 | |
| 44 | PDCPMeasReportPerUe.PktLossRateDl pktLossRateDl = new PDCPMeasReportPerUe.PktLossRateDl(); |
| 45 | pktLossRateDl.setBerInteger(new BerInteger(5)); |
| 46 | pktLossRateDl.setBerInteger(new BerInteger(10)); |
| 47 | |
| 48 | PDCPMeasReportPerUe.PktLossRateUl pktLossRateUl = new PDCPMeasReportPerUe.PktLossRateUl(); |
| 49 | pktLossRateUl.setBerInteger(new BerInteger(8)); |
| 50 | pktLossRateUl.setBerInteger(new BerInteger(2)); |
| 51 | |
| 52 | PDCPMeasReportPerUe.ThroughputDl throughputDl = new PDCPMeasReportPerUe.ThroughputDl(); |
| 53 | throughputDl.setBerInteger(new BerInteger(500)); |
| 54 | throughputDl.setBerInteger(new BerInteger(500)); |
| 55 | |
| 56 | PDCPMeasReportPerUe.ThroughputUl throughputUl = new PDCPMeasReportPerUe.ThroughputUl(); |
| 57 | throughputUl.setBerInteger(new BerInteger(500)); |
| 58 | throughputUl.setBerInteger(new BerInteger(500)); |
| 59 | |
| 60 | PDCPMeasReportPerUe pdcpMeasReportPerUe = new PDCPMeasReportPerUe(); |
| 61 | pdcpMeasReportPerUe.setCrnti(crnti); |
| 62 | pdcpMeasReportPerUe.setEcgi(ecgi); |
| 63 | pdcpMeasReportPerUe.setQciVals(qciVals); |
| 64 | pdcpMeasReportPerUe.setDataVolDl(dataVolDl); |
| 65 | pdcpMeasReportPerUe.setDataVolUl(dataVolUl); |
| 66 | pdcpMeasReportPerUe.setPktDelayDl(pktDelayDl); |
| 67 | pdcpMeasReportPerUe.setPktDelayUl(pktDelayUl); |
| 68 | pdcpMeasReportPerUe.setPktDiscardRateDl(pktDiscardRateDl); |
| 69 | pdcpMeasReportPerUe.setPktLossRateDl(pktLossRateDl); |
| 70 | pdcpMeasReportPerUe.setPktLossRateUl(pktLossRateUl); |
| 71 | pdcpMeasReportPerUe.setThroughputDl(throughputDl); |
| 72 | pdcpMeasReportPerUe.setThroughputUl(throughputUl); |
| 73 | |
| 74 | XrancPduBody body = new XrancPduBody(); |
| 75 | body.setPDCPMeasReportPerUe(pdcpMeasReportPerUe); |
| 76 | |
| 77 | BerUTF8String ver = null; |
| 78 | try { |
| 79 | ver = new BerUTF8String("4"); |
| 80 | } catch (UnsupportedEncodingException e) { |
| 81 | e.printStackTrace(); |
| 82 | } |
| 83 | |
| 84 | XrancApiID apiID = new XrancApiID(24); |
| 85 | XrancPduHdr hdr = new XrancPduHdr(); |
| 86 | hdr.setVer(ver); |
| 87 | hdr.setApiId(apiID); |
| 88 | |
| 89 | XrancPdu pdu = new XrancPdu(); |
| 90 | pdu.setHdr(hdr); |
| 91 | pdu.setBody(body); |
| 92 | |
| 93 | return pdu; |
| 94 | |
| 95 | } |
| 96 | } |