annotate src/fdl/PSXReply.java @ 71:0352536c33fa

(example: writer) get linda server addr from commandline arg.
author kazz@e065701.local
date Fri, 23 Oct 2009 14:11:07 +0900
parents 046feb56a196
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
1
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
2 /**
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
3 * PSXReply
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
4 *
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
5 * @author Shinji Kono
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
6 *
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
7
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
8 psx.in(),psxrd.() return this.
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
9
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
10 method for check answer is ready or not.
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
11
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
12 (call back interface can be used instead of this)
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
13
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
14 unique sequence number */
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
15
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
16 package fdl;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
17 import java.nio.ByteBuffer;
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
18
17
609b288f47f9 *** empty log message ***
kono
parents: 15
diff changeset
19 public class PSXReply {
24
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
20 public ByteBuffer command;
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
21 public ByteBuffer data;
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
22 public int seq;
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
23 public PSXReply next;
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
24 public int mode;
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
25 public PSXCallback callback;
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
26
24
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
27 public PSXReply(int _mode,PSXCallback _callback) {
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
28 mode = _mode;
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
29 callback = _callback;
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
30 }
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
31
24
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
32 public PSXReply() {
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
33 }
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
34
24
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
35 public void setAnswer(int _mode, ByteBuffer _command,ByteBuffer _data) {
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
36 mode = _mode;
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
37 data = _data;
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
38 command = _command;
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
39 }
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
40
24
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
41 public int getMode() {
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
42 return command.get(PSX.LINDA_MODE_OFFSET);
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
43 }
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
44
24
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
45 public int getId() {
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
46 return command.getShort(PSX.LINDA_ID_OFFSET);
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
47 }
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
48
24
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
49 public int getSeq() {
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
50 return command.getInt(PSX.LINDA_SEQ_OFFSET);
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
51 }
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
52
24
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
53 public int getLength() {
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
54 return command.getInt(PSX.LINDA_DATA_LENGTH_OFFSET);
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
55 }
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
56
24
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
57 public ByteBuffer getData() {
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
58 data.rewind();
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
59 return data;
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
60 }
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
61
24
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
62 public boolean ready() {
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
63 return mode==PSX.PSX_ANSWER;
35375016b2f0 cleanup.
kono
parents: 17
diff changeset
64 }
0
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
65 }
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
66
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
67
083a0b5e12cc Apply Debug Interface version start
fuchita
parents:
diff changeset
68 /* end */