[Firebug-cvs] firebug/project/java/src/org/firebug DBLogger.java,1.16,1.17 SensorMsg.java,1.3,1.4
Brought to you by:
doolin
From: <che...@us...> - 2003-07-10 09:03:00
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1:/tmp/cvs-serv9432/src/org/firebug Modified Files: DBLogger.java SensorMsg.java Log Message: add cnt to the sensormsg Index: DBLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/DBLogger.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** DBLogger.java 2 Jul 2003 00:47:49 -0000 1.16 --- DBLogger.java 10 Jul 2003 09:02:58 -0000 1.17 *************** *** 60,64 **** // message. ! SensorMsg msg = new SensorMsg(packet,5,19); Connection conn = dbh.getConnection(); --- 60,64 ---- // message. ! SensorMsg msg = new SensorMsg(packet,5,21); Connection conn = dbh.getConnection(); *************** *** 73,77 **** int mote_id = getMoteID(packet); ! int mote_id_test = msg.get_MoteID(); if (mote_id != mote_id_test){ --- 73,77 ---- int mote_id = getMoteID(packet); ! int mote_id_test = msg.get_addr(); if (mote_id != mote_id_test){ *************** *** 79,82 **** --- 79,83 ---- } + int cnt=msg.get_cnt(); float temp = msg.get_temp(); float rel_hum = msg.get_rel_hum(); *************** *** 110,113 **** --- 111,115 ---- String updatequery = "UPDATE current " + "SET time=" + time + ", " + + "cnt=" + cnt + "," + "rel_hum=" + rel_hum + ", " + "baro_pres=" + baro_pres + ", " *************** *** 119,123 **** + temp + ", " + rel_hum + ", " ! + baro_pres + ")"; --- 121,126 ---- + temp + ", " + rel_hum + ", " ! + baro_pres + "," ! + cnt + ")"; Index: SensorMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/SensorMsg.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SensorMsg.java 23 May 2003 00:57:14 -0000 1.3 --- SensorMsg.java 10 Jul 2003 09:02:58 -0000 1.4 *************** *** 7,22 **** package org.firebug; - public class SensorMsg extends net.tinyos.message.Message { /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 14; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 128; ! /** Create a new SensorMsg of size 14. */ public SensorMsg() { super(DEFAULT_MESSAGE_SIZE); } --- 7,22 ---- package org.firebug; public class SensorMsg extends net.tinyos.message.Message { /** 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); + amTypeSet(AM_TYPE); } *************** *** 24,27 **** --- 24,28 ---- public SensorMsg(int data_length) { super(data_length); + amTypeSet(AM_TYPE); } *************** *** 32,35 **** --- 33,37 ---- public SensorMsg(int data_length, int base_offset) { super(data_length, base_offset); + amTypeSet(AM_TYPE); } *************** *** 40,43 **** --- 42,46 ---- public SensorMsg(byte[] data) { super(data); + amTypeSet(AM_TYPE); } *************** *** 48,51 **** --- 51,55 ---- public SensorMsg(byte[] data, int base_offset) { super(data, base_offset); + amTypeSet(AM_TYPE); } *************** *** 56,59 **** --- 60,64 ---- public SensorMsg(byte[] data, int base_offset, int data_length) { super(data, base_offset, data_length); + amTypeSet(AM_TYPE); } *************** *** 64,67 **** --- 69,73 ---- public SensorMsg(net.tinyos.message.Message msg, int base_offset) { super(msg, base_offset, DEFAULT_MESSAGE_SIZE); + amTypeSet(AM_TYPE); } *************** *** 72,80 **** public SensorMsg(net.tinyos.message.Message msg, int base_offset, int data_length) { super(msg, base_offset, data_length); ! } ! ! /** Return the Active Message type of this message (-1 if unknown). */ ! public int amType() { ! return AM_TYPE; } --- 78,82 ---- public SensorMsg(net.tinyos.message.Message msg, int base_offset, int data_length) { super(msg, base_offset, data_length); ! amTypeSet(AM_TYPE); } *************** *** 83,101 **** * message type name and the non-indexed field values. */ - /* public String toString() { String s = "Message <SensorMsg> \n"; ! s += " [MoteID=0x"+Long.toHexString(get_MoteID())+"]\n"; ! s += " [temp=0x" + Float.intBitsToFloat(get_temp()) + "]\n"; ! s += " [rel_hum=0x"+Float.toHexString(get_rel_hum())+"]\n"; ! s += " [baro_pres=0x"+Float.toHexString(get_baro_pres())+"]\n"; return s; } - */ // Message-type-specific access methods appear below. ///////////////////////////////////////////////////////// ! // Accessor methods for field: MoteID // Field type: int // Offset (bits): 0 --- 85,112 ---- * message type name and the non-indexed field values. */ public String toString() { String s = "Message <SensorMsg> \n"; ! try { ! s += " [addr=0x"+Long.toHexString(get_addr())+"]\n"; ! } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } ! try { ! s += " [cnt=0x"+Long.toHexString(get_cnt())+"]\n"; ! } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } ! try { ! s += " [temp="+Float.toString(get_temp())+"]\n"; ! } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } ! try { ! s += " [rel_hum="+Float.toString(get_rel_hum())+"]\n"; ! } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } ! try { ! s += " [baro_pres="+Float.toString(get_baro_pres())+"]\n"; ! } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } // Message-type-specific access methods appear below. ///////////////////////////////////////////////////////// ! // Accessor methods for field: addr // Field type: int // Offset (bits): 0 *************** *** 104,159 **** /** ! * Return whether the field 'MoteID' is signed (true). */ ! public static boolean isSigned_MoteID() { return true; } /** ! * Return whether the field 'MoteID' is an array (false). */ ! public static boolean isArray_MoteID() { return false; } /** ! * Return the offset (in bytes) of the field 'MoteID' */ ! public static int offset_MoteID() { return (0 / 8); } /** ! * Return the offset (in bits) of the field 'MoteID' */ ! public static int offsetBits_MoteID() { return 0; } /** ! * Return the value (as a int) of the field 'MoteID' */ ! public int get_MoteID() { ! return (int)getUIntElement(offsetBits_MoteID(), 16); } /** ! * Set the value of the field 'MoteID' */ ! public void set_MoteID(int value) { ! setUIntElement(offsetBits_MoteID(), 16, value); } /** ! * Return the size, in bytes, of the field 'MoteID' */ ! public static int size_MoteID() { return (16 / 8); } /** ! * Return the size, in bits, of the field 'MoteID' */ ! public static int sizeBits_MoteID() { return 16; } --- 115,233 ---- /** ! * Return whether the field 'addr' is signed (true). */ ! public static boolean isSigned_addr() { return true; } /** ! * Return whether the field 'addr' is an array (false). */ ! public static boolean isArray_addr() { return false; } /** ! * Return the offset (in bytes) of the field 'addr' */ ! public static int offset_addr() { return (0 / 8); } /** ! * Return the offset (in bits) of the field 'addr' */ ! public static int offsetBits_addr() { return 0; } /** ! * Return the value (as a int) of the field 'addr' */ ! public int get_addr() { ! return (int)getUIntElement(offsetBits_addr(), 16); } /** ! * Set the value of the field 'addr' */ ! public void set_addr(int value) { ! setUIntElement(offsetBits_addr(), 16, value); } /** ! * Return the size, in bytes, of the field 'addr' */ ! public static int size_addr() { return (16 / 8); } /** ! * Return the size, in bits, of the field 'addr' */ ! public static int sizeBits_addr() { ! return 16; ! } ! ! ///////////////////////////////////////////////////////// ! // Accessor methods for field: cnt ! // Field type: int ! // Offset (bits): 16 ! // Size (bits): 16 ! ///////////////////////////////////////////////////////// ! ! /** ! * Return whether the field 'cnt' is signed (true). ! */ ! public static boolean isSigned_cnt() { ! return true; ! } ! ! /** ! * Return whether the field 'cnt' is an array (false). ! */ ! public static boolean isArray_cnt() { ! return false; ! } ! ! /** ! * Return the offset (in bytes) of the field 'cnt' ! */ ! public static int offset_cnt() { ! return (16 / 8); ! } ! ! /** ! * Return the offset (in bits) of the field 'cnt' ! */ ! public static int offsetBits_cnt() { ! return 16; ! } ! ! /** ! * Return the value (as a int) of the field 'cnt' ! */ ! public int get_cnt() { ! return (int)getUIntElement(offsetBits_cnt(), 16); ! } ! ! /** ! * Set the value of the field 'cnt' ! */ ! public void set_cnt(int value) { ! setUIntElement(offsetBits_cnt(), 16, value); ! } ! ! /** ! * Return the size, in bytes, of the field 'cnt' ! */ ! public static int size_cnt() { ! return (16 / 8); ! } ! ! /** ! * Return the size, in bits, of the field 'cnt' ! */ ! public static int sizeBits_cnt() { return 16; } *************** *** 162,166 **** // Accessor methods for field: temp // Field type: float ! // Offset (bits): 16 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 236,240 ---- // Accessor methods for field: temp // Field type: float ! // Offset (bits): 32 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 184,188 **** */ public static int offset_temp() { ! return (16 / 8); } --- 258,262 ---- */ public static int offset_temp() { ! return (32 / 8); } *************** *** 191,195 **** */ public static int offsetBits_temp() { ! return 16; } --- 265,269 ---- */ public static int offsetBits_temp() { ! return 32; } *************** *** 225,229 **** // Accessor methods for field: rel_hum // Field type: float ! // Offset (bits): 48 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 299,303 ---- // Accessor methods for field: rel_hum // Field type: float ! // Offset (bits): 64 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 247,251 **** */ public static int offset_rel_hum() { ! return (48 / 8); } --- 321,325 ---- */ public static int offset_rel_hum() { ! return (64 / 8); } *************** *** 254,258 **** */ public static int offsetBits_rel_hum() { ! return 48; } --- 328,332 ---- */ public static int offsetBits_rel_hum() { ! return 64; } *************** *** 288,292 **** // Accessor methods for field: baro_pres // Field type: float ! // Offset (bits): 80 // Size (bits): 32 ///////////////////////////////////////////////////////// --- 362,366 ---- // Accessor methods for field: baro_pres // Field type: float ! // Offset (bits): 96 // Size (bits): 32 ///////////////////////////////////////////////////////// *************** *** 310,314 **** */ public static int offset_baro_pres() { ! return (80 / 8); } --- 384,388 ---- */ public static int offset_baro_pres() { ! return (96 / 8); } *************** *** 317,321 **** */ public static int offsetBits_baro_pres() { ! return 80; } --- 391,395 ---- */ public static int offsetBits_baro_pres() { ! return 96; } |