Rev

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

Rev 2230 Rev 2655
Line 1... Line 1...
1
package org.etsi.ttcn.codec.its.mapspat;
1
package org.etsi.ttcn.codec.its.mapspat;
2
2
-
 
3
// TODO To be removed
3
import org.etsi.ttcn.codec.CodecBuffer;
4
//import org.etsi.ttcn.codec.CodecBuffer;
4
import org.etsi.ttcn.codec.MainCodec;
5
//import org.etsi.ttcn.codec.MainCodec;
5
import org.etsi.ttcn.codec.generic.Record;
6
//import org.etsi.ttcn.codec.generic.Record;
6
import org.etsi.ttcn.tci.RecordValue;
7
//import org.etsi.ttcn.tci.RecordValue;
7
import org.etsi.ttcn.tci.Type;
8
//import org.etsi.ttcn.tci.Type;
8
import org.etsi.ttcn.tci.Value;
9
//import org.etsi.ttcn.tci.Value;
9
10
10
public class MapSpatIndReq extends Record {
11
//public class MapSpatIndReq extends Record {
11
12
//
12
    public MapSpatIndReq(MainCodec mainCodec) {
13
//    public MapSpatIndReq(MainCodec mainCodec) {
13
        super(mainCodec);
14
//        super(mainCodec);
14
    }
15
//    }
15
16
//
16
    @Override
17
//    @Override
17
    protected void preDecode(CodecBuffer buf, Type decodingHypothesis) {
18
//    protected void preDecode(CodecBuffer buf, Type decodingHypothesis) {
18
//        System.out.println(">>> MapSpatIndReq.preDecode: " + decodingHypothesis);
19
////        System.out.println(">>> MapSpatIndReq.preDecode: " + decodingHypothesis);
19
       
20
//        
20
        int msgLen = buf.getNbBits() - 48;
21
//        int msgLen = buf.getNbBits() - 48;
21
       
22
//        
22
        messageBuffer = buf.getBuffer(0, msgLen);
23
//        messageBuffer = buf.getBuffer(0, msgLen);
23
        macBuffer = buf.getBuffer(msgLen, 48);
24
//        macBuffer = buf.getBuffer(msgLen, 48);
24
    }
25
//    }
25
   
26
//    
26
    @Override
27
//    @Override
27
    protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) {
28
//    protected void preDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) {
28
//        System.out.println(">>> MapSpatIndReq.preDecodeField: " + fieldName + ", " + decodingHypothesis);
29
////        System.out.println(">>> MapSpatIndReq.preDecodeField: " + fieldName + ", " + decodingHypothesis);
29
       
30
//        
30
        if(fieldName.equals("macDestinationAddress")) {
31
//        if(fieldName.equals("macDestinationAddress")) {
31
            buf.overwriteWith(macBuffer);
32
//            buf.overwriteWith(macBuffer);
32
        }
33
//        }
33
        else {
34
//        else {
34
            buf.overwriteWith(messageBuffer);
35
//            buf.overwriteWith(messageBuffer);
35
        }
36
//        }
36
    }
37
//    }
37
   
38
//    
38
    @Override
39
//    @Override
39
    protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) {
40
//    protected void postDecodeField(String fieldName, CodecBuffer buf, Type decodingHypothesis, RecordValue rv) {
40
//        System.out.println(">>> MapSpatIndReq.postDecodeField: " + fieldName + ", " + decodingHypothesis);
41
////        System.out.println(">>> MapSpatIndReq.postDecodeField: " + fieldName + ", " + decodingHypothesis);
41
       
42
//        
42
    }
43
//    }
43
   
44
//    
44
    @Override
45
//    @Override
45
    public CodecBuffer encode(Value value) {
46
//    public CodecBuffer encode(Value value) {
46
//        System.out.println("MapSpatIndReq.encode: " + value);
47
////        System.out.println("MapSpatIndReq.encode: " + value);
47
       
48
//        
48
        return super.encode(value);
49
//        return super.encode(value);
49
    }
50
//    }
50
   
51
//    
51
    private CodecBuffer messageBuffer = null;
52
//    private CodecBuffer messageBuffer = null;
52
    private CodecBuffer macBuffer = null;
53
//    private CodecBuffer macBuffer = null;
53
} // End of class MapSpatIndReq
54
//} // End of class MapSpatIndReq