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.string.BerUTF8String; |
| 6 | |
| 7 | import java.io.UnsupportedEncodingException; |
| 8 | |
| 9 | public class RXSigMeasRep { |
| 10 | |
| 11 | public XrancPdu setPacketProperties(XrancPdu decoder) { |
| 12 | CRNTI crnti = decoder.getBody().getRXSigMeasConfig().getCrnti(); |
| 13 | ECGI ecgi = decoder.getBody().getRXSigMeasConfig().getEcgi(); |
| 14 | |
| 15 | RXSigMeasReport.CellMeasReports cellMeasReports = new RXSigMeasReport.CellMeasReports(); |
| 16 | RXSigReport rxSigReport = new RXSigReport(); |
| 17 | PCIARFCN pciarfcn = new PCIARFCN(); |
| 18 | pciarfcn.setPci(new PhysCellId(500)); |
| 19 | pciarfcn.setEarfcnDl(new ARFCNValue(2100)); |
| 20 | rxSigReport.setPciArfcn(pciarfcn); |
| 21 | rxSigReport.setRsrp(new RSRPRange(4)); |
| 22 | rxSigReport.setRsrq(new RSRQRange(5)); |
| 23 | cellMeasReports.setRXSigReport(rxSigReport); |
| 24 | |
| 25 | RXSigReport rxSigReport1 = new RXSigReport(); |
| 26 | PCIARFCN pciarfcn1 = new PCIARFCN(); |
| 27 | pciarfcn1.setPci(new PhysCellId(500)); |
| 28 | pciarfcn1.setEarfcnDl(new ARFCNValue(2100)); |
| 29 | rxSigReport1.setPciArfcn(pciarfcn); |
| 30 | rxSigReport1.setRsrp(new RSRPRange(4)); |
| 31 | rxSigReport1.setRsrq(new RSRQRange(5)); |
| 32 | cellMeasReports.setRXSigReport(rxSigReport1); |
| 33 | |
| 34 | RXSigMeasReport rxSigMeasReport = new RXSigMeasReport(); |
| 35 | rxSigMeasReport.setCrnti(crnti); |
| 36 | rxSigMeasReport.setEcgi(ecgi); |
| 37 | rxSigMeasReport.setCellMeasReports(cellMeasReports); |
| 38 | |
| 39 | XrancPduBody body = new XrancPduBody(); |
| 40 | body.setRXSigMeasReport(rxSigMeasReport); |
| 41 | |
| 42 | BerUTF8String ver = null; |
| 43 | try { |
| 44 | ver = new BerUTF8String("4"); |
| 45 | } catch (UnsupportedEncodingException e) { |
| 46 | e.printStackTrace(); |
| 47 | } |
| 48 | |
| 49 | XrancApiID apiID = new XrancApiID(18); |
| 50 | XrancPduHdr hdr = new XrancPduHdr(); |
| 51 | hdr.setVer(ver); |
| 52 | hdr.setApiId(apiID); |
| 53 | |
| 54 | XrancPdu pdu = new XrancPdu(); |
| 55 | pdu.setHdr(hdr); |
| 56 | pdu.setBody(body); |
| 57 | |
| 58 | return pdu; |
| 59 | |
| 60 | } |
| 61 | } |