Rev | Line | |
---|
[31] | 1 | /************************************************************************************ |
---|
| 2 | * Copyright (C) 2008 by Politehnica University of Bucharest and Rutgers University |
---|
| 3 | * All rights reserved. |
---|
| 4 | * Refer to LICENSE for terms and conditions of use. |
---|
| 5 | ***********************************************************************************/ |
---|
| 6 | //Petroaca - a data packet at the physical level |
---|
| 7 | package vnsim.network.dsrc; |
---|
| 8 | |
---|
| 9 | import vnsim.map.object.Globals; |
---|
| 10 | |
---|
| 11 | public class DsrcPacket |
---|
| 12 | { |
---|
| 13 | private byte[] preamble; |
---|
| 14 | private byte[] PCLPHeader; |
---|
| 15 | private DsrcFrame frame; |
---|
| 16 | |
---|
| 17 | public DsrcPacket() |
---|
| 18 | { |
---|
| 19 | this.preamble=new byte[Globals.DSRC_PREAMBLE_LENGTH]; |
---|
| 20 | this.PCLPHeader=new byte[Globals.DSRC_PHYHEADER_LENGHT]; |
---|
| 21 | this.frame=new DsrcFrame(); |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | public DsrcPacket(byte[] preamble,byte[] PCLPHeader,DsrcFrame frame) |
---|
| 25 | { |
---|
| 26 | this.preamble=preamble; |
---|
| 27 | this.PCLPHeader=PCLPHeader; |
---|
| 28 | this.frame=frame; |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | public byte[] getPCLPHeader() |
---|
| 32 | { |
---|
| 33 | return this.PCLPHeader; |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | public void setPCLPHeader(byte[] set) |
---|
| 37 | { |
---|
| 38 | this.PCLPHeader=set; |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | public byte[] getPreamble() |
---|
| 42 | { |
---|
| 43 | return this.preamble; |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | public void setPreamble(byte[] set) |
---|
| 47 | { |
---|
| 48 | this.preamble=set; |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | public DsrcFrame getFrame() |
---|
| 52 | { |
---|
| 53 | return this.frame; |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | public void setFrame(DsrcFrame set) |
---|
| 57 | { |
---|
| 58 | this.frame=set; |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | public String toString() |
---|
| 62 | { |
---|
| 63 | return "Preamble : "+this.preamble+" Phy Header:"+this.PCLPHeader+" "+this.frame.toString(); |
---|
| 64 | } |
---|
| 65 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.