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.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 RadioReportPerCell { |
| 11 | public XrancPdu setPacketProperties(XrancPdu recv_pdu) { |
| 12 | |
| 13 | ECGI ecgi = recv_pdu.getBody().getL2MeasConfig().getEcgi(); |
| 14 | RadioMeasReportPerCell.PuschIntfPowerHist puschIntfPowerHist = new RadioMeasReportPerCell.PuschIntfPowerHist(); |
| 15 | puschIntfPowerHist.setBerInteger(new BerInteger(1)); |
| 16 | puschIntfPowerHist.setBerInteger(new BerInteger(2)); |
| 17 | puschIntfPowerHist.setBerInteger(new BerInteger(3)); |
| 18 | puschIntfPowerHist.setBerInteger(new BerInteger(4)); |
| 19 | puschIntfPowerHist.setBerInteger(new BerInteger(5)); |
| 20 | puschIntfPowerHist.setBerInteger(new BerInteger(6)); |
| 21 | puschIntfPowerHist.setBerInteger(new BerInteger(7)); |
| 22 | puschIntfPowerHist.setBerInteger(new BerInteger(8)); |
| 23 | puschIntfPowerHist.setBerInteger(new BerInteger(9)); |
| 24 | puschIntfPowerHist.setBerInteger(new BerInteger(10)); |
| 25 | puschIntfPowerHist.setBerInteger(new BerInteger(11)); |
| 26 | puschIntfPowerHist.setBerInteger(new BerInteger(12)); |
| 27 | puschIntfPowerHist.setBerInteger(new BerInteger(13)); |
| 28 | puschIntfPowerHist.setBerInteger(new BerInteger(14)); |
| 29 | puschIntfPowerHist.setBerInteger(new BerInteger(15)); |
| 30 | puschIntfPowerHist.setBerInteger(new BerInteger(16)); |
| 31 | puschIntfPowerHist.setBerInteger(new BerInteger(17)); |
| 32 | |
| 33 | RadioMeasReportPerCell.PucchIntfPowerHist pucchIntfPowerHist = new RadioMeasReportPerCell.PucchIntfPowerHist(); |
| 34 | pucchIntfPowerHist.setBerInteger(new BerInteger(1)); |
| 35 | pucchIntfPowerHist.setBerInteger(new BerInteger(2)); |
| 36 | pucchIntfPowerHist.setBerInteger(new BerInteger(3)); |
| 37 | pucchIntfPowerHist.setBerInteger(new BerInteger(4)); |
| 38 | pucchIntfPowerHist.setBerInteger(new BerInteger(5)); |
| 39 | pucchIntfPowerHist.setBerInteger(new BerInteger(6)); |
| 40 | pucchIntfPowerHist.setBerInteger(new BerInteger(7)); |
| 41 | pucchIntfPowerHist.setBerInteger(new BerInteger(8)); |
| 42 | pucchIntfPowerHist.setBerInteger(new BerInteger(9)); |
| 43 | pucchIntfPowerHist.setBerInteger(new BerInteger(10)); |
| 44 | pucchIntfPowerHist.setBerInteger(new BerInteger(11)); |
| 45 | pucchIntfPowerHist.setBerInteger(new BerInteger(12)); |
| 46 | pucchIntfPowerHist.setBerInteger(new BerInteger(13)); |
| 47 | pucchIntfPowerHist.setBerInteger(new BerInteger(14)); |
| 48 | pucchIntfPowerHist.setBerInteger(new BerInteger(15)); |
| 49 | pucchIntfPowerHist.setBerInteger(new BerInteger(16)); |
| 50 | pucchIntfPowerHist.setBerInteger(new BerInteger(17)); |
| 51 | |
| 52 | RadioMeasReportPerCell radioMeasReportPerCell = new RadioMeasReportPerCell(); |
| 53 | radioMeasReportPerCell.setEcgi(ecgi); |
| 54 | radioMeasReportPerCell.setPuschIntfPowerHist(puschIntfPowerHist); |
| 55 | radioMeasReportPerCell.setPucchIntfPowerHist(pucchIntfPowerHist); |
| 56 | |
| 57 | XrancPduBody body = new XrancPduBody(); |
| 58 | body.setRadioMeasReportPerCell(radioMeasReportPerCell); |
| 59 | |
| 60 | BerUTF8String ver = null; |
| 61 | try { |
| 62 | ver = new BerUTF8String("4"); |
| 63 | } catch (UnsupportedEncodingException e) { |
| 64 | e.printStackTrace(); |
| 65 | } |
| 66 | |
| 67 | XrancApiID apiID = new XrancApiID(21); |
| 68 | XrancPduHdr hdr = new XrancPduHdr(); |
| 69 | hdr.setVer(ver); |
| 70 | hdr.setApiId(apiID); |
| 71 | |
| 72 | XrancPdu pdu = new XrancPdu(); |
| 73 | pdu.setHdr(hdr); |
| 74 | pdu.setBody(body); |
| 75 | |
| 76 | return pdu; |
| 77 | } |
| 78 | } |