Thread: [Firebug-cvs] firebug/project/java/src/org/firebug DBLogger.java,1.21,1.22 SensorMsg.java,1.4,1.5 Se
Brought to you by:
doolin
From: <che...@us...> - 2003-07-30 22:17:50
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1:/tmp/cvs-serv11844/src/org/firebug Modified Files: DBLogger.java SensorMsg.java SensorPacket.java Log Message: add rss Index: DBLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/DBLogger.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** DBLogger.java 21 Jul 2003 18:34:21 -0000 1.21 --- DBLogger.java 30 Jul 2003 22:17:41 -0000 1.22 *************** *** 60,64 **** // message. ! SensorMsg msg = new SensorMsg(packet,5,21); Connection conn = dbh.getConnection(); --- 60,64 ---- // message. ! SensorMsg msg = new SensorMsg(packet,5,23); Connection conn = dbh.getConnection(); *************** *** 83,86 **** --- 83,87 ---- float rel_hum = msg.get_rel_hum(); float baro_pres = msg.get_baro_pres(); + int rss=msg.get_rss(); if (get_packet_type(packet) != 1){ *************** *** 120,124 **** + "rel_hum=" + rel_hum + ", " + "baro_pres=" + baro_pres + ", " ! + "temp=" + temp + " WHERE mote_id=" + mote_id; String insertquery = "INSERT INTO cumulative VALUES (" --- 121,126 ---- + "rel_hum=" + rel_hum + ", " + "baro_pres=" + baro_pres + ", " ! + "temp=" + temp + ", " ! + "rss=" + rss + " WHERE mote_id=" + mote_id; String insertquery = "INSERT INTO cumulative VALUES (" *************** *** 127,132 **** + temp + ", " + rel_hum + ", " ! + baro_pres + "," ! + cnt + ")"; --- 129,135 ---- + temp + ", " + rel_hum + ", " ! + baro_pres + ", " ! + cnt + ", " ! + rss + ")"; Index: SensorMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/SensorMsg.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SensorMsg.java 10 Jul 2003 09:02:58 -0000 1.4 --- SensorMsg.java 30 Jul 2003 22:17:41 -0000 1.5 *************** *** 10,19 **** /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 16; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 128; ! /** Create a new SensorMsg of size 16. */ public SensorMsg() { super(DEFAULT_MESSAGE_SIZE); --- 10,19 ---- /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 18; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 128; ! /** Create a new SensorMsg of size 18. */ public SensorMsg() { super(DEFAULT_MESSAGE_SIZE); *************** *** 102,105 **** --- 102,108 ---- s += " [baro_pres="+Float.toString(get_baro_pres())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } + try { + s += " [rss=0x"+Long.toHexString(get_rss())+"]\n"; + } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } *************** *** 109,113 **** ///////////////////////////////////////////////////////// // Accessor methods for field: addr ! // Field type: int // Offset (bits): 0 // Size (bits): 16 --- 112,116 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: addr ! // Field type: int, unsigned // Offset (bits): 0 // Size (bits): 16 *************** *** 115,122 **** /** ! * Return whether the field 'addr' is signed (true). */ public static boolean isSigned_addr() { ! return true; } --- 118,125 ---- /** ! * Return whether the field 'addr' is signed (false). */ public static boolean isSigned_addr() { ! return false; } *************** *** 172,176 **** ///////////////////////////////////////////////////////// // Accessor methods for field: cnt ! // Field type: int // Offset (bits): 16 // Size (bits): 16 --- 175,179 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: cnt ! // Field type: int, unsigned // Offset (bits): 16 // Size (bits): 16 *************** *** 178,185 **** /** ! * Return whether the field 'cnt' is signed (true). */ public static boolean isSigned_cnt() { ! return true; } --- 181,188 ---- /** ! * Return whether the field 'cnt' is signed (false). */ public static boolean isSigned_cnt() { ! return false; } *************** *** 235,239 **** ///////////////////////////////////////////////////////// // Accessor methods for field: temp ! // Field type: float // Offset (bits): 32 // Size (bits): 32 --- 238,242 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: temp ! // Field type: float, unsigned // Offset (bits): 32 // Size (bits): 32 *************** *** 241,248 **** /** ! * Return whether the field 'temp' is signed (true). */ public static boolean isSigned_temp() { ! return true; } --- 244,251 ---- /** ! * Return whether the field 'temp' is signed (false). */ public static boolean isSigned_temp() { ! return false; } *************** *** 298,302 **** ///////////////////////////////////////////////////////// // Accessor methods for field: rel_hum ! // Field type: float // Offset (bits): 64 // Size (bits): 32 --- 301,305 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: rel_hum ! // Field type: float, unsigned // Offset (bits): 64 // Size (bits): 32 *************** *** 304,311 **** /** ! * Return whether the field 'rel_hum' is signed (true). */ public static boolean isSigned_rel_hum() { ! return true; } --- 307,314 ---- /** ! * Return whether the field 'rel_hum' is signed (false). */ public static boolean isSigned_rel_hum() { ! return false; } *************** *** 361,365 **** ///////////////////////////////////////////////////////// // Accessor methods for field: baro_pres ! // Field type: float // Offset (bits): 96 // Size (bits): 32 --- 364,368 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: baro_pres ! // Field type: float, unsigned // Offset (bits): 96 // Size (bits): 32 *************** *** 367,374 **** /** ! * Return whether the field 'baro_pres' is signed (true). */ public static boolean isSigned_baro_pres() { ! return true; } --- 370,377 ---- /** ! * Return whether the field 'baro_pres' is signed (false). */ public static boolean isSigned_baro_pres() { ! return false; } *************** *** 420,423 **** --- 423,489 ---- public static int sizeBits_baro_pres() { return 32; + } + + ///////////////////////////////////////////////////////// + // Accessor methods for field: rss + // Field type: int, unsigned + // Offset (bits): 128 + // Size (bits): 16 + ///////////////////////////////////////////////////////// + + /** + * Return whether the field 'rss' is signed (false). + */ + public static boolean isSigned_rss() { + return false; + } + + /** + * Return whether the field 'rss' is an array (false). + */ + public static boolean isArray_rss() { + return false; + } + + /** + * Return the offset (in bytes) of the field 'rss' + */ + public static int offset_rss() { + return (128 / 8); + } + + /** + * Return the offset (in bits) of the field 'rss' + */ + public static int offsetBits_rss() { + return 128; + } + + /** + * Return the value (as a int) of the field 'rss' + */ + public int get_rss() { + return (int)getUIntElement(offsetBits_rss(), 16); + } + + /** + * Set the value of the field 'rss' + */ + public void set_rss(int value) { + setUIntElement(offsetBits_rss(), 16, value); + } + + /** + * Return the size, in bytes, of the field 'rss' + */ + public static int size_rss() { + return (16 / 8); + } + + /** + * Return the size, in bits, of the field 'rss' + */ + public static int sizeBits_rss() { + return 16; } Index: SensorPacket.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/SensorPacket.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SensorPacket.java 21 Jul 2003 18:24:22 -0000 1.8 --- SensorPacket.java 30 Jul 2003 22:17:41 -0000 1.9 *************** *** 84,94 **** s += " [="+Long.toString((long)tempF)+" Fahrenheit Degree]\n"; */ ! if (packet[2]==1 && packet[7]!=-1 && packet[10]!=1){ ! s += " [MoteID="+Long.toString(packet[10])+ "]\n"; //Humidity //s += " [Humidity Data="+Long.toString(packet[12]*256)+Long.toString(packet[11])+"]"; //Temperature //s += " [TempData="+Long.toString(packet[14]*256)+ Long.toString(packet[13])+"]"; s += " [TempData="+Long.toString(packet[14])+ " " + Long.toString(packet[13])+"]"; } return s; --- 84,99 ---- s += " [="+Long.toString((long)tempF)+" Fahrenheit Degree]\n"; */ ! //if (packet[2]==1 && packet[7]!=-1 && packet[5]!=1){ ! if (packet[2]==1 && packet[5]!=1){ ! s += " [MoteID="+Long.toString(packet[5])+ "]\n"; //Humidity //s += " [Humidity Data="+Long.toString(packet[12]*256)+Long.toString(packet[11])+"]"; + //cnt + s += " [Cnt#="+Long.toString(packet[7])+ "]\n"; + //Temperature //s += " [TempData="+Long.toString(packet[14]*256)+ Long.toString(packet[13])+"]"; s += " [TempData="+Long.toString(packet[14])+ " " + Long.toString(packet[13])+"]"; + } return s; |