Rev

Rev 2230 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | Bug Tracker

Rev 2230 Rev 2655
Line 2... Line 2...
2
 * @author      ETSI / STF462 / Alexandre Berge
2
 * @author      ETSI / STF462 / Alexandre Berge
3
 * @version     $URL: file:///D:/RepositoriesNew/ITS/trunk/javasrc/codec/org/etsi/ttcn/codec/its/facilities/FacilitiesInd.java $
3
 * @version     $URL: file:///D:/RepositoriesNew/ITS/trunk/javasrc/codec/org/etsi/ttcn/codec/its/facilities/FacilitiesInd.java $
4
 *              $Id: FacilitiesInd.java 2230 2015-06-03 09:11:02Z mullers $
4
 *              $Id: FacilitiesInd.java 2655 2017-01-26 10:46:08Z filatov $
5
 */
5
 */
6
package org.etsi.ttcn.codec.its.facilities;
6
package org.etsi.ttcn.codec.its.facilities;
7
7
8
import org.etsi.ttcn.codec.CodecBuffer;
8
import org.etsi.ttcn.codec.CodecBuffer;
9
import org.etsi.ttcn.codec.MainCodec;
9
import org.etsi.ttcn.codec.MainCodec;
Line 18... Line 18...
18
        super(mainCodec);
18
        super(mainCodec);
19
    }
19
    }
20
20
21
    @Override
21
    @Override
22
    protected void preDecode(CodecBuffer buf, Type decodingHypothesis) {
22
    protected void preDecode(CodecBuffer buf, Type decodingHypothesis) {
23
//        System.out.println(">>> FacilitiesInd.preDecode: " + decodingHypothesis);
23
//        TERFactory.getInstance().logDebug(">>> FacilitiesInd.preDecode: " + decodingHypothesis);
24
       
24
       
25
        int msgLen = buf.getNbBits() - 8 - 8 - 8 - 32 - 8 - 16 - 16;
25
        int msgLen = buf.getNbBits() - 8 - 8 - 8 - 32 - 8 - 16 - 16 - 256 - 32; // FIXME Add support of SSP (Bit256) & ITS-AID (UInt32) extra fields: fixed size (256) is not nice!
26
        int offset = 0;
26
        int offset = 0;
27
       
27
       
28
        messageBuffer = buf.getBuffer(offset, msgLen); offset += msgLen;
28
        messageBuffer = buf.getBuffer(offset, msgLen); offset += msgLen;
29
        gnNh = buf.getBuffer(offset, 8); offset += 8;
29
        gnNh = buf.getBuffer(offset, 8); offset += 8;
30
        gnHt = buf.getBuffer(offset, 8); offset += 8;
30
        gnHt = buf.getBuffer(offset, 8); offset += 8;
31
        gnHst = buf.getBuffer(offset, 8); offset += 8;
31
        gnHst = buf.getBuffer(offset, 8); offset += 8;
32
        gnLifetime = buf.getBuffer(offset, 32); offset += 32;
32
        gnLifetime = buf.getBuffer(offset, 32); offset += 32;
33
        gnTc = buf.getBuffer(offset, 8); offset += 8;
33
        gnTc = buf.getBuffer(offset, 8); offset += 8;
34
        btpDestinationPort = buf.getBuffer(offset, 16); offset += 16;
34
        btpDestinationPort = buf.getBuffer(offset, 16); offset += 16;
35
        btpInfo = buf.getBuffer(offset, 16);  offset += 16;
35
        btpInfo = buf.getBuffer(offset, 16);  offset += 16;
-
 
36
        ssp = buf.getBuffer(offset, 256);  offset += 256;
-
 
37
        its_aid = buf.getBuffer(offset, 32);  offset += 32;
36
    }
38
    }
37
   
39
   
38
    @Override
40
    @Override
39
    protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) {
41
    protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) {
40
//        System.out.println(">>> FacilitiesInd.preDecodeField: " + fieldName + " - " + decodingHypothesis);
42
//        TERFactory.getInstance().logDebug(">>> FacilitiesInd.preDecodeField: " + fieldName + " - " + decodingHypothesis);
41
       
43
       
42
        if(fieldName.equals("gnNextHeader")) {
44
        if(fieldName.equals("gnNextHeader")) {
43
            buf.overwriteWith(gnNh);
45
            buf.overwriteWith(gnNh);
44
        }
46
        }
45
        else if(fieldName.equals("gnHeaderType")) {
47
        else if(fieldName.equals("gnHeaderType")) {
Line 57... Line 59...
57
        else if(fieldName.equals("btpDestinationPort")) {
59
        else if(fieldName.equals("btpDestinationPort")) {
58
            buf.overwriteWith(btpDestinationPort);
60
            buf.overwriteWith(btpDestinationPort);
59
        }
61
        }
60
        else if(fieldName.equals("btpInfo")) {
62
        else if(fieldName.equals("btpInfo")) {
61
            buf.overwriteWith(btpInfo);
63
            buf.overwriteWith(btpInfo);
-
 
64
        }        
-
 
65
        else if(fieldName.equals("ssp")) {
-
 
66
            buf.overwriteWith(ssp);
-
 
67
        }        
-
 
68
        else if(fieldName.equals("its_aid")) {
-
 
69
            buf.overwriteWith(its_aid);
62
        }        
70
        }        
63
        else {
71
        else {
64
            buf.overwriteWith(messageBuffer);
72
            buf.overwriteWith(messageBuffer);
65
        }
73
        }
66
    }
74
    }
Line 82... Line 90...
82
    private CodecBuffer gnHst = null;
90
    private CodecBuffer gnHst = null;
83
    private CodecBuffer gnLifetime = null;
91
    private CodecBuffer gnLifetime = null;
84
    private CodecBuffer gnTc = null;
92
    private CodecBuffer gnTc = null;
85
    private CodecBuffer btpDestinationPort = null;
93
    private CodecBuffer btpDestinationPort = null;
86
    private CodecBuffer btpInfo = null;
94
    private CodecBuffer btpInfo = null;
-
 
95
    private CodecBuffer ssp = null;
-
 
96
    private CodecBuffer its_aid = null;
87
}
97
}