Rev

Rev 2381 | Details | Compare with Previous | Last modification | View Log | SVN | Bug Tracker

Rev Author Line No. Line
2381 garciay 1
package org.etsi.ttcn.codec.its.adapter;
2
 
3
import org.etsi.ttcn.codec.CodecBuffer;
4
import org.etsi.ttcn.codec.MainCodec;
5
import org.etsi.ttcn.codec.generic.Boolean;
6
import org.etsi.ttcn.tci.Type;
7
import org.etsi.ttcn.tci.Value;
8
 
9
public class AcGnssResponse extends Boolean {
10
 
11
    private static final int AcGnssResponse = 0x02;
12
 
13
    public AcGnssResponse(MainCodec mainCodec) {
14
        super(mainCodec);
15
    }
16
 
17
    @Override
18
    public Value decode(CodecBuffer buf, Type decodingHypothesis) {
19
 
20
        byte[] readId = buf.readBytes(1);
21
        if(readId[0] != AcGnssResponse) {
22
            return null;
23
        }
24
 
25
        return super.decode(buf, decodingHypothesis);
26
    }
27
 
28
    @Override
29
    public CodecBuffer preEncode(Value value) {
30
        return new CodecBuffer(new byte[] {0x02});
31
    }
32
 
33
}