comparison src/fdl/PSX.java @ 25:330fa49bc4fd

*** empty log message ***
author kono
date Wed, 20 Aug 2008 14:12:15 +0900
parents 35375016b2f0
children d7d70edc9c7c
comparison
equal deleted inserted replaced
24:35375016b2f0 25:330fa49bc4fd
61 static final int META_STOP = PRIVILEGED_ID_START; 61 static final int META_STOP = PRIVILEGED_ID_START;
62 static final int META_MONITOR = PRIVILEGED_ID_START+1; 62 static final int META_MONITOR = PRIVILEGED_ID_START+1;
63 static final int META_MONITOR_DATA = PRIVILEGED_ID_START+2; 63 static final int META_MONITOR_DATA = PRIVILEGED_ID_START+2;
64 64
65 65
66 static void printCommand(ByteBuffer command, ByteBuffer data) { 66 static void printCommand(String comment, ByteBuffer command, ByteBuffer data) {
67 char id = (char)command.getShort(LINDA_ID_OFFSET); 67 char id = (char)command.getShort(LINDA_ID_OFFSET);
68 System.out.println("LENGTH:"+command.getInt(LINDA_PACKET_LENGTH_OFFSET)+" "+ 68 System.out.println(comment+" LENGTH:"+command.getInt(LINDA_PACKET_LENGTH_OFFSET)+" "+
69 "MODE:"+(char)command.get(LINDA_MODE_OFFSET)+" "+ 69 "MODE:"+(char)command.get(LINDA_MODE_OFFSET)+" "+
70 "ID:"+(int)id+" "+ 70 "ID:"+(int)id+" "+
71 "SEQ:"+command.getInt(LINDA_SEQ_OFFSET)+" "+ 71 "SEQ:"+command.getInt(LINDA_SEQ_OFFSET)+" "+
72 "DATA LENGTH:"+command.getInt(LINDA_DATA_LENGTH_OFFSET)+" "); 72 "DATA LENGTH:"+command.getInt(LINDA_DATA_LENGTH_OFFSET)+" ");
73 System.out.println("DATA:"+data); 73 System.out.println("DATA:"+data);
74 command.rewind(); 74 command.rewind();
75 } 75 }
76 76
77 static void printData(ByteBuffer command) { 77 static void printData(String comment,ByteBuffer command) {
78 /*** print data ***/ 78 /*** print data ***/
79 char id = (char)command.getShort(LINDA_ID_OFFSET); 79 char id = (char)command.getShort(LINDA_ID_OFFSET);
80 System.out.println("LENGTH:"+command.getInt(LINDA_PACKET_LENGTH_OFFSET)+" "+ 80 System.out.println(comment+" LENGTH:"+command.getInt(LINDA_PACKET_LENGTH_OFFSET)+" "+
81 "MODE:"+(char)command.get(LINDA_MODE_OFFSET)+" "+ 81 "MODE:"+(char)command.get(LINDA_MODE_OFFSET)+" "+
82 "ID:"+(int)id+" "+ 82 "ID:"+(int)id+" "+
83 "SEQ:"+command.getInt(LINDA_SEQ_OFFSET)+" "); 83 "SEQ:"+command.getInt(LINDA_SEQ_OFFSET)+" ");
84 command.rewind(); 84 command.rewind();
85 } 85 }