firebug-cvs Mailing List for FireBug: wireless wildfire monitoring (Page 15)
Brought to you by:
doolin
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(36) |
Jun
(45) |
Jul
(108) |
Aug
(31) |
Sep
(2) |
Oct
(4) |
Nov
(113) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(63) |
Feb
(37) |
Mar
(24) |
Apr
(6) |
May
(5) |
Jun
(5) |
Jul
(71) |
Aug
(42) |
Sep
(7) |
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(64) |
Jun
(71) |
Jul
(51) |
Aug
(89) |
Sep
(24) |
Oct
(1) |
Nov
(1) |
Dec
(2) |
2006 |
Jan
|
Feb
|
Mar
(3) |
Apr
(2) |
May
|
Jun
|
Jul
(21) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: David M. D. <do...@us...> - 2004-08-30 20:34:07
|
Update of /cvsroot/firebug/fireboard/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20331 Added Files: NMEA.nc Log Message: Added an interface for parsing NMEA sentences. --- NEW FILE: NMEA.nc --- /** * Interface for defining behavior of NMEA - 0183 parser. */ includes nmea_parse; interface NMEA { command uint8_t get_type (const char * nmeastring); command result_t gga_parse (GGA_Data * gga_data, const char * gga_string); command result_t gll_parse (GLL_Data * gll_data, const char * gll_string); command result_t gsa_parse (GSA_Data * gsa_data, const char * gsa_string); command result_t gsv_parse (GSV_Data * gsv_data, const char * gsv_string); command result_t rmc_parse (RMC_Data * rmc_data, const char * rmc_string); command result_t vtg_parse (VTG_Data * vtg_data, const char * vtg_string); command result_t mss_parse (MSS_Data * mss_data, const char * mss_string); } |
From: David M. D. <do...@us...> - 2004-08-30 17:14:16
|
Update of /cvsroot/firebug/fireboard/apps/TestNMEA In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9055/TestNMEA Log Message: Directory /cvsroot/firebug/fireboard/apps/TestNMEA added to the repository |
From: David M. D. <do...@us...> - 2004-08-30 17:03:47
|
Update of /cvsroot/firebug/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7003 Added Files: gsaparse.c Log Message: nmea parsing code written in c added to enable testing of functionality when the c code implemented in nesc. --- NEW FILE: gsaparse.c --- #include <stdio.h> #include <stdlib.h> #include <memory.h> #include "nmea_parse.h" #include "leadtek_9546.h" GSA_Data * nmea_gsa_new(void) { GSA_Data * gsa_data; gsa_data = (GSA_Data*)malloc(sizeof(GSA_Data)); memset(gsa_data,0x0,sizeof(GSA_Data)); return gsa_data; } void nmea_gsa_delete(GSA_Data * gsa_data) { memset((void*)gsa_data,0xdd,sizeof(GSA_Data)); free(gsa_data); } void nmea_gsa_print(const GSA_Data * gsa_data) { int i; printf("Mode1: %c\n",gsa_data->mode1); printf("Mode2: %d\n",gsa_data->mode2); for (i=0; i<12; i++) { printf("Sat %d: %d\n",i,gsa_data->sat_used[i]); } printf("PDOP: %f\n",gsa_data->PDOP); printf("HDOP: %f\n",gsa_data->HDOP); printf("VDOP: %f\n",gsa_data->VDOP); } #define extract_mode2_m(data) (data[0] - '0') #define find_next_field_m(foo) while (*foo != ',')foo++;foo++ #define extract_sat_number_m(foo) (10*(foo[0]-'0') + (foo[1]-'0')) #define extract_DOP_m(foo) ((foo[0]-'0') + (0.1*(foo[2]-'0'))) GSA_Data * nmea_gsa_parse(const char * gsa_string) { int i; GSA_Data * gsa_data = nmea_gsa_new(); const char * p = gsa_string; find_next_field_m(p); gsa_data->mode1 = *p; find_next_field_m(p); gsa_data->mode2 = *p - '0'; for (i=0; i<12; i++) { find_next_field_m(p); //printf("current char: %c\n",*p); if (*p != ',') { gsa_data->sat_used[i] = extract_sat_number_m(p); } else { gsa_data->sat_used[i] = 0; } } find_next_field_m(p); gsa_data->PDOP = extract_DOP_m(p); find_next_field_m(p); gsa_data->HDOP = extract_DOP_m(p); find_next_field_m(p); gsa_data->VDOP = extract_DOP_m(p); return gsa_data; } |
From: David M. D. <do...@us...> - 2004-08-30 17:03:08
|
Update of /cvsroot/firebug/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6892 Added Files: .cvsignore ggaparse.c gllparse.c gsvparse.c mssparse.c nmea_parse.c nmea_parse.h nsew.c packer.c rmcparse.c vtgparse.c Log Message: nmea parsing code written in c added to enable testing of functionality when the c code implemented in nesc. --- NEW FILE: .cvsignore --- *.stackdump --- NEW FILE: gsvparse.c --- #include <stdio.h> #include <stdlib.h> #include <memory.h> #include "nmea_parse.h" #include "leadtek_9546.h" GSV_Data * nmea_gsv_new(void) { GSV_Data * gsv_data; gsv_data = (GSV_Data*)malloc(sizeof(GSV_Data)); memset(gsv_data,0xda,sizeof(GSV_Data)); return gsv_data; } void nmea_gsv_delete(GSV_Data * gsv_data) { memset((void*)gsv_data,0xdd,sizeof(GSV_Data)); free(gsv_data); } void nmea_gsv_print(const GSV_Data * gsv_data) { int i; printf("Num messages: %d\n",gsv_data->num_messages); printf("Message number: %d\n",gsv_data->message_number); printf("Satellites in view: %d\n",gsv_data->satellites_in_view); for (i=0; i<4; i++) { printf("sat id: %d\n",gsv_data->channel[i].sat_id); printf("elevation: %d\n",gsv_data->channel[i].elevation); printf("azimuth: %d\n",gsv_data->channel[i].azimuth); printf("SNR: %d\n",gsv_data->channel[i].SNR); } } #define find_next_field_m(foo) while (*foo != ',') foo++;foo++ #define char_to_int_m(foo) (*foo-'0') #define extract_sats_in_view_m(foo) (10*(foo[0]-'0') + (foo[1]-'0')) #define extract_sat_number_m(foo) (10*(foo[0]-'0') + (foo[1]-'0')) #define extract_azimuth_m(foo) (100*(foo[0]-'0') + 10*(foo[1]-'0') + (foo[2]-'0')) GSV_Data * nmea_gsv_parse(const char * gsv_string) { GSV_Data * gsv_data = nmea_gsv_new(); const char * p = gsv_string; int i; uint8_t num_sats,mess_num; uint8_t numchannels; find_next_field_m(p); gsv_data->num_messages = char_to_int_m(p); find_next_field_m(p); mess_num = char_to_int_m(p); gsv_data->message_number = mess_num; find_next_field_m(p); num_sats = extract_sats_in_view_m(p); gsv_data->satellites_in_view = num_sats; // This is convenient for determining how many // channels to parse. if (mess_num*4 < num_sats) { numchannels = 4; } else { numchannels = num_sats % 4; } for (i=0; i<numchannels; i++) { find_next_field_m(p); gsv_data->channel[i].sat_id = extract_sat_number_m(p); find_next_field_m(p); gsv_data->channel[i].elevation = extract_sat_number_m(p); find_next_field_m(p); gsv_data->channel[i].azimuth = extract_azimuth_m(p); find_next_field_m(p); gsv_data->channel[i].SNR = extract_sat_number_m(p); } return gsv_data; } --- NEW FILE: packer.c --- // Some macros for packing floats into uint16s #include <stdio.h> typedef struct { uint8_t hours; //Hours uint8_t minutes;//Minutes uint8_t Lat_deg;//Latitude degrees uint8_t Long_deg;//Longitude degrees uint32_t dec_sec;//Decimal seconds uint32_t Lat_dec_min;//Latitude decimal minutes uint32_t Long_dec_min;//Longitude decimal minutes uint8_t NSEWind;//NSEWind uint8_t Fixed; // as to whether the packet is valid(i.e. has the gps Fixed on to the sattelites). } XSensorMTS420GPSData1; typedef struct { uint8_t hours; //Hours uint8_t minutes;//Minutes uint32_t dec_sec;//Decimal seconds uint8_t Lat_deg;//Latitude degrees uint32_t Lat_dec_min;//Latitude decimal minutes uint8_t Long_deg;//Longitude degrees uint32_t Long_dec_min;//Longitude decimal minutes uint8_t NSEWind;//NSEWind uint8_t Fixed; // as to whether the packet is valid(i.e. has the gps Fixed on to the sattelites). } XSensorMTS420GPSData2; /* gps_uart->data[DEC_SEC] = temp&0xff; gps_uart->data[DEC_SEC+1] = (temp&0xff00)>>8; gps_uart->data[DEC_SEC+2] = (temp&0xff0000)>>16; gps_uart->data[DEC_SEC+3] = (temp&0xff000000)>>24; */ #define pack_4_bytes_m(ival,array) (array[0]=ival&0xff,array[1]&0xff00>>8,array[2]&0xff0000>>16,array[3]&0xff000000>>24) #define unpack_4_bytes(ival,array) (0) int main(int argc, char ** argv) { float fval = 32.33; uint32_t ival; uint8_t array[4] = {0xda}; typedef struct _floatbytes { float bytes; } floatbytes; floatbytes fb; floatbytes * pfb; pfb = &fb; ival = (uint32_t)(100*fval); printf("ival: %d\n",ival); //pack_4_bytes_m(ival,array); array[0]=ival&0xff; array[1]=ival&0xff00>>8; array[2]=ival&0xff0000>>16; array[3]=ival&0xff000000>>24; printf("Printing packed array: %f\n",*array/100.0); pfb = (floatbytes*)array; printf("Printing packed array: %f\n",pfb->bytes/100.0); printf("Sizeof struct1: %d\n",sizeof(XSensorMTS420GPSData1)); printf("Sizeof struct2: %d\n",sizeof(XSensorMTS420GPSData2)); return 0; } --- NEW FILE: rmcparse.c --- #include <stdio.h> #include <stdlib.h> #include <memory.h> #include "nmea_parse.h" #include "leadtek_9546.h" RMC_Data * nmea_rmc_new(void) { RMC_Data * rmc_data; rmc_data = (RMC_Data*)malloc(sizeof(RMC_Data)); memset(rmc_data,0x0,sizeof(RMC_Data)); return rmc_data; } void nmea_rmc_delete(RMC_Data * rmc_data) { memset((void*)rmc_data,0xdd,sizeof(RMC_Data)); free(rmc_data); } void nmea_rmc_print(const RMC_Data * rmc_data) { } RMC_Data * nmea_rmc_parse(const char * rmc_string) { RMC_Data * rmc_data = nmea_rmc_new(); //const char * p = rmc_string; return rmc_data; } --- NEW FILE: nsew.c --- /* Check out what bit masking does to certain chars. */ #include <stdio.h> int main(int argc, char ** argv) { printf("N: %d\n",'N'); printf("S: %d\n",'S'); printf("E: %d\n",'E'); printf("W: %d\n",'W'); printf("N & E: %d\n",'N'&'E'); printf("S & E: %d\n",'S'&'E'); printf("N & W: %d\n",'N'&'W'); printf("S & W: %d\n",'S'&'W'); return 0; } --- NEW FILE: ggaparse.c --- #include <stdio.h> #include <stdlib.h> #include <memory.h> #include "nmea_parse.h" #include "leadtek_9546.h" char * gga = "$GPGGA,231622.994,3751.3086,N,12216.5235,W,1,09,1.1,-4.5,M,,,,0000*30"; /* #define extract_num_sats_m(data) (10*(data[0]-'0') + (data[1]-'0')) #define extract_hours_m(data) (10*(data[0]-'0') + (data[1]-'0')) #define extract_minutes_m(data) (10*(data[2]-'0') + (data[3]-'0')) #define extract_dec_sec_m(data) (10*(data[4]-'0') + (data[5]-'0') + 0.1*(data[7]-'0') \ + 0.01*(data[8]-'0') \ + 0.001*(data[9]-'0')) #define extract_Lat_deg_m(data) (10*(data[0]-'0') + (data[1]-'0')) #define extract_Lat_dec_min_m(data) (10*(data[2]-'0') + (data[3]-'0') + 0.1*(data[5]-'0') \ + 0.01*(data[6]-'0') + 0.001*(data[7]-'0') + 0.0001*(data[8]-'0')) #define extract_Long_deg_m(data) (100*(data[0]-'0') + 10*(data[1]-'0') + (data[2]-'0')) #define extract_Long_dec_min_m(data) (10*(data[3]-'0') + (data[4]-'0') + 0.1*(data[6]-'0') \ + 0.01*(data[7]-'0') + 0.001*(data[8]-'0') + 0.0001*(data[9]-'0')) */ #define NS_m(foo) ((foo[28]=='N') ? 1 : 0) #define EW_m(foo) ((foo[41]=='W') ? 1 : 0) #define extract_NSEWind_m(foo) ((EW_m(foo)) | ((NS_m(foo))<<4)) int nmea_is_gga_string(const char * nmea_string) { if ((nmea_string[3] == 'G') & (nmea_string[4] == 'G') & (nmea_string[5] == 'A')) { return 1; } else { return 0; } } GGA_Data * nmea_gga_new(void) { GGA_Data * gga_data; gga_data = (GGA_Data*)malloc(sizeof(GGA_Data)); memset(gga_data,0xda,sizeof(GGA_Data)); return gga_data; } void nmea_gga_delete(GGA_Data * gga_data) { memset((void*)gga_data,0xdd,sizeof(GGA_Data)); free(gga_data); } /** These functions can be supplanted by the macros once everything is tested. */ static inline int extract_hours(char * data) { return (10*(data[0]-'0') + (data[1]-'0')); } static inline int extract_minutes(char * data) { return (10*(data[2]-'0') + (data[3]-'0')); } /** FIXME: Where is data[6]? The decimal point? */ static inline float extract_dec_sec(char * data) { float dec_secs; dec_secs = 10*(data[4]-'0') + (data[5]-'0') + 0.1*(data[7]-'0') + 0.01*(data[8]-'0') + 0.001*(data[9]-'0'); return dec_secs; } static inline int extract_Lat_deg(char * data) { return 10*(data[0]-'0') + (data[1]-'0'); } static inline float extract_Lat_dec_min(char * data) { float dec_min; dec_min = 10*(data[2]-'0') + (data[3]-'0') + 0.1*(data[5]-'0') + 0.01*(data[6]-'0') + 0.001*(data[7]-'0') + 0.0001*(data[8]-'0'); /* dec_min = 100000*(data[2]-'0') + 10000*(data[3]-'0') + 1000*(data[4]-'0') + 100*(data[5]-'0') + 10*(data[6]-'0') + (data[7]-'0'); */ return dec_min; } static inline int extract_Long_deg(char * data) { return (100*(data[0]-'0') + 10*(data[1]-'0') + (data[2]-'0')); } static inline float extract_Long_dec_min(char * data) { float dec_min; dec_min = 10*(data[3]-'0') + (data[4]-'0') + 0.1*(data[6]-'0') + 0.01*(data[7]-'0') + 0.001*(data[8]-'0') + 0.0001*(data[9]-'0'); /* dec_min = 100000*(data[3]-'0') + 10000*(data[4]-'0') + 1000*(data[5]-'0') + 100*(data[6]-'0') + 10*(data[7]-'0') + (data[8]-'0'); */ return dec_min; } static inline int extract_NSEWind(char * gga_data) { char NS, EW; // This would be a funky macro... NS = (gga_data[28] == 'N') ? 1 : 0; EW = (gga_data[41] == 'W') ? 1 : 0; return (EW | (NS<<4)); // eg. Status = 000N000E = 00010000 } static inline int extract_num_sats(char * data) { return (10*(data[0]-'0') + (data[1]-'0')); } // Later add a print function etc. void nmea_gga_print(const GGA_Data * gga_data) { printf("hours: %d\n",gga_data->hours); printf("minutes: %d\n",gga_data->minutes); printf("dec_sec: %f\n",gga_data->dec_sec); printf("Lat_deg: %d\n",gga_data->Lat_deg); printf("Lat_dec_min: %f\n",gga_data->Lat_dec_min); printf("Long_deg: %d\n",gga_data->Long_deg); printf("Long_dec_min: %f\n",gga_data->Long_dec_min); printf("Num sats: %d\n",gga_data->num_sats); printf("NSEWind: %d\n",gga_data->NSEWind); } /** @brief Parses an NMEA-0183 GGA string emitted by the * leadtek 9546 unit. This function was written to * support programming in TinyOS, where the character * to numerical conversion is performed by the macros. * Using this function, changes to the conversion macros * can be easily and safely tested. * * @param gga_string is the character array coming from the * the leadtek unit. * * @return Pointer to GGA_Data struct containing processed * values from the character array. * * @warning This function assumes that the values stored as * characters in the array have the same fixed numbers, * which allows offsets into the character array to be * hardcoded into the parsing function. This makes sense * for small devices such as microcontrollers. For a pc, * probably better to use atoi, atof, etc. * * @author David M. Doolin */ GGA_Data * nmea_gga_parse(const char * gga_string) { int i = 0; int numcommas = 0; int numsats = 0; const char * data; GGA_Data * ggad = nmea_gga_new(); while (numcommas < 7) { if (gga_string[i] == ',') { numcommas++; } i++; } numsats = (10*(gga_string[i]-'0') + (gga_string[i+1]-'0')); // Change all of these to do comma scanning, which will // make everything size independent. data = &gga_string[45]; ggad->num_sats = extract_num_sats_m(data); data = &gga_string[i]; numsats = extract_num_sats_m(data); data = &gga_string[7]; ggad->hours = extract_hours_m(data); data = &gga_string[7]; ggad->minutes = extract_minutes_m(data); data = &gga_string[7]; ggad->dec_sec = extract_dec_sec_m(data); data = &gga_string[18]; ggad->Lat_deg = extract_Lat_deg_m(data); data = &gga_string[18]; ggad->Lat_dec_min = extract_Lat_dec_min_m(data); data = &gga_string[30]; ggad->Long_deg = extract_Long_deg_m(data); data = &gga_string[30]; ggad->Long_dec_min = extract_Long_dec_min_m(data); ggad->NSEWind = extract_NSEWind_m(gga_string); return ggad; } // This can eventually be deleted. #ifdef STANDALONE void check_type(NMEA_Data * nmea_data) { } int main(int argc, char ** argv) { int i = 0; int numcommas = 0; int hours = 0; int minutes = 0; float dec_sec = 0; int Lat_deg = 0; float Lat_dec_min = 0; int Long_deg = 0; float Long_dec_min = 0; int numsats = 0; char * data; GGA_Data ggad; GLL_Data glld; nmea_get_type(gga); printf("Checking to see if the GGA macro works: %d\n", nmea_is_gga_string_m(gga)); while (numcommas < 7) { if (gga[i] == ',') { numcommas++; } i++; } numsats = (10*(gga[i]-'0') + (gga[i+1]-'0')); printf("num sats: %d\n",numsats); data = &gga[45]; numsats = extract_num_sats_m(data); printf("num sats: %d\n",numsats); data = &gga[i]; numsats = extract_num_sats_m(data); printf("num sats: %d\n",numsats); data = &gga[7]; hours = extract_hours_m(data); printf("hours: %d\n",hours); data = &gga[7]; minutes = extract_minutes_m(data); printf("minutes: %d\n",minutes); data = &gga[7]; dec_sec = extract_dec_sec_m(data); printf("dec_sec: %.3f\n",dec_sec); data = &gga[18]; Lat_deg = extract_Lat_deg_m(data); printf("Lat deg: %d\n", Lat_deg); data = &gga[18]; Lat_dec_min = extract_Lat_dec_min_m(data); printf("Lat dec min: %.4f\n",Lat_dec_min); data = &gga[30]; Long_deg = extract_Long_deg_m(data); printf("Long deg: %d\n", Long_deg); data = &gga[30]; Long_dec_min = extract_Long_dec_min_m(data); printf("Long dec min: %.4f\n",Long_dec_min); printf("sizeof GGA_Data: %d\n",sizeof(GGA_Data)); printf("sizeof GLL_Data: %d\n",sizeof(GLL_Data)); check_type((NMEA_Data*)&ggad); check_type((NMEA_Data*)&glld); return 0; } #endif /* STANDALONE */ --- NEW FILE: nmea_parse.h --- #ifndef NMEA_PARSE_H #define NMEA_PARSE_H #include <inttypes.h> /** @brief NMEA message parser which uses a lot of macros * and lower-level operations to extract data from the * character string comprising NMEA messages returned * from a GPS device. * * @todo RMC parser: Finish, check the test. * * @todo VTG parser, need to fix the test and get better * documentation for valid vtg type sentences because the * example provided in the LeadTek manual is not very good. * * @todo Move all the test strings to static const at the * head of the nmea_parse_test file so that the checksums * can all be verified. * * @todo Construct a framework for NMEA input messages used * to control the GPS device. */ /** @brief These are the most common NMEA-0183 sentences * all of which are available on the LeadTek 9546. * Other sentences can be added very easily. */ enum { GGA, GSV, GLL, GSA, RMC, VTG, MSS, UNKNOWN }; /** @brief Helpful macros, useful when only one or two particular * messages need to be extracted. If every NMEA sentence needs to * be processed, use the dispatch table instead of writing a * big if-else statement. White space is suppressed to keep * everything on one line. */ #define nmea_is_gga_string_m(ns) ((ns[3]=='G')&&(ns[4]=='G')&&(ns[5]=='A')) #define nmea_is_gsa_string_m(ns) ((ns[3]=='G')&&(ns[4]=='S')&&(ns[5]=='A')) #define nmea_is_gsv_string_m(ns) ((ns[3]=='G')&&(ns[4]=='S')&&(ns[5]=='V')) #define nmea_is_gll_string_m(ns) ((ns[3]=='G')&&(ns[4]=='L')&&(ns[5]=='L')) #define nmea_is_rmc_string_m(ns) ((ns[3]=='R')&&(ns[4]=='M')&&(ns[5]=='C')) #define nmea_is_vtg_string_m(ns) ((ns[3]=='V')&&(ns[4]=='T')&&(ns[5]=='G')) #define nmea_is_mss_string_m(ns) ((ns[3]=='M')&&(ns[4]=='S')&&(ns[5]=='S')) typedef struct nmea_data NMEA_Data; // 0 length for using in TinyOS interface // definitions. struct nmea_data { }; /** @brief The data encapsulated in an NMEA sentence * needs to be changed from character format to * appropriate type: int or float for time and * lat/long positions. For TOS applications, * incomplete types are rarely used, struct members * are accessed directly. For applications with * much faster cpu and more ram, these definitions * could be changed into incomplete types, and the * appropriate accessor methods written for support. * Currently, the mig message generator requires * messages to be defined as below to generate the * correct Java code. */ typedef struct gga_data { NMEA_Data nd; // Magic and mote_id could go into the NMEA_Data struct. //uint8_t magic; //uint16_t mote_id; uint8_t hours; uint8_t minutes; uint8_t Lat_deg; uint8_t Long_deg; float dec_sec; float Lat_dec_min; float Long_dec_min; uint8_t NSEWind; uint8_t num_sats; } GGA_Data; typedef struct gll_data { NMEA_Data nd; uint8_t Lat_deg; uint8_t Long_deg; uint8_t hours; uint8_t minutes; float Long_dec_min; float Lat_dec_min; float dec_sec; uint8_t NSEWind; char status; } GLL_Data; typedef struct gsa_data { NMEA_Data nd; uint8_t sat_used[12]; // These may be able to be stuffed into uint16_t, // depending on the precision the GPS unit reports. // Ask LeadTek or SiRF about this, but use float for // to get the code running. float PDOP; float HDOP; float VDOP; char mode1; uint8_t mode2; } GSA_Data; typedef struct _gsv_channel { uint8_t sat_id; uint8_t elevation; uint16_t azimuth; uint8_t SNR; } gsv_channel; typedef struct gsv_data { NMEA_Data nd; uint8_t num_messages; uint8_t message_number; uint8_t satellites_in_view; gsv_channel channel[4]; } GSV_Data; typedef struct rmc_data { NMEA_Data nd; } RMC_Data; typedef struct vtg_data { NMEA_Data nd; float course_true; float course_mag; float speed_knots; float speed_kph; } VTG_Data; typedef struct mss_data { NMEA_Data nd; uint8_t signal_strength; uint8_t SNR; uint16_t bit_rate; float beacon_freq; } MSS_Data; int nmea_get_type (const char * nmeastring); GGA_Data * nmea_gga_new (void); GLL_Data * nmea_gll_new (void); GSA_Data * nmea_gsa_new (void); GSV_Data * nmea_gsv_new (void); RMC_Data * nmea_rmc_new (void); VTG_Data * nmea_vtg_new (void); MSS_Data * nmea_mss_new (void); void nmea_gga_delete (GGA_Data * gga_data); void nmea_gll_delete (GLL_Data * gll_data); void nmea_gsa_delete (GSA_Data * gsa_data); void nmea_gsv_delete (GSV_Data * gsv_data); void nmea_rmc_delete (RMC_Data * rmc_data); void nmea_vtg_delete (VTG_Data * vtg_data); void nmea_mss_delete (MSS_Data * mss_data); GGA_Data * nmea_gga_parse (const char * gga_string); GLL_Data * nmea_gll_parse (const char * gll_string); GSA_Data * nmea_gsa_parse (const char * gsa_string); GSV_Data * nmea_gsv_parse (const char * gsv_string); RMC_Data * nmea_rmc_parse (const char * rmc_string); VTG_Data * nmea_vtg_parse (const char * vtg_string); MSS_Data * nmea_mss_parse (const char * mss_string); void nmea_gga_print (const GGA_Data * gga_data); void nmea_gll_print (const GLL_Data * gll_data); void nmea_gsa_print (const GSA_Data * gsa_data); void nmea_gsv_print (const GSV_Data * gsv_data); void nmea_mss_print (const MSS_Data * mss_data); int test_gga_parse (void); int test_gll_parse (void); int test_gsa_parse (void); int test_gsv_parse (void); int test_rmc_parse (void); int test_vtg_parse (void); int test_mss_parse (void); #endif /* NMEA_PARSE_H */ --- NEW FILE: mssparse.c --- #include <stdio.h> #include <stdlib.h> #include <memory.h> #include "nmea_parse.h" #include "leadtek_9546.h" MSS_Data * nmea_mss_new(void) { MSS_Data * mss_data; mss_data = (MSS_Data*)malloc(sizeof(MSS_Data)); memset(mss_data,0x0,sizeof(MSS_Data)); return mss_data; } void nmea_mss_delete(MSS_Data * mss_data) { memset((void*)mss_data,0xdd,sizeof(MSS_Data)); free(mss_data); } void nmea_mss_print(const MSS_Data * mss_data) { printf("Signal strength: %d\n",mss_data->signal_strength); printf("SNR: %d\n",mss_data->SNR); printf("Beacon freq: %f\n",mss_data->beacon_freq); printf("Bit rate: %d\n",mss_data->bit_rate); } #define find_next_field_m(foo) while (*foo != ',')foo++;foo++ #define extract_signal_strength_m(foo) (10*(foo[0]-'0') + (foo[1]-'0')) #define extract_SNR_m(foo) (10*(foo[0]-'0') + (foo[1]-'0')) #define extract_beacon_freq_m(foo) ((100*(foo[0]-'0')) \ +(10*(foo[1]-'0')) \ +(foo[2]-'0') \ +(0.1*(foo[4]-'0'))) #define extract_bit_rate_m(foo) ((100*(foo[0]-'0')) \ +(10*(foo[1]-'0')) \ +(foo[2]-'0')) MSS_Data * nmea_mss_parse(const char * mss_string) { MSS_Data * mss_data = nmea_mss_new(); const char * p = mss_string; find_next_field_m(p); mss_data->signal_strength = extract_signal_strength_m(p); find_next_field_m(p); mss_data->SNR = extract_SNR_m(p); find_next_field_m(p); mss_data->beacon_freq = extract_beacon_freq_m(p); find_next_field_m(p); mss_data->bit_rate = extract_bit_rate_m(p); return mss_data; } --- NEW FILE: nmea_parse.c --- #include <stdio.h> #include "nmea_parse.h" /** @brief This is a pretty small struct, should * not be too overwhelming even on a really * small device like a mica2. For a large * device where function pointers are supported, * a 3rd field for the appropriate function * * should be added. */ typedef struct nmea_types { char * nmea_type; unsigned char tag; } NMEA_Types; /** @brief These are the most common NMEA sentences, and what are * supported on the LeadTek 9546. */ NMEA_Types nt[] = { {"GGA", GGA}, {"GLL", GLL}, {"GSA", GSA}, {"GSV", GSV}, {"RMC", RMC}, {"VTG", VTG}, {NULL, 0 } }; /** @brief Scans the NMEA message type table, * returns an enum of the type of NMEA message. * The enum should be processed in the calling * function to handle actual parsing of the * message. * * @param nmeastring is the character array that * is emitted by the GPS unit. * * @return enum NMEA type for use by calling * function to invoke the appropriate parser for * the nmea sentence. */ int nmea_get_type(const char * nmeastring) { /** Advance the pointer to make it easier to * see how the characters in the incoming * nmea_string are compared to the characters * in the type table. */ const char * typestring = nmeastring + 3; int i = 0; while (nt[i].nmea_type != NULL) { char * type = nt[i].nmea_type; if ((typestring[0] == type[0]) && (typestring[1] == type[1]) && (typestring[2] == type[2])) { return nt[i].tag; } i++; } return UNKNOWN; } --- NEW FILE: vtgparse.c --- #include <stdio.h> #include <stdlib.h> #include <memory.h> #include "nmea_parse.h" #include "leadtek_9546.h" VTG_Data * nmea_vtg_new(void) { VTG_Data * vtg_data; vtg_data = (VTG_Data*)malloc(sizeof(VTG_Data)); memset(vtg_data,0xda,sizeof(VTG_Data)); return vtg_data; } void nmea_vtg_delete(VTG_Data * vtg_data) { memset((void*)vtg_data,0xdd,sizeof(VTG_Data)); free(vtg_data); } void nmea_vtg_print(const VTG_Data * vtg_data) { printf("course true: %f\n",vtg_data->course_true); } #define find_next_field_m(foo) while (*foo != ',')foo++;foo++ #define extract_course_true_m(foo) ((100*(foo[0]-'0')) \ +(10*(foo[1]-'0')) \ +(foo[2]-'0') \ +(0.1*(foo[4]-'0')) \ +(0.01*(foo[5]-'0'))) #define extract_course_mag_m(foo) (0) #define extract_speed_knots_m(foo) (0) #define extract_speed_kph_m(foo) (0) VTG_Data * nmea_vtg_parse(const char * vtg_string) { VTG_Data * vtg_data = nmea_vtg_new(); const char * p = vtg_string; find_next_field_m(p); vtg_data->course_true = extract_course_true_m(p); find_next_field_m(p); // Skip the Reference, already know its true. find_next_field_m(p); if (*p != ',') { vtg_data->course_mag = extract_course_mag_m(p); } find_next_field_m(p); find_next_field_m(p); vtg_data->speed_knots = extract_speed_knots_m(p); find_next_field_m(p); find_next_field_m(p); vtg_data->speed_kph = extract_speed_kph_m(p); return vtg_data; } --- NEW FILE: gllparse.c --- #include <stdio.h> #include <stdlib.h> #include <memory.h> #include "nmea_parse.h" #include "leadtek_9546.h" /** These macros are used for extracting data from the * LeadTek 9546 model, and may not be useful for other * GPS units. Check the output of each GPS unit carefully * for the number of digits in each field. */ // Start with defining the offsets. #define LAT_DEG 7 #define LAT_DEC_MIN 9 #define NS_IND 17 #define LONG_DEG 19 #define LONG_DEC_MIN 21 #define EW_IND 30 #define HOURS 32 #define STATUS 43 #define NS_m(foo) ((foo[NS_IND]=='N') ? 1 : 0) #define EW_m(foo) ((foo[EW_IND]=='W') ? 1 : 0) #define extract_NSEWind_m(foo) ((EW_m(foo)) | ((NS_m(foo))<<4)) static const char gll_test_string[] = {"$GPGLL,3723.2475,N,12158.3416,W,161229.487,A*2C"}; #define extract_long_m(data) (1) GLL_Data * nmea_gll_new(void) { GLL_Data * gll_data; gll_data = (GLL_Data*)malloc(sizeof(GLL_Data)); memset(gll_data,0xda,sizeof(GLL_Data)); return gll_data; } void nmea_gll_delete(GLL_Data * gll_data) { memset((void*)gll_data,0xdd,sizeof(GLL_Data)); free(gll_data); } void nmea_gll_print(const GLL_Data * gll_data) { printf("Lat deg: %d\n",gll_data->Lat_deg); printf("Lat dec min: %f\n",gll_data->Lat_dec_min); printf("Long deg: %d\n",gll_data->Long_deg); printf("Long dec min: %f\n",gll_data->Long_dec_min); printf("Hours: %d\n",gll_data->hours); printf("Minutes: %d\n",gll_data->minutes); printf("Seconds: %f\n",gll_data->dec_sec); printf("NSEWind: %d\n",gll_data->NSEWind); printf("Status: %c\n",gll_data->status); } GLL_Data * nmea_gll_parse(const char * gll_string) { GLL_Data * gll_data = nmea_gll_new(); const char * data; data = &gll_string[LAT_DEG]; gll_data->Lat_deg = extract_Lat_deg_m(data); gll_data->Lat_dec_min = extract_Lat_dec_min_m(data); data = &gll_string[LONG_DEG]; gll_data->Long_deg = extract_Long_deg_m(data); gll_data->Long_dec_min = extract_Long_dec_min_m(data); data = &gll_string[HOURS]; gll_data->hours = extract_hours_m(data); gll_data->minutes = extract_minutes_m(data); gll_data->dec_sec = extract_dec_sec_m(data); gll_data->status = gll_string[STATUS]; gll_data->NSEWind = extract_NSEWind_m(gll_string); return gll_data; } #ifdef STANDALONE int main(int argc, char ** argv) { const char gll_string[] = {"foo"}; nmea_gll_parse(gll_string); return 0; } #endif |
From: David M. D. <do...@us...> - 2004-08-30 17:01:34
|
Update of /cvsroot/firebug/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6565 Modified Files: leadtek_9546.c Added Files: nmea_parse_test.c Log Message: Added a test function for testing out the nmea parsing code. --- NEW FILE: nmea_parse_test.c --- #include <stdio.h> #include <string.h> #include <stdlib.h> #include "nmea_parse.h" int test_gga_parse(void) { int passed = 0; char * gga_string = "$GPGGA,231622.994,3751.3086,N,12216.5235,W,1,09,1.1,-4.5,M,,,,0000*30"; GGA_Data * gga_data = nmea_gga_new(); //(GGA_Data*)malloc(sizeof(GGA_Data)); GGA_Data * gga_parsed; int result; gga_data->hours = 23; gga_data->minutes = 16; gga_data->dec_sec = 22.994; gga_data->Lat_deg = 37; gga_data->Lat_dec_min = 51.3086; gga_data->Long_deg = 122; gga_data->Long_dec_min = 16.5235; gga_data->NSEWind = 17; gga_data->num_sats = 9; gga_parsed = nmea_gga_parse(gga_string); result = memcmp((const void*)gga_parsed,(const void*)(gga_data),sizeof(GGA_Data)); /* nmea_gga_print(gga_data); nmea_gga_print(gga_parsed); printf("result from memcmp: %d\n",result); */ if (result == 0) { printf("Passed nmea_gga_parse\n"); passed = 1; } else { printf("Failed nmea_gga_parse\n"); } nmea_gga_delete(gga_data); nmea_gga_delete(gga_parsed); return passed; } int test_gll_parse() { int passed = 0; const char gll_string[] = {"$GPGLL,3723.2475,N,12158.3416,W,161229.487,A*2C"}; GLL_Data * gll_data = nmea_gll_new(); GLL_Data * gll_parsed; int result; gll_data->hours = 16; gll_data->minutes = 12; gll_data->dec_sec = 29.487; gll_data->Lat_deg = 37; gll_data->Lat_dec_min = 23.2475; gll_data->Long_deg = 121; gll_data->Long_dec_min = 58.3416; gll_data->NSEWind = 17; gll_data->status = 'A'; gll_parsed = nmea_gll_parse(gll_string); result = memcmp((const void*)gll_parsed,(const void*)(gll_data),sizeof(GLL_Data)); //nmea_gll_print(gll_data); //nmea_gll_print(gll_parsed); if (result == 0) { printf("Passed nmea_gll_parse\n"); passed = 1; } else { printf("Failed nmea_gll_parse\n"); } nmea_gll_delete(gll_data); nmea_gll_delete(gll_parsed); return passed; } int test_gsa_parse() { int passed = 0; const char gsa_string[] = {"$GPGSA,A,3,07,02,26,27,09,04,15,,,,,,1.8,1.0,1.5*33"}; GSA_Data * gsa_data = nmea_gsa_new(); GSA_Data * gsa_parsed; int result; gsa_data->mode1 = 'A'; gsa_data->mode2 = 3; gsa_data->sat_used[0] = 7; gsa_data->sat_used[1] = 2; gsa_data->sat_used[2] = 26; gsa_data->sat_used[3] = 27; gsa_data->sat_used[4] = 9; gsa_data->sat_used[5] = 4; gsa_data->sat_used[6] = 15; gsa_data->sat_used[7] = 0; gsa_data->sat_used[8] = 0; gsa_data->sat_used[9] = 0; gsa_data->sat_used[10] = 0; gsa_data->sat_used[11] = 0; gsa_data->PDOP = 1.8; gsa_data->HDOP = 1.0; gsa_data->VDOP = 1.5; gsa_parsed = nmea_gsa_parse(gsa_string); result = memcmp((const void*)gsa_parsed,(const void*)(gsa_data),sizeof(GSA_Data)); //nmea_gsa_print(gsa_data); //nmea_gsa_print(gsa_parsed); if (result == 0) { printf("Passed nmea_gsa_parse\n"); passed = 1; } else { printf("Failed nmea_gsa_parse\n"); } nmea_gsa_delete(gsa_data); nmea_gsa_delete(gsa_parsed); return passed; } int test_gsv_parse() { int passed = 0; const char gsv_string1[] = {"$GPGSV,2,1,07,07,79,048,42,02,51,062,43,26,36,256,42,27,27,138,42,*71"}; const char gsv_string2[] = {"$GPGSV,2,2,07,09,23,313,42,04,19,159,41,15,12,041,42,*41"}; GSV_Data * gsv_data = nmea_gsv_new(); GSV_Data * gsv_parsed; int result; gsv_data->num_messages = 2; gsv_data->message_number = 1; gsv_data->satellites_in_view = 7; gsv_data->channel[0].sat_id = 7; gsv_data->channel[0].elevation = 79; gsv_data->channel[0].azimuth = 48; gsv_data->channel[0].SNR = 42; gsv_data->channel[1].sat_id = 2; gsv_data->channel[1].elevation = 51; gsv_data->channel[1].azimuth = 62; gsv_data->channel[1].SNR = 43; gsv_data->channel[2].sat_id = 26; gsv_data->channel[2].elevation = 36; gsv_data->channel[2].azimuth = 256; gsv_data->channel[2].SNR = 42; gsv_data->channel[3].sat_id = 27; gsv_data->channel[3].elevation = 27; gsv_data->channel[3].azimuth = 138; gsv_data->channel[3].SNR = 42; gsv_parsed = nmea_gsv_parse(gsv_string1); result = memcmp((const void*)gsv_parsed,(const void*)(gsv_data),sizeof(GSV_Data)); //nmea_gsv_print(gsv_data); //nmea_gsv_print(gsv_parsed); nmea_gsv_delete(gsv_parsed); if (result == 0) { printf("Passed nmea_gsv_parse\n"); passed = 1; } else { printf("Failed nmea_gsv_parse\n"); } gsv_parsed = nmea_gsv_parse(gsv_string2); //nmea_gsv_print(gsv_parsed); nmea_gsv_delete(gsv_parsed); nmea_gsv_delete(gsv_data); return passed; } int test_mss_parse() { int passed = 0; const char mss_string[] = {"$GPMSS,55,27,318.0,100,*66"}; MSS_Data * mss_data = nmea_mss_new(); MSS_Data * mss_parsed; int result; mss_data->signal_strength = 55; mss_data->SNR = 27; mss_data->beacon_freq = 318.0; mss_data->bit_rate = 100; mss_parsed = nmea_mss_parse(mss_string); result = memcmp((const void*)mss_parsed,(const void*)(mss_data),sizeof(MSS_Data)); if (result == 0) { printf("Passed nmea_mss_parse\n"); passed = 1; } else { printf("Failed nmea_mss_parse\n"); } //nmea_mss_print(mss_parsed); nmea_mss_delete(mss_data); nmea_mss_delete(mss_parsed); return passed; } int test_vtg_parse() { int passed = 0; const char vtg_string[] = {"$GPVTG,309.62,T,,M,0.13,N,0.2,K*6E"}; VTG_Data * vtg_data = nmea_vtg_new(); VTG_Data * vtg_parsed; int result; vtg_data->course_true = 309.62; vtg_parsed = nmea_vtg_parse(vtg_string); result = memcmp((const void*)vtg_parsed,(const void*)(vtg_data),sizeof(VTG_Data)); if (result == 0) { printf("Passed nmea_vtg_parse\n"); passed = 1; } else { printf("Failed nmea_vtg_parse\n"); } nmea_vtg_delete(vtg_data); nmea_vtg_delete(vtg_parsed); return passed; } int test_rmc_parse() { int passed = 0; //const char rmc_string[] = {"$GPRMC"}; //RMC_Data * rmc_data = nmea_rmc_new(); //RMC_Data * rmc_parsed; int result; if (result == 0) { printf("Passed nmea_rmc_parse\n"); passed = 1; } else { printf("Failed nmea_rmc_parse\n"); } return passed; } int test_nmea_parse() { test_gga_parse(); test_gll_parse(); test_gsa_parse(); test_gsv_parse(); test_mss_parse(); test_vtg_parse(); test_rmc_parse(); return 0; } int main(int argc, char ** argv) { test_nmea_parse(); return 0; } Index: leadtek_9546.c =================================================================== RCS file: /cvsroot/firebug/fireboard/sensors/leadtek9546/leadtek_9546.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** leadtek_9546.c 30 Aug 2004 16:58:15 -0000 1.3 --- leadtek_9546.c 30 Aug 2004 17:01:23 -0000 1.4 *************** *** 44,48 **** char data[] = {"$LTC,1000,0"}; char data1[] = {"$GPGSV,3,3,11,03,19,314,21,29,19,044,39,02,15,293,24"}; ! char data2[] = {"$GPGGA,023129.762,3754.1755,N,12218.2682,W,1,08,1.1,-19.4,M,,,,0000"}; --- 44,48 ---- char data[] = {"$LTC,1000,0"}; char data1[] = {"$GPGSV,3,3,11,03,19,314,21,29,19,044,39,02,15,293,24"}; ! //char data2[] = {"$GPGGA,023129.762,3754.1755,N,12218.2682,W,1,08,1.1,-19.4,M,,,,0000"}; |
From: David M. D. <do...@us...> - 2004-08-30 16:58:27
|
Update of /cvsroot/firebug/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5882 Modified Files: GpsPacketM.nc Makefile gps_driverM.nc leadtek_9546.c leadtek_9546.h Log Message: Moving in code from outside of tree. Index: leadtek_9546.h =================================================================== RCS file: /cvsroot/firebug/fireboard/sensors/leadtek9546/leadtek_9546.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** leadtek_9546.h 26 Mar 2004 00:39:27 -0000 1.6 --- leadtek_9546.h 30 Aug 2004 16:58:15 -0000 1.7 *************** *** 1,2 **** --- 1,8 ---- + + #ifndef LEADTEK_9546_H + #define LEADTEK_9546_H + + #include <inttypes.h> + /* tab:4 * *************** *** 77,84 **** - #ifndef LEADTEK_9546_H - #define LEADTEK_9546_H ! const uint8_t LEADTEK_POWER_ON = 1; --- 83,88 ---- ! //const uint8_t LEADTEK_POWER_ON = 1; *************** *** 93,101 **** #define GPS_END_MSG '*' #define GPS_DATA_LENGTH 128 - #define GPS_PACKET_START 0x24 //start of gps packet #define GPS_PACKET_END1 0x0D //penultimate byte of NMEA string #define GPS_PACKET_END2 0x0A //ultimate byte of NMEA string // Carriage return, ASCII 13 --- 97,107 ---- #define GPS_END_MSG '*' + #ifndef GPS_DATA_LENGTH #define GPS_DATA_LENGTH 128 #define GPS_PACKET_START 0x24 //start of gps packet #define GPS_PACKET_END1 0x0D //penultimate byte of NMEA string #define GPS_PACKET_END2 0x0A //ultimate byte of NMEA string + #endif + // Carriage return, ASCII 13 *************** *** 127,131 **** #define GPS_POWER_ON 1 ! const uint8_t gps_power_on = 0; --- 133,137 ---- #define GPS_POWER_ON 1 ! //const uint8_t gps_power_on = 0; *************** *** 135,138 **** --- 141,145 ---- * FIXME: Find out what leadtek uses for a proprietary header string. */ + /* const uint8_t gps_gga_mask[] = {"$LTC,NMEA," NMEA_GGA_MASK NMEA_END1 NMEA_END2}; const uint8_t gps_rmc_mask[] = {"$LTC,NMEA," NMEA_RMC_MASK NMEA_END1 NMEA_END2}; *************** *** 145,184 **** const uint8_t vtg_disable[] = {" ""$PSRF103,05,00,00,01*21" NMEA_END1 NMEA_END2}; - //typedef struct _gga_msg GGA_Msg; - typedef struct _gps_msg GPS_Msg; typedef GPS_Msg * GPS_MsgPtr; - struct _gps_msg { - - /* The following fields are received on the gps. */ uint8_t length; int8_t data[GPS_DATA_LENGTH]; uint16_t crc; }; - // 18 bytes. typedef struct GGAMsg { uint16_t mote_id; uint8_t hours; uint8_t minutes; - float dec_sec; uint8_t Lat_deg; - float Lat_dec_min; uint8_t Long_deg; - float Long_dec_min; uint8_t NSEWind; uint8_t num_sats; } GGAMsg; enum { ! AM_GGAMSG = 129 }; #endif /* LEADTEK_9546_H */ --- 152,243 ---- const uint8_t vtg_disable[] = {" ""$PSRF103,05,00,00,01*21" NMEA_END1 NMEA_END2}; + */ + // xbow has their own stuff for this. + #ifdef GPS_DATA_LENGTH + typedef struct _gps_msg GPS_Msg; typedef GPS_Msg * GPS_MsgPtr; struct _gps_msg { uint8_t length; int8_t data[GPS_DATA_LENGTH]; uint16_t crc; }; + #endif + // Some useful macros. + #define extract_num_sats_m(data) (10*(data[0]-'0') + (data[1]-'0')) + #define extract_hours_m(data) (10*(data[0]-'0') + (data[1]-'0')) + #define extract_minutes_m(data) (10*(data[2]-'0') + (data[3]-'0')) + #define extract_dec_sec_m(data) (10*(data[4]-'0') + (data[5]-'0') + 0.1*(data[7]-'0') \ + + 0.01*(data[8]-'0') \ + + 0.001*(data[9]-'0')) + #define extract_Lat_deg_m(data) (10*(data[0]-'0') + (data[1]-'0')) + #define extract_Lat_dec_min_m(data) (10*(data[2]-'0') + (data[3]-'0') + 0.1*(data[5]-'0') \ + + 0.01*(data[6]-'0') + 0.001*(data[7]-'0') + 0.0001*(data[8]-'0')) + #define extract_Long_deg_m(data) (100*(data[0]-'0') + 10*(data[1]-'0') + (data[2]-'0')) + #define extract_Long_dec_min_m(data) (10*(data[3]-'0') + (data[4]-'0') + 0.1*(data[6]-'0') \ + + 0.01*(data[7]-'0') + 0.001*(data[8]-'0') + 0.0001*(data[9]-'0')) typedef struct GGAMsg { + uint8_t magic; uint16_t mote_id; uint8_t hours; + uint8_t minutes; uint8_t Lat_deg; uint8_t Long_deg; uint8_t NSEWind; + + float dec_sec; + float Lat_dec_min; + float Long_dec_min; uint8_t num_sats; + } GGAMsg; enum { ! AM_GGAMSG = 130 ! }; ! ! ! typedef struct fbheader { ! uint8_t node_id; ! uint8_t am_type; ! uint8_t seq_num; ! uint8_t rsvd; ! } FBHeader; ! ! enum { ! AM_FBHEADERMSG = 228 ! }; ! ! typedef struct GGAMsg1 { ! FBHeader fbh; ! uint8_t hours; ! uint8_t minutes; ! uint8_t Lat_deg; ! uint8_t Long_deg; ! float dec_sec; ! float Lat_dec_min; ! float Long_dec_min; ! struct { ! uint8_t NS : 1; ! uint8_t EW : 1; ! uint8_t numsats : 4; ! uint8_t rsvd : 2; ! } bits; ! ! } GGAMsg1; ! ! ! enum { ! AM_GGAMSG1 = 229 }; + #endif /* LEADTEK_9546_H */ Index: leadtek_9546.c =================================================================== RCS file: /cvsroot/firebug/fireboard/sensors/leadtek9546/leadtek_9546.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** leadtek_9546.c 26 Mar 2004 00:39:27 -0000 1.2 --- leadtek_9546.c 30 Aug 2004 16:58:15 -0000 1.3 *************** *** 9,13 **** unsigned char ! crc(char * data, int size) { unsigned char cs = 0; --- 9,13 ---- unsigned char ! crc(const char * data, int size) { unsigned char cs = 0; *************** *** 37,41 **** } ! int main(int argc, char ** argv) { char data[] = {"$LTC,1000,0"}; --- 37,44 ---- } ! static char data2[] = {"$GPGGA,023129.762,3754.1755,N,12218.2682,W,1,08,1.1,-19.4,M,,,,0000"}; ! ! int ! main(int argc, char ** argv) { char data[] = {"$LTC,1000,0"}; *************** *** 52,58 **** ///////////////////////////// ! const uint8_t gps_gga_mask_crc[] = {"$LTC,NMEA," NMEA_GGA_MASK}; ! const uint8_t gps_rmc_mask_crc[] = {"$LTC,NMEA," NMEA_RMC_MASK}; ! const uint8_t gps_syncmode_on_crc[] = {"$LTC,SYNCMODE,1"}; const uint8_t gps_syncmode_off_crc[] = {"$LTC,SYNCMODE,0"}; --- 55,61 ---- ///////////////////////////// ! //const uint8_t gps_gga_mask_crc[] = {"$LTC,NMEA," NMEA_GGA_MASK}; ! //const uint8_t gps_rmc_mask_crc[] = {"$LTC,NMEA," NMEA_RMC_MASK}; ! //const uint8_t gps_syncmode_on_crc[] = {"$LTC,SYNCMODE,1"}; const uint8_t gps_syncmode_off_crc[] = {"$LTC,SYNCMODE,0"}; Index: gps_driverM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/sensors/leadtek9546/gps_driverM.nc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gps_driverM.nc 26 Mar 2004 00:39:27 -0000 1.9 --- gps_driverM.nc 30 Aug 2004 16:58:15 -0000 1.10 *************** *** 11,14 **** --- 11,29 ---- + #define extract_num_sats_m(data) (10*(data[0]-'0') + (data[1]-'0')) + #define extract_hours_m(data) (10*(data[0]-'0') + (data[1]-'0')) + #define extract_minutes_m(data) (10*(data[2]-'0') + (data[3]-'0')) + #define extract_dec_sec_m(data) (10*(data[4]-'0') + (data[5]-'0') + 0.1*(data[7]-'0') \ + + 0.01*(data[8]-'0') \ + + 0.001*(data[9]-'0')) + #define extract_Lat_deg_m(data) (10*(data[0]-'0') + (data[1]-'0')) + #define extract_Lat_dec_min_m(data) (10*(data[2]-'0') + (data[3]-'0') + 0.1*(data[5]-'0') \ + + 0.01*(data[6]-'0') + 0.001*(data[7]-'0') + 0.0001*(data[8]-'0')) + #define extract_Long_deg_m(data) (100*(data[0]-'0') + 10*(data[1]-'0') + (data[2]-'0')) + #define extract_Long_dec_min_m(data) (10*(data[3]-'0') + (data[4]-'0') + 0.1*(data[6]-'0') \ + + 0.01*(data[7]-'0') + 0.001*(data[8]-'0') + 0.0001*(data[9]-'0')) + + + module gps_driverM { *************** *** 19,24 **** command void readGps(); ! command uint8_t extract_hours(char * data); command uint8_t extract_minutes(char * data); --- 34,41 ---- command void readGps(); + command void count_commas(char * data); ! // Get rid of these. ! #if 0 command uint8_t extract_hours(char * data); command uint8_t extract_minutes(char * data); *************** *** 30,33 **** --- 47,51 ---- command uint8_t extract_NSEWind(char * data); command uint8_t extract_num_sats(char * data); + #endif command result_t isGGA(uint8_t * data); *************** *** 66,69 **** --- 84,91 ---- uint8_t state; uint8_t gps_state; + uint8_t parse_state; + uint8_t count = 0; + float alpha = 0.35; + static uint8_t sat_count = 0; GGAMsg gga_msg = {0}; *************** *** 74,88 **** */ norace bool have_gps_fix = 0; enum {IDLE, BUSY, BUSY_0, BUSY_1, GET_SAMPLE_0, GET_SAMPLE_1, POWEROFF, TIMER, GPS_WORKING, GPS_FINISHED}; command result_t StdControl.init() { ! //init_debug(); call Leds.init(); /** Control.init in GpsPacket.nc */ call GpsControl.init(); //SODbg(DBG_USR2, "gps_driverM.StdControl.init()\r\n"); return SUCCESS; --- 96,119 ---- */ norace bool have_gps_fix = 0; + bool have_gps_sats = FALSE; + uint8_t numsats = 0; + /* Average number of satellites is computed using EWMA. */ + float avg_sats = 0; enum {IDLE, BUSY, BUSY_0, BUSY_1, GET_SAMPLE_0, GET_SAMPLE_1, POWEROFF, TIMER, GPS_WORKING, GPS_FINISHED}; + enum {NMEA_GGA=1, NMEA_RMC}; + unsigned char nmea_type = 0; command result_t StdControl.init() { ! #if DBG_USER2 ! init_debug(); ! #endif call Leds.init(); /** Control.init in GpsPacket.nc */ call GpsControl.init(); + parse_state = IDLE; //SODbg(DBG_USR2, "gps_driverM.StdControl.init()\r\n"); return SUCCESS; *************** *** 107,110 **** --- 138,142 ---- + #if 1 /** Ok, this function turns on the gps unit for reading, * which is turned of elsewhere when the read is finished. *************** *** 127,130 **** --- 159,163 ---- } } + #endif *************** *** 184,213 **** command result_t log_gga_data_to_eeprom(GGAMsg * pGGA) { - #if 0 - int j; - char gga_log_array[GPS_CHAR]; - - gga_log_array[0] = pGGA->hours; - gga_log_array[1] = pGGA->minutes; - gga_log_array[2] = (pGGA->dec_sec)>>8; // MSB - gga_log_array[3] = pGGA->dec_sec; // LSB - gga_log_array[4] = pGGA->Lat_deg; - gga_log_array[5] = (pGGA->Lat_dec_min)>>8; - gga_log_array[6] = pGGA->Lat_dec_min; - gga_log_array[7] = pGGA->Long_deg; - gga_log_array[8] = (pGGA->Long_dec_min)>>8; - gga_log_array[9] = pGGA->Long_dec_min; - gga_log_array[10] = pGGA->NSEWind; - - - //SODbg(DBG_USR2, "LOGGER GPS:\n"); - for(j=0; j<11; j++) { - UARTPutChar(gga_log_array[j]); - } - SODbg(DBG_USR2, "\n"); - - // Write into eeprom here. - - #endif return SUCCESS; } --- 217,220 ---- *************** *** 227,230 **** --- 234,261 ---- } + // Change this to examine the field after the + // the time. + command void count_commas(char * data) { + + uint8_t i = 0; + uint8_t numcommas = 0; + + while (numcommas < 6) { + if (data[i] == ',') { + numcommas++; + } + i++; + } + + if (data[i] == '0' || data[i] == ',') { + have_gps_fix = FALSE; + parse_state = IDLE; + return; + } else { + data += 2; + numsats = extract_num_sats_m(data); + have_gps_fix = TRUE; + } + } *************** *** 243,246 **** --- 274,292 ---- GPS_MsgPtr gps_data = (GPS_MsgPtr)data; + + //call spew_to_uart(gps_data); + call spew_to_uart(data); + goto finish; + + if (count < 50) { + count++; + return data; + } + + if (parse_state == BUSY) { + return data; + } + + #if DBG_USR2 signal HLSensor.dataReady(gps_data); *************** *** 249,261 **** if ((call isGGA(gps_data->data))) { ! call parse_gga(gps_data); if (have_gps_fix) { //call spew_to_uart(gps_data); signal HLSensor.dataReady(&gga_msg); } } #endif return data; } --- 295,330 ---- if ((call isGGA(gps_data->data))) { ! parse_state = BUSY; ! ! //Count commas right here to determine if we ! //have a fix. ! call count_commas((char*)gps_data); ! ! if (sat_count < 50) { ! call Leds.yellowToggle(); ! avg_sats = alpha*avg_sats + (1-alpha)*numsats; ! sat_count++; ! goto finish; //break; //return data; ! } if (have_gps_fix) { //call spew_to_uart(gps_data); + if (numsats >= (int)avg_sats) { + call Leds.greenToggle(); + call parse_gga(gps_data); signal HLSensor.dataReady(&gga_msg); + // Send the bad reading anyway, but reset + // the application to try to do better next time. + // if (avg_sats < 5) { + // signal HLSensor.error("Too few satellites"); + // sat_count = 0; + // } + } } } #endif + finish: + parse_state = IDLE; return data; } *************** *** 293,303 **** char EW; ! gga_msg.hours = call extract_hours(gga_fields[1]); ! gga_msg.minutes = call extract_minutes(gga_fields[1]); ! gga_msg.dec_sec = call extract_dec_sec(gga_fields[1]); ! gga_msg.Lat_deg = call extract_Lat_deg(gga_fields[2]); ! gga_msg.Lat_dec_min = call extract_Lat_dec_min(gga_fields[2]); ! gga_msg.Long_deg = call extract_Long_deg(gga_fields[4]); ! gga_msg.Long_dec_min = call extract_Long_dec_min(gga_fields[4]); NS = (gga_fields[3][0] == 'N') ? 1 : 0; --- 362,372 ---- char EW; ! gga_msg.hours = extract_hours_m(gga_fields[1]); ! gga_msg.minutes = extract_minutes_m(gga_fields[1]); ! gga_msg.dec_sec = extract_dec_sec_m(gga_fields[1]); ! gga_msg.Lat_deg = extract_Lat_deg_m(gga_fields[2]); ! gga_msg.Lat_dec_min = extract_Lat_dec_min_m(gga_fields[2]); ! gga_msg.Long_deg = extract_Long_deg_m(gga_fields[4]); ! gga_msg.Long_dec_min = extract_Long_dec_min_m(gga_fields[4]); NS = (gga_fields[3][0] == 'N') ? 1 : 0; *************** *** 305,309 **** gga_msg.NSEWind = EW | (NS<<4); // eg. Status = 000N000E = 00010000 ! gga_msg.num_sats = call extract_num_sats(gga_fields[7]); return SUCCESS; --- 374,381 ---- gga_msg.NSEWind = EW | (NS<<4); // eg. Status = 000N000E = 00010000 ! //atomic { ! //numsats = call extract_num_sats(gga_fields[7]); ! gga_msg.num_sats = numsats; ! //} return SUCCESS; *************** *** 319,323 **** //SODbg(DBG_USR2, "gps_new.GpsCmd.SwitchesSet(): PowerState: %i \n\n", PowerState); ! char gga_fields[GGA_FIELDS][GPS_CHAR_PER_FIELD]; // = {{0}}; bool end_of_field = FALSE; --- 391,395 ---- //SODbg(DBG_USR2, "gps_new.GpsCmd.SwitchesSet(): PowerState: %i \n\n", PowerState); ! char gga_fields[GGA_FIELDS][GPS_CHAR_PER_FIELD]; bool end_of_field = FALSE; *************** *** 327,331 **** uint8_t length = gps_data->length; ! // Parse and store comma delimited fields into EEPROM while (i < GGA_FIELDS) { --- 399,403 ---- uint8_t length = gps_data->length; ! while (i < GGA_FIELDS) { *************** *** 333,336 **** --- 405,409 ---- end_of_field = FALSE; j = 0; + while (!end_of_field & k < length) { if (gps_data->data[k] == GPS_DELIMITER) { *************** *** 354,367 **** // Finding the gps fix should probably done somewhere else. ! have_gps_fix = call get_gps_fix(gga_fields[6]); //SODbg(DBG_USR2, "gps_new.parse_gga(): gps_fix %i \r\n", gps_fix); ! if (have_gps_fix) { call load_gga_struct(gga_fields); } return SUCCESS; } ! command uint8_t extract_hours(char * data) { return (10*(data[0]-'0') + (data[1]-'0')); --- 427,442 ---- // Finding the gps fix should probably done somewhere else. ! //have_gps_fix = call get_gps_fix(gga_fields[6]); //SODbg(DBG_USR2, "gps_new.parse_gga(): gps_fix %i \r\n", gps_fix); ! /* if (have_gps_fix) { call load_gga_struct(gga_fields); } + */ + call load_gga_struct(gga_fields); return SUCCESS; } ! #if 0 command uint8_t extract_hours(char * data) { return (10*(data[0]-'0') + (data[1]-'0')); *************** *** 430,433 **** --- 505,509 ---- return (10*(data[0]-'0') + (data[1]-'0')); } + #endif Index: Makefile =================================================================== RCS file: /cvsroot/firebug/fireboard/sensors/leadtek9546/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 29 Jan 2004 14:53:36 -0000 1.1 --- Makefile 30 Aug 2004 16:58:15 -0000 1.2 *************** *** 1,2 **** clean: ! rm -rf *~ *.exe *.bak --- 1,12 ---- + + cfiles: + # gcc -Wall -o ggaparse -DSTANDALONE ggaparse.c nmea_parse.c + gcc -Wall -o gllparse -DSTANDALONE gllparse.c nmea_parse.c + gcc -Wall -o leadtek leadtek_9546.c + gcc -Wall -c nmea_parse.c + gcc -Wall -g -o nmea_parse_test nmea_parse_test.c \ + ggaparse.c gllparse.c gsaparse.c gsvparse.c \ + mssparse.c vtgparse.c rmcparse.c nmea_parse.c + clean: ! rm -rf *~ *.exe *.bak *.o Index: GpsPacketM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/sensors/leadtek9546/GpsPacketM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GpsPacketM.nc 3 Feb 2004 20:06:44 -0000 1.2 --- GpsPacketM.nc 30 Aug 2004 16:58:15 -0000 1.3 *************** *** 1,5 **** - /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ - - /** * "Copyright (c) 2000-2002 The Regents of the University of California. --- 1,2 ---- *************** *** 191,197 **** command result_t Control.start() { // apply your power management algorithm ! call SwitchControl.start(); ! return call ByteControl.start(); } --- 188,196 ---- command result_t Control.start() { + result_t ok1, ok2; // apply your power management algorithm ! ok1 = call SwitchControl.start(); ! ok2 = call ByteControl.start(); ! return rcombine(ok1,ok2); } |
From: David M. D. <do...@us...> - 2004-08-30 16:48:57
|
Update of /cvsroot/firebug/firebug/project/src/sensordata In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4306 Modified Files: mkcmsg.sh mkmsg.sh xbow.h Log Message: Took -I out of mig scripts. Index: xbow.h =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/sensordata/xbow.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** xbow.h 23 Jul 2004 00:31:19 -0000 1.4 --- xbow.h 30 Aug 2004 16:48:47 -0000 1.5 *************** *** 1,89 **** - - - typedef struct XSensorMTS400Data1 { - uint16_t battery; - uint16_t humidity; - uint16_t temp; - - uint16_t cal_word1; //!< Pressure calibration word 1 - uint16_t cal_word2; //!< Pressure calibration word 2 - uint16_t cal_word3; //!< Pressure calibration word 3 - uint16_t cal_word4; //!< Pressure calibration word 4 - uint16_t intersematemp; - uint16_t intersemapressure; - - uint16_t taosch0; - uint16_t taosch1; - - uint16_t accel_x; - } XSensorMTS400Data1; - - - enum { - AM_XSENSORMTS400DATA1 = 137 - }; - - - typedef struct XSensorMTS420GPSData { - uint8_t hours; //Hours - uint8_t minutes;//Minutes - uint8_t Lat_deg;//Latitude degrees - uint8_t Long_deg;//Longitude degrees - uint32_t dec_sec;//Decimal seconds - uint32_t Lat_dec_min;//Latitude decimal minutes - uint32_t Long_dec_min;//Longitude decimal minutes - uint8_t NSEWind;//NSEWind - uint8_t Fixed; // as to whether the packet is valid(i.e. has the gps Fixed on to the sattelites). - - } XSensorMTS420GPSData; - - enum { - AM_XSENSORMTS420GPSDATA = 138 - }; - - - typedef struct Weather1 { - uint16_t battery; - uint16_t humidity; - uint16_t temp; - - uint16_t intersematemp; - - //uint16_t cal_word1; //!< Pressure calibration word 1 - //uint16_t cal_word2; //!< Pressure calibration word 2 - //uint16_t cal_word3; //!< Pressure calibration word 3 - //uint16_t cal_word4; //!< Pressure calibration word 4 - - uint32_t fintersematemp; - uint32_t fintersemapressure; - uint32_t lux; - - uint16_t intersemapressure; - - uint16_t accel_x; - } Weather1; - - - enum { - AM_WEATHER1 = 139 - }; - - - typedef struct GPS1 { - - uint8_t hours; //Hours - uint8_t minutes;//Minutes - uint8_t Lat_deg;//Latitude degrees - uint8_t Long_deg;//Longitude degrees - uint32_t dec_sec;//Decimal seconds - uint32_t Lat_dec_min;//Latitude decimal minutes - uint32_t Long_dec_min;//Longitude decimal minutes - uint8_t NSEWind;//NSEWind - uint8_t Fixed; // as to whether the packet is valid(i.e. has the gps Fixed on to the sattelites). - uint8_t num_sats; - } GPS1; - - - enum { - AM_GPS1 = 140 - }; --- 0 ---- Index: mkcmsg.sh =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/sensordata/mkcmsg.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mkcmsg.sh 28 Jul 2004 00:58:03 -0000 1.2 --- mkcmsg.sh 30 Aug 2004 16:48:47 -0000 1.3 *************** *** 13,19 **** ### Change the path and struct names for local conditions. ! mig c -java-classname=org.firebug.FireMsg -I. $HOME/firebug/fireboard/tos/sensorboards/xbow_mts420ca/fireboard.h Firedata_msg > FireMsg.c ! mig c -java-classname=org.firebug.GGAMsg -I. $HOME/firebug/fireboard/tos/sensors/leadtek9546/leadtek_9546.h GGAMsg > GGAMsg.c ! mig c -java-classname=org.firebug.GGAMsg1 -I. $HOME/firebug/fireboard/tos/sensors/leadtek9546/leadtek_9546.h GGAMsg1 > GGAMsg1.c --- 13,19 ---- ### Change the path and struct names for local conditions. ! mig c -java-classname=org.firebug.FireMsg $HOME/firebug/fireboard/tos/sensorboards/xbow_mts420ca/fireboard.h Firedata_msg > FireMsg.c ! mig c -java-classname=org.firebug.GGAMsg $HOME/firebug/fireboard/tos/sensors/leadtek9546/leadtek_9546.h GGAMsg > GGAMsg.c ! mig c -java-classname=org.firebug.GGAMsg1 $HOME/firebug/fireboard/tos/sensors/leadtek9546/leadtek_9546.h GGAMsg1 > GGAMsg1.c Index: mkmsg.sh =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/sensordata/mkmsg.sh,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mkmsg.sh 28 Jul 2004 00:58:03 -0000 1.7 --- mkmsg.sh 30 Aug 2004 16:48:47 -0000 1.8 *************** *** 8,25 **** set MSGROOT=$HOME/firebug/fireboard/tos/ ! mig java -java-classname=org.firebug.SensorMsg -I. ./sensormsg.h SensorMsg > SensorMsg.java ! mig java -java-classname=org.firebug.FireMsg -I. $HOME/firebug/fireboard/tos/sensorboards/xbow_mts420ca/fireboard.h Firedata_msg > FireMsg.java ! mig java -java-classname=org.firebug.GGAMsg -I. $HOME/firebug/fireboard/tos/sensors/leadtek9546/leadtek_9546.h GGAMsg > GGAMsg.java ! mig java -java-classname=org.firebug.GGAMsg1 -I. $HOME/firebug/fireboard/tos/sensors/leadtek9546/leadtek_9546.h GGAMsg1 > GGAMsg1.java ! mig java -java-classname=org.firebug.RangeMsg -I. $HOME/firebug/fireboard/tos/sensorboards/xbow_mts420ca/fireboard.h Rangedata_msg > RangeMsg.java ! mig java -java-classname=org.firebug.XBow1Msg -I. xbow.h XSensorMTS400Data1 > XBow1Msg.java ! mig java -java-classname=org.firebug.XBow2Msg -I. xbow.h XSensorMTS420GPSData > XBow2Msg.java ! mig java -java-classname=org.firebug.XBow3Msg -I. xbow.h Weather1 > XBow3Msg.java ! mig java -java-classname=org.firebug.XBow4Msg -I. xbow.h GPS1 > XBow4Msg.java ! ! ! ! ! --- 8,20 ---- set MSGROOT=$HOME/firebug/fireboard/tos/ ! mig java -java-classname=org.firebug.SensorMsg ./sensormsg.h SensorMsg > SensorMsg.java ! mig java -java-classname=org.firebug.FireMsg $HOME/firebug/fireboard/tos/sensorboards/xbow_mts420ca/fireboard.h Firedata_msg > FireMsg.java ! mig java -java-classname=org.firebug.GGAMsg $HOME/firebug/fireboard/tos/sensors/leadtek9546/leadtek_9546.h GGAMsg > GGAMsg.java ! mig java -java-classname=org.firebug.GGAMsg1 $HOME/firebug/fireboard/tos/sensors/leadtek9546/leadtek_9546.h GGAMsg1 > GGAMsg1.java ! mig java -java-classname=org.firebug.RangeMsg $HOME/firebug/fireboard/tos/sensorboards/xbow_mts420ca/fireboard.h Rangedata_msg > RangeMsg.java ! mig java -java-classname=org.firebug.XBow1Msg xbow.h XSensorMTS400Data1 > XBow1Msg.java ! mig java -java-classname=org.firebug.XBow2Msg xbow.h XSensorMTS420GPSData > XBow2Msg.java ! mig java -java-classname=org.firebug.XBow3Msg xbow.h Weather1 > XBow3Msg.java ! mig java -java-classname=org.firebug.XBow4Msg xbow.h GPS1 > XBow4Msg.java |
From: Kevin <kar...@us...> - 2004-08-23 05:45:57
|
Update of /cvsroot/firebug/firebug/web/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16598 Added Files: Lake_Chabot_test_layout_rev.jpg mote_on_a_post_rev2.jpg Log Message: Added a photo of a mote with the gps attached and a photo of the Lake Chabot setting. --- NEW FILE: mote_on_a_post_rev2.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Lake_Chabot_test_layout_rev.jpg --- (This appears to be a binary file; contents omitted.) |
From: Kevin <kar...@us...> - 2004-08-23 05:44:17
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16126 Modified Files: firebug.css gps.php index.php monitoring.php Log Message: Updated parts of the webpage. Index: gps.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gps.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gps.php 3 Aug 2004 01:35:41 -0000 1.2 --- gps.php 23 Aug 2004 05:44:05 -0000 1.3 *************** *** 16,20 **** <p> ! Sensor location is an essential component of instrumented wildfire monitoring. Each mote is equipped with a Leadtek GPS receiver. Following deployment, the mote's fixed global position (GGA) is recorded and stored locally. </p> --- 16,42 ---- <p> ! Sensor location is an essential component of instrumented wildfire monitoring. Each mote is equipped with a Leadtek GPS receiver. ! </p> ! ! <center> ! <table> ! <tr> ! <td> ! <img src="images/mote_on_a_post_rev2.jpg"> ! </td> ! </tr> ! <tr> ! <td> ! <font face="Comic Sans MS"> ! Photo of a mote equipped with the GPS receiver. ! </font> ! </td> ! </tr> ! </table> ! </center> ! ! <br> ! <br> ! Following deployment, the mote's fixed global position (GGA) is recorded and stored locally. </p> Index: monitoring.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/monitoring.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** monitoring.php 3 Aug 2004 01:35:41 -0000 1.2 --- monitoring.php 23 Aug 2004 05:44:05 -0000 1.3 *************** *** 68,71 **** --- 68,74 ---- <img src = "images/mote.jpg"> </td> + <td> + <img src = "images/mote_on_a_post_rev2.jpg"> + </td> </tr> <tr> *************** *** 75,78 **** --- 78,85 ---- </font> </td> + <td> + <font face="Comic Sans MS"> + Photo of a deployed mote with the GPS receiver attached. + </font> </tr> </table> *************** *** 116,119 **** --- 123,138 ---- </td> </tr> + <tr> + <td> + <img src = "images/Lake_Chabot_test_layout_rev.jpg"> + </td> + </tr> + <tr> + <td> + <font face="Comic Sans MS"> + Photo of motes that have been deployed at a site near Lake Chabot in Castro Valley,CA. + </font> + </td> + </tr> </table> Index: firebug.css =================================================================== RCS file: /cvsroot/firebug/firebug/web/firebug.css,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** firebug.css 20 Aug 2004 00:46:25 -0000 1.14 --- firebug.css 23 Aug 2004 05:44:05 -0000 1.15 *************** *** 65,69 **** h4 { ! background-color:#072285; color:#5A7CFC; font-family:Courier New; --- 65,69 ---- h4 { ! /*background-color:#072285;*/ color:#5A7CFC; font-family:Courier New; Index: index.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.php 20 Aug 2004 00:46:25 -0000 1.5 --- index.php 23 Aug 2004 05:44:05 -0000 1.6 *************** *** 20,33 **** <br> <center> ! <h3>Design and Construction of a Wildfire Instrumentation System using Networked Sensors</h3> </center> <center> ! <p class="nice"> ! M. M. Chen, C. Majidi, D. M. Doolin, S. Glaser, N. Sitar ! </p> </center> <br> <br> <h4>Abstract</h4> --- 20,43 ---- <br> <center> ! <h3>Design and Construction of a Wildfire Instrumentation System Using Networked Sensors</h3> </center> + <br> + <br> + <center> ! <img src="images/forestfire_small.jpg"> </center> + + <br> + <br> <br> + + <?php + include("links.php"); + ?> + <br> + <h4>Abstract</h4> *************** *** 47,64 **** <center> - <img src="images/forestfire_small.jpg"> - </center> - - <br> - <br> - <br> - - <?php - include("links.php"); - ?> - - <br> - - <center> <table> <tr> --- 57,60 ---- |
From: Kevin <kar...@us...> - 2004-08-20 00:46:51
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27430 Modified Files: firebug.css index.php Log Message: Updated the mainpage for the firebug website. Index: firebug.css =================================================================== RCS file: /cvsroot/firebug/firebug/web/firebug.css,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** firebug.css 11 May 2004 23:23:38 -0000 1.13 --- firebug.css 20 Aug 2004 00:46:25 -0000 1.14 *************** *** 57,60 **** --- 57,86 ---- } + h3 { + color:#0E37D0; + font-family:Georgia; + font-weight:bold; + font-size:200%; + } + + h4 { + background-color:#072285; + color:#5A7CFC; + font-family:Courier New; + font-style:normal; + font-weight:bold; + font-size:150%; + } + + p.jazzy { + color:#1841D8; + font-family:Comic Sans MS; + } + + p.nice { + color:#465BAA; + font-family:Lucida Console; + } + pre.code { background-color:#ffff66; *************** *** 90,94 **** } - /* a:active { --- 116,119 ---- Index: index.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.php 3 Aug 2004 22:31:35 -0000 1.4 --- index.php 20 Aug 2004 00:46:25 -0000 1.5 *************** *** 19,26 **** <br> <br> <br> ! <p> <font size = 4> --- 19,36 ---- <br> + <center> + <h3>Design and Construction of a Wildfire Instrumentation System using Networked Sensors</h3> + </center> + <center> + <p class="nice"> + M. M. Chen, C. Majidi, D. M. Doolin, S. Glaser, N. Sitar + </p> + </center> <br> <br> ! <h4>Abstract</h4> ! ! <p class="jazzy"> <font size = 4> *************** *** 60,64 **** <td> <font size = 2> ! The FireBug system was funded by a grant from the <a href="http://www.nsf.gov">National Science Foundation</a> Information Technology Research initiative, award ITR/IM-0121693. </font> </td> --- 70,74 ---- <td> <font size = 2> ! The FireBug system is being developed as a part of Adaptive Real-Time Geoscience and Environmental Data Analysis, Modeling and Visualization grant from the National Science Foundation Information Technology Research initiative, award ITR/IM-0121693. </font> </td> |
From: Kevin <kar...@us...> - 2004-08-20 00:46:35
|
Update of /cvsroot/firebug/firebug/web/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27430/images Modified Files: firebug.jpg Log Message: Updated the mainpage for the firebug website. Index: firebug.jpg =================================================================== RCS file: /cvsroot/firebug/firebug/web/images/firebug.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsz4WLVf and /tmp/cvssomTEj differ |
From: Kevin <kar...@us...> - 2004-08-19 22:36:15
|
Update of /cvsroot/firebug/firebug/web/postgres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6982 Modified Files: db_admin.php Log Message: Updated list of database names that cannot be used. Index: db_admin.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_admin.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_admin.php 19 Aug 2004 22:13:57 -0000 1.2 --- db_admin.php 19 Aug 2004 22:36:06 -0000 1.3 *************** *** 24,30 **** <form action="db_create.php" method="post"> ! NOTE: Database names are <strong>CASE-INSENSITIVE</strong>. Also, currently known database names that <strong>CANNOT</strong> be used are <b>template1</b>, <b>template0</b>, <b>in</b>, <b>or</b>, and <b>and</b>. ! <br /> ! Database name: <input type="text" name="dbname" /> <br /> Number of motes: <input type="text" name="nummotes"/> --- 24,29 ---- <form action="db_create.php" method="post"> ! NOTE: Database names are <strong>CASE-INSENSITIVE</strong>. Also, check below for a list of currently known database names that <strong>CANNOT</strong> be used. <br> ! Database name: <input type="text" name="dbname" /> <br /> Number of motes: <input type="text" name="nummotes"/> *************** *** 36,39 **** --- 35,63 ---- <hr /> + <strong>Currently-Known Database Names that are NOT ALLOWED:</strong> + <br> + and + <br> + as + <br> + between + <br> + in + <br> + into + <br> + or + <br> + select + <br> + template0 + <br> + template1 + <br> + where + <br /> + + + <hr /> <?php |
From: Kevin <kar...@us...> - 2004-08-19 22:14:11
|
Update of /cvsroot/firebug/firebug/web/postgres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2615 Modified Files: db_admin.php Log Message: Updated db_admin.php with list of database names that cannot be used. Index: db_admin.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_admin.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_admin.php 19 Aug 2004 16:27:38 -0000 1.1 --- db_admin.php 19 Aug 2004 22:13:57 -0000 1.2 *************** *** 24,28 **** <form action="db_create.php" method="post"> ! NOTE: Database names are CASE-INSENSITIVE. <br /> Database name: <input type="text" name="dbname" /> --- 24,28 ---- <form action="db_create.php" method="post"> ! NOTE: Database names are <strong>CASE-INSENSITIVE</strong>. Also, currently known database names that <strong>CANNOT</strong> be used are <b>template1</b>, <b>template0</b>, <b>in</b>, <b>or</b>, and <b>and</b>. <br /> Database name: <input type="text" name="dbname" /> |
Update of /cvsroot/firebug/firebug/web/postgres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32317 Modified Files: connect.php db_create.php db_drop.php db_dropdb.php db_list_databases.php db_select.php db_table_buttons.php db_table_select.php Log Message: Updated the error handling for the postgres version of the firebug database. Index: connect.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/connect.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** connect.php 19 Aug 2004 17:37:04 -0000 1.2 --- connect.php 19 Aug 2004 21:59:56 -0000 1.3 *************** *** 8,12 **** $connstr = "dbname=$db user=postgres host=localhost port=5432"; if(!($dbh = @pg_connect($connstr))) { ! die("Error: could not connect"); } return $dbh; --- 8,12 ---- $connstr = "dbname=$db user=postgres host=localhost port=5432"; if(!($dbh = @pg_connect($connstr))) { ! die("<strong>ERROR</strong>: Could not connect"); } return $dbh; Index: db_dropdb.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_dropdb.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_dropdb.php 19 Aug 2004 16:27:38 -0000 1.1 --- db_dropdb.php 19 Aug 2004 21:59:57 -0000 1.2 *************** *** 16,20 **** <?php $dbname = $HTTP_POST_VARS["db1"]; - print $dbname; ?> <hr /> --- 16,19 ---- *************** *** 25,29 **** $stat = @pg_exec($dbh,$statement); if (!$stat) { ! print "Error: Could not drop database $dbname"; } else { print "Database <strong>$dbname</strong> dropped."; --- 24,28 ---- $stat = @pg_exec($dbh,$statement); if (!$stat) { ! print "<strong>ERROR</strong>: Could not drop database <strong>".strtoupper($dbname)."</strong>."; } else { print "Database <strong>$dbname</strong> dropped."; Index: db_create.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_create.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_create.php 19 Aug 2004 17:37:04 -0000 1.2 --- db_create.php 19 Aug 2004 21:59:57 -0000 1.3 *************** *** 35,39 **** if (!$conn_stat) { ! print "Error: Could not check to see if database exists."; } else { --- 35,40 ---- if (!$conn_stat) { ! print "<strong>ERROR</strong>: Could not check to see if database <strong>".strtoupper($dbname)."</strong> exists."; ! pg_close($dbh); } else { *************** *** 46,50 **** } } ! /* Creates the database if it does not exist yet.*/ if (!$flag) { --- 47,51 ---- } } ! pg_close($dbh); /* Creates the database if it does not exist yet.*/ if (!$flag) { *************** *** 53,57 **** $create_stat = @pg_exec($dbh,$statement); if (!$create_stat) { ! print "Error: Could not create database $dbname."; pg_close($dbh); } else { --- 54,58 ---- $create_stat = @pg_exec($dbh,$statement); if (!$create_stat) { ! print "<strong>ERROR</strong>: Could not create database <strong>".strtoupper($dbname)."</strong>."; pg_close($dbh); } else { *************** *** 84,88 **** $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { ! print "Error: Could not create table LOCATION."; } --- 85,89 ---- $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { ! print "<strong>ERROR</strong>: Could not create table </strong>LOCATION</strong>."; } *************** *** 90,95 **** //$statement .= "lat_dec_min FLOAT, long_deg SMALLINT, long_dec_min FLOAT, nsew SMALLINT, numsats SMALLINT)"; - //mysql_query($statement) or die("Error: ".mysql_error()." in creating location atable"); - /* typedef struct Firedata_msg { --- 91,94 ---- *************** *** 106,110 **** $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { ! print "Error: Could not create table CURRENT."; $current_flag=1; } --- 105,109 ---- $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { ! print "<strong>ERROR</strong>: Could not create table <strong>CURRENT</strong>."; $current_flag=1; } *************** *** 116,120 **** $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { ! print "Error: Could not create table CUMULATIVE."; } --- 115,119 ---- $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { ! print "<strong>ERROR</strong>: Could not create table <strong>CUMULATIVE</strong>."; } *************** *** 125,129 **** $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { ! print "Error: Could not create table RANGE."; } --- 124,128 ---- $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { ! print "<strong>ERROR</strong>: Could not create table <strong>RANGE</strong>."; } *************** *** 143,147 **** $create_stat = @pg_exec($dbh, $statement); if (!$create_stat) { ! print "Error: Could not INSERT INTO CURRENT (mote_id) VALUES ($i)"; } else { print $statement; --- 142,146 ---- $create_stat = @pg_exec($dbh, $statement); if (!$create_stat) { ! print "<strong>ERROR</strong>: Could not INSERT INTO <strong>CURRENT</strong> (mote_id) VALUES ($i)"; } else { print $statement; *************** *** 158,162 **** print "<br />"; print("<a href=\"db_admin.php\">Create Another Database</a>"); - pg_close($dbh); } } --- 157,160 ---- Index: db_table_buttons.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_table_buttons.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_table_buttons.php 19 Aug 2004 16:27:38 -0000 1.1 --- db_table_buttons.php 19 Aug 2004 21:59:57 -0000 1.2 *************** *** 12,24 **** $statement = "SELECT TABLENAME FROM pg_tables WHERE NOT TABLENAME~'pg_.*' and not tablename~'sql_.*'"; ! $stat = pg_exec($dbh,$statement); ! $rows = pg_numrows($stat); ! for ($i = 0; $i < $rows; $i++) { ! $data = pg_fetch_row($stat, $i); ! print ("<input type=hidden name=db1 value=\"$dbname\">"); ! print ("<input type=submit name=tbl1 value=\"" . $data[0] . "\">"); } ?> --- 12,30 ---- $statement = "SELECT TABLENAME FROM pg_tables WHERE NOT TABLENAME~'pg_.*' and not tablename~'sql_.*'"; ! $stat = @pg_exec($dbh,$statement); ! if (!$stat) { ! print "<strong>ERROR</strong>: Could not access list of tables for database <strong>".strtoupper($dbname)."</strong>."; ! } else { ! $rows = pg_numrows($stat); ! for ($i = 0; $i < $rows; $i++) { ! $data = pg_fetch_row($stat, $i); ! print ("<input type=hidden name=db1 value=\"$dbname\">"); ! print ("<input type=submit name=tbl1 value=\"" . $data[0] . "\">"); ! } } + pg_close($dbh); + ?> Index: db_list_databases.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_list_databases.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_list_databases.php 19 Aug 2004 16:27:38 -0000 1.1 --- db_list_databases.php 19 Aug 2004 21:59:57 -0000 1.2 *************** *** 9,27 **** $dbh = connect_postgres("template1"); $statement = "SELECT DATNAME FROM pg_database where not datname='template1' and not datname='template0'"; ! $stat = pg_exec($dbh,$statement); ! $rows = pg_numrows($stat); ! for ($i = 0; $i < $rows; $i++) { ! $data = pg_fetch_row($stat, $i); ! print ("<tr><td>"); ! print $data[0]; ! print ("</td>"); ! ! print ("<td>"); ! print ("<input type=radio name=db1 value=\"$data[0]\">"); ! print ("</td>"); ! ! print ("</tr>"); } ?> --- 9,32 ---- $dbh = connect_postgres("template1"); $statement = "SELECT DATNAME FROM pg_database where not datname='template1' and not datname='template0'"; ! $stat = @pg_exec($dbh,$statement); ! if (!stat) { ! print "<strong>ERROR</strong>: Could not access list of existing databases."; ! } else { ! $rows = pg_numrows($stat); ! for ($i = 0; $i < $rows; $i++) { ! $data = pg_fetch_row($stat, $i); ! print ("<tr><td>"); ! print $data[0]; ! print ("</td>"); ! ! print ("<td>"); ! print ("<input type=radio name=db1 value=\"$data[0]\">"); ! print ("</td>"); ! ! print ("</tr>"); ! } } + pg_close($dbh); ?> Index: db_drop.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_drop.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_drop.php 19 Aug 2004 16:27:38 -0000 1.1 --- db_drop.php 19 Aug 2004 21:59:57 -0000 1.2 *************** *** 40,51 **** $dbh = connect_postgres("template1"); $statement = "SELECT DATNAME FROM pg_database where not datname='template1' and not datname='template0'"; ! $stat = pg_exec($dbh,$statement); ! $rows = pg_numrows($stat); ! ! for ($i = 0; $i < $rows; $i++) { ! $data = pg_fetch_row($stat, $i); ! print_dbname_row($data[0]); } ! ?> --- 40,55 ---- $dbh = connect_postgres("template1"); $statement = "SELECT DATNAME FROM pg_database where not datname='template1' and not datname='template0'"; ! $stat = @pg_exec($dbh,$statement); ! if (!$stat) { ! print "<strong>ERROR</strong>: Could not access list of databases."; ! } else { ! $rows = pg_numrows($stat); ! ! for ($i = 0; $i < $rows; $i++) { ! $data = pg_fetch_row($stat, $i); ! print_dbname_row($data[0]); ! } } ! pg_close($dbh); ?> Index: db_select.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_select.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_select.php 19 Aug 2004 16:27:38 -0000 1.1 --- db_select.php 19 Aug 2004 21:59:57 -0000 1.2 *************** *** 23,48 **** $statement = "SELECT TABLENAME FROM pg_tables WHERE NOT TABLENAME~'pg_.*' and not tablename~'sql_.*'"; ! $stat = pg_exec($dbh,$statement); ! $rows = pg_numrows($stat); ! ! for ($i = 0; $i < $rows; $i++) { ! $data = pg_fetch_row($stat, $i); ! print ("<tr>"); ! ! print ("<td>"); ! print $data[0]; ! print ("</td>"); ! ! print ("<td>"); ! print ("<input type=radio name=tbl1 value=\"" . htmlspecialchars($data[0]) . "\">"); ! print ("</td>"); ! print ("</tr>"); ! } ! ! print ("</table>"); ! print ("<input type=hidden name=db1 value=\"$dbname\">"); ! print ("<input type=submit value=SUBMIT>"); pg_close($dbh); --- 23,51 ---- $statement = "SELECT TABLENAME FROM pg_tables WHERE NOT TABLENAME~'pg_.*' and not tablename~'sql_.*'"; ! $stat = @pg_exec($dbh,$statement); ! if (!$stat) { ! print "<strong>ERROR</strong>: Could not access list of tables for database <strong>".strtoupper($dbname)."</strong>."; ! } else { ! $rows = pg_numrows($stat); ! for ($i = 0; $i < $rows; $i++) { ! $data = pg_fetch_row($stat, $i); ! print ("<tr>"); ! ! print ("<td>"); ! print $data[0]; ! print ("</td>"); ! ! print ("<td>"); ! print ("<input type=radio name=tbl1 value=\"" . htmlspecialchars($data[0]) . "\">"); ! print ("</td>"); ! ! print ("</tr>"); ! } + print ("</table>"); + print ("<input type=hidden name=db1 value=\"$dbname\">"); + print ("<input type=submit value=SUBMIT>"); + } pg_close($dbh); *************** *** 55,64 **** <br /> - <!-- - Add links to go back to the firebug home page running on the - current server, and to the database admin page running on the - current server. - --> - <hr /> --- 58,61 ---- Index: db_table_select.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_table_select.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_table_select.php 19 Aug 2004 16:27:38 -0000 1.1 --- db_table_select.php 19 Aug 2004 21:59:57 -0000 1.2 *************** *** 54,78 **** <?php $dbh = connect_postgres($dbname); ! $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname = 'current' and a.attrelid = c.oid and a.attnum > 0"; ! $stat = pg_exec($dbh,$statement); // Build the table header column names. Make this into a function. ! print("<tr>\n"); ! $cols = pg_numrows($stat); ! for ($i=0 ; $i < $cols; $i++) { ! print ("<td>"); ! $header = pg_fetch_row($stat,$i); ! print $header[0]; ! print ("</td>"); ! } ! print("</tr>\n"); ! $statement = "SELECT * FROM $tblname"; ! $stat = pg_exec($dbh,$statement); //Print the value for a row. function print_row($item2,$key) { ! print ("<td>\n"); echo "$item2\n"; --- 54,85 ---- <?php $dbh = connect_postgres($dbname); ! $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname = '$tblname' and a.attrelid = c.oid and a.attnum > 0"; ! $stat = @pg_exec($dbh,$statement); ! if (!$stat) { ! print "<strong>ERROR</strong>: Could not retrieve table header column names for<strong>".strtoupper($tblname)."</strong>."; ! } else { // Build the table header column names. Make this into a function. ! print("<tr>\n"); ! $cols = pg_numrows($stat); ! for ($i=0 ; $i < $cols; $i++) { ! print ("<td>"); ! $header = pg_fetch_row($stat,$i); ! print $header[0]; ! print ("</td>"); ! } ! print("</tr>\n"); ! ! $statement = "SELECT * FROM $tblname"; ! $stat = @pg_exec($dbh,$statement); ! if (!$stat) { ! print "<strong>ERROR</strong>: Could not access table <strong>".strtoupper($tblname)."</strong>."; ! } else { //Print the value for a row. function print_row($item2,$key) { ! print ("<td>\n"); echo "$item2\n"; *************** *** 82,96 **** //Print every row. ! $rows = pg_numrows($stat); // for each row ! for ($i=0;$i<$rows;$i++) { ! print ("<tr>"); // For each column... ! $row = array_values(pg_fetch_row($stat,$i)); ! array_walk($row,'print_row'); ! print("</tr>"); } - ?> --- 89,105 ---- //Print every row. ! $rows = pg_numrows($stat); // for each row ! for ($i=0;$i<$rows;$i++) { ! print ("<tr>"); // For each column... ! $row = array_values(pg_fetch_row($stat,$i)); ! array_walk($row,'print_row'); ! print("</tr>"); ! } ! } ! pg_close($dbh); } ?> |
From: Kevin <kar...@us...> - 2004-08-19 17:45:27
|
Update of /cvsroot/firebug/firebug/web/postgres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19730 Removed Files: architecture.php Log Message: Removed architecture.php from the postgres directory. --- architecture.php DELETED --- |
From: Kevin <kar...@us...> - 2004-08-19 17:37:15
|
Update of /cvsroot/firebug/firebug/web/postgres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18150 Modified Files: connect.php db_create.php Log Message: Added some comments to some of the files for the psql version of the database. Index: connect.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/connect.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** connect.php 19 Aug 2004 16:27:38 -0000 1.1 --- connect.php 19 Aug 2004 17:37:04 -0000 1.2 *************** *** 2,6 **** /** Function connect_postgres takes in a database name, and returns the ! * database handle. */ function connect_postgres($db) { --- 2,7 ---- /** Function connect_postgres takes in a database name, and returns the ! * database handle. Note that the user, host, and port should be adjusted ! * to match those of the particular postmaster server being used. */ function connect_postgres($db) { Index: db_create.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_create.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_create.php 19 Aug 2004 16:27:38 -0000 1.1 --- db_create.php 19 Aug 2004 17:37:04 -0000 1.2 *************** *** 15,18 **** --- 15,19 ---- <?php include("connect.php"); + /* Note: All database names are lower-case in postgresql.*/ $dbname = strtolower($HTTP_POST_VARS["dbname"]); $nummotes = $HTTP_POST_VARS["nummotes"]; *************** *** 28,31 **** --- 29,33 ---- */ + /* Check to see if database exists already. */ $dbh = connect_postgres("template1"); $statement = "SELECT DATNAME FROM pg_database where not datname='template1' and not datname='template0'"; *************** *** 45,48 **** --- 47,51 ---- } + /* Creates the database if it does not exist yet.*/ if (!$flag) { $dbh = connect_postgres("template1"); |
From: Kevin <kar...@us...> - 2004-08-19 16:27:48
|
Update of /cvsroot/firebug/firebug/web/postgres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5385 Added Files: architecture.php connect.php db_admin.php db_create.php db_drop.php db_dropdb.php db_list.php db_list_databases.php db_select.php db_table_buttons.php db_table_select.php nav_footer.php Log Message: Added the Postgresql version of the Firebug database. --- NEW FILE: nav_footer.php --- <center> <a href="./index.html">[FireBug home]</a> <a href="./db_admin.php">[DB Admin]</a> <a href="./db_list.php">[DB List]</a> <a href="./db_drop.php">[DB Drop]</a> </center> --- NEW FILE: db_dropdb.php --- <html> <head> <title>FireBug database utility script</title> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <h1>FireBug database dropped</h1> <?php $dbname = $HTTP_POST_VARS["db1"]; print $dbname; ?> <hr /> <?php include("connect.php"); $dbh= connect_postgres("template1"); $statement = "DROP DATABASE $dbname"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "Error: Could not drop database $dbname"; } else { print "Database <strong>$dbname</strong> dropped."; } pg_close($dbh); ?> <br /> <hr /> <?php include("nav_footer.php"); ?> <hr /> </body> </html> --- NEW FILE: db_admin.php --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>FireBug database utility script</title> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <h1>FireBug database administration</h1> FireBug logs to a sql database. Since the number of database operations necessary for logging are a limited subset of SQL, we wrap the database administration commands using <a href="http://www.php.net">PHP</a> with an <a href="http://www.apache.org">Apache</a> web server. <hr /> <form action="db_create.php" method="post"> NOTE: Database names are CASE-INSENSITIVE. <br /> Database name: <input type="text" name="dbname" /> <br /> Number of motes: <input type="text" name="nummotes"/> <br /> <input type="submit" value="Create database" /> </form> <hr /> <?php //$string = system("D:\cygwin\bin\gnuplot.exe < test.gnu"); `D:\cygwin\bin\gnuplot.exe < test.gnu`; include("nav_footer.php"); ?> <!-- --> <img src="../imagetest/test.png"> <!-- --> <hr /> <p> Last Updated: $Date: 2004/08/19 16:27:38 $ by $Author: karimushu $. </p> </body> </html> --- NEW FILE: db_create.php --- <html> <head> <title>FireBug database utility script</title> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <h1>FireBug database created</h1> <?php include("connect.php"); $dbname = strtolower($HTTP_POST_VARS["dbname"]); $nummotes = $HTTP_POST_VARS["nummotes"]; /** Need php v4.2 for this to work. */ /* Check to make sure we have numbers intead of garbage.*/ /* if (!ctype_digit($nummotes)) { print "Must be digits.<br />"; } */ $dbh = connect_postgres("template1"); $statement = "SELECT DATNAME FROM pg_database where not datname='template1' and not datname='template0'"; $conn_stat = @pg_exec($dbh,$statement); if (!$conn_stat) { print "Error: Could not check to see if database exists."; } else { $rows = pg_numrows($conn_stat); $flag=0; for ($i = 0; $i < $rows; $i++) { $data = pg_fetch_row($conn_stat, $i); if (strcmp(rtrim($data[0]),$dbname)==0) { $flag=1; } } if (!$flag) { $dbh = connect_postgres("template1"); $statement = "CREATE DATABASE $dbname"; $create_stat = @pg_exec($dbh,$statement); if (!$create_stat) { print "Error: Could not create database $dbname."; pg_close($dbh); } else { print "Database <strong>$dbname</strong> created."; print "<br />"; pg_close($dbh); $dbh = connect_postgres($dbname); /* 3 create table statements for firebug sensors. */ /* typedef struct GGAMsg { uint16_t mote_id uint8_t hours; uint8_t minutes; float dec_sec; uint8_t Lat_deg; float Lat_dec_min; uint8_t Long_deg; float Long_dec_min; uint8_t NSEWind; uint8_t num_sats; } GGAMsg; */ $sql = "CREATE TABLE location (mote_id SMALLINT, gps_hours SMALLINT, gps_minutes SMALLINT, gps_seconds REAL, lat_deg SMALLINT,"; $sql .= "lat_dec_min REAL, long_deg SMALLINT, long_dec_min REAL, nsew SMALLINT, numsats SMALLINT)"; $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { print "Error: Could not create table LOCATION."; } //$statement = "CREATE TABLE location (mote_id SMALLINT, gps_hours SMALLINT, gps_minutes SMALLINT, gps_seconds FLOAT, lat_deg SMALLINT,"; //$statement .= "lat_dec_min FLOAT, long_deg SMALLINT, long_dec_min FLOAT, nsew SMALLINT, numsats SMALLINT)"; //mysql_query($statement) or die("Error: ".mysql_error()." in creating location atable"); /* typedef struct Firedata_msg { uint16_t mote_id; uint16_t cnt; float temp; float rel_hum; float baro_pres; float lux; } Firedata_msg; */ $sql = "CREATE TABLE current (mote_id SMALLINT, time TIMESTAMP, cnt SMALLINT, temp REAL, rel_hum REAL, baro_pres REAL, lux REAL)"; $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { print "Error: Could not create table CURRENT."; $current_flag=1; } //$statement = "CREATE TABLE current (mote_id SMALLINT, time TIMESTAMP, cnt SMALLINT, temp FLOAT, rel_hum FLOAT, baro_pres FLOAT, lux FLOAT)"; //mysql_query($statement) or die("Error: ".mysql_error()." in creating current atable"); $sql = "CREATE TABLE cumulative (mote_id SMALLINT, time TIMESTAMP, cnt SMALLINT, temp REAL, rel_hum REAL, baro_pres REAL, lux REAL)"; $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { print "Error: Could not create table CUMULATIVE."; } //$statement = "CREATE TABLE cumulative (mote_id SMALLINT, time TIMESTAMP, cnt SMALLINT, temp FLOAT, rel_hum FLOAT, baro_pres FLOAT, lux FLOAT)"; //mysql_query($statement) or die("Error: ".mysql_error()." in creating cumulative atable"); $sql = "CREATE TABLE range (mote_id SMALLINT, time TIMESTAMP, count INTEGER, rssi INTEGER, voltage REAL)"; $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { print "Error: Could not create table RANGE."; } //$statement = "CREATE TABLE range (mote_id SMALLINT, time TIMESTAMP, count INTEGER, rssi INTEGER, voltage FLOAT)"; //mysql_query($statement) or die("Error: ".mysql_error()." in creating range table"); } ?> <?php if (!$current_flag) { for ($i = 1; $i <= $nummotes; $i++) { $statement = "INSERT INTO current (mote_id) VALUES ($i)"; print "<br />"; $create_stat = @pg_exec($dbh, $statement); if (!$create_stat) { print "Error: Could not INSERT INTO CURRENT (mote_id) VALUES ($i)"; } else { print $statement; } } } pg_close($dbh); } else { echo("Database $dbname already created."); print "<br />"; echo("Please create another database."); print "<br />"; print("<a href=\"db_admin.php\">Create Another Database</a>"); pg_close($dbh); } } ?> <br /> <hr /> <?php include("nav_footer.php"); ?> <hr /> </body> </html> --- NEW FILE: db_drop.php --- <html> <head> <title>Example FireBug Client</title> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <h1>FireBug web client database selection</h1> <center> <form action="db_dropdb.php" method="post"> <table class="db_schema"> <tr> <td>DataBase Name</td> <td>Selected</td> </tr> <?php include("connect.php"); function print_dbname_row($dbname) { print ("<tr><td>"); print $dbname; print ("</td>"); print ("<td>"); print ("<input type=radio name=db1 value=\"$dbname\">"); print ("</td>"); print ("</tr>"); } /** Print only the non-system databases */ $dbh = connect_postgres("template1"); $statement = "SELECT DATNAME FROM pg_database where not datname='template1' and not datname='template0'"; $stat = pg_exec($dbh,$statement); $rows = pg_numrows($stat); for ($i = 0; $i < $rows; $i++) { $data = pg_fetch_row($stat, $i); print_dbname_row($data[0]); } ?> </table> <input type="submit" value="Drop database"> </form> </center> <hr /> <?php include("nav_footer.php"); ?> <hr /> <p> Database data last updated: <?php echo date ("l dS F Y h:i:s A"); ?> </p> </body> </html> --- NEW FILE: db_select.php --- <html> <head> <title>FireBug database utility script</title> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <form action="db_table_select.php" method="post"> <?php include("connect.php"); $dbname = $HTTP_POST_VARS["db1"]; $dbh = connect_postgres($dbname); print("<h1>Database $dbname tables</h1>"); print("<center>\n"); print("<table class='db_schema'><tr><td>Table Name</td><td>Selected</td></tr>"); $statement = "SELECT TABLENAME FROM pg_tables WHERE NOT TABLENAME~'pg_.*' and not tablename~'sql_.*'"; $stat = pg_exec($dbh,$statement); $rows = pg_numrows($stat); for ($i = 0; $i < $rows; $i++) { $data = pg_fetch_row($stat, $i); print ("<tr>"); print ("<td>"); print $data[0]; print ("</td>"); print ("<td>"); print ("<input type=radio name=tbl1 value=\"" . htmlspecialchars($data[0]) . "\">"); print ("</td>"); print ("</tr>"); } print ("</table>"); print ("<input type=hidden name=db1 value=\"$dbname\">"); print ("<input type=submit value=SUBMIT>"); pg_close($dbh); ?> </form> </center> <br /> <!-- Add links to go back to the firebug home page running on the current server, and to the database admin page running on the current server. --> <hr /> <?php include("nav_footer.php"); ?> <hr /> </body> </html> --- NEW FILE: db_table_select.php --- <?php //session_start(); //session_register("dbname"); //session_register("tblname"); ?> <html> <head> <title>FireBug Client</title> <!-- <META HTTP-EQUIV="Refresh" CONTENT="30;URL=http://localhost/firebug/db_table_select.php"> --> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <hr /> <p> Sensor data last updated: <?php echo date ("l dS F Y h:i:s A"); ?> </p> <?php //if (!isset($HTTP_SESSION_VARS["tblname"])) { if ($HTTP_POST_VARS["tbl1"]!=Null){ $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; } $dbname = $HTTP_SESSION_VARS["dbname"]; $tblname = $HTTP_SESSION_VARS["tblname"]; print("<h1>Mote activity: Database $dbname, table $tblname</h1>"); ?> <?php include("db_table_buttons.php"); ?> <center> <table class="db_schema"> <?php $dbh = connect_postgres($dbname); $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname = 'current' and a.attrelid = c.oid and a.attnum > 0"; $stat = pg_exec($dbh,$statement); // Build the table header column names. Make this into a function. print("<tr>\n"); $cols = pg_numrows($stat); for ($i=0 ; $i < $cols; $i++) { print ("<td>"); $header = pg_fetch_row($stat,$i); print $header[0]; print ("</td>"); } print("</tr>\n"); $statement = "SELECT * FROM $tblname"; $stat = pg_exec($dbh,$statement); //Print the value for a row. function print_row($item2,$key) { print ("<td>\n"); echo "$item2\n"; print ("</td>\n"); } //Print every row. $rows = pg_numrows($stat); // for each row for ($i=0;$i<$rows;$i++) { print ("<tr>"); // For each column... $row = array_values(pg_fetch_row($stat,$i)); array_walk($row,'print_row'); print("</tr>"); } ?> </table> </center> <hr /> <hr /> <?php include("nav_footer.php"); ?> <hr /> <p> Sensor data last updated: <?php echo date ("l dS F Y h:i:s A"); ?> </p> </body> </html> --- NEW FILE: db_list.php --- <html> <head> <title>Example FireBug Client</title> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <h1>FireBug web client database selection</h1> <hr /> <center> <form action="db_select.php" method="post"> <?php include("db_list_databases.php"); ?> <input type="submit" value="Show tables"> </form> </center> <hr /> <?php include("nav_footer.php"); ?> <p> Database data last updated: <?php echo date ("l dS F Y h:i:s A"); ?> </p> </body> </html> --- NEW FILE: db_table_buttons.php --- <form action="db_table_select.php" method="post"> <?php include ("connect.php"); print("Choose different table: "); print("<table class='db_schema'>"); $dbh = connect_postgres($dbname); $statement = "SELECT TABLENAME FROM pg_tables WHERE NOT TABLENAME~'pg_.*' and not tablename~'sql_.*'"; $stat = pg_exec($dbh,$statement); $rows = pg_numrows($stat); for ($i = 0; $i < $rows; $i++) { $data = pg_fetch_row($stat, $i); print ("<input type=hidden name=db1 value=\"$dbname\">"); print ("<input type=submit name=tbl1 value=\"" . $data[0] . "\">"); } ?> </form> --- NEW FILE: db_list_databases.php --- <table class="db_schema"> <tr> <td>Database</td> <td>Selected</td> </tr> <?php include("connect.php"); $dbh = connect_postgres("template1"); $statement = "SELECT DATNAME FROM pg_database where not datname='template1' and not datname='template0'"; $stat = pg_exec($dbh,$statement); $rows = pg_numrows($stat); for ($i = 0; $i < $rows; $i++) { $data = pg_fetch_row($stat, $i); print ("<tr><td>"); print $data[0]; print ("</td>"); print ("<td>"); print ("<input type=radio name=db1 value=\"$data[0]\">"); print ("</td>"); print ("</tr>"); } ?> </table> --- NEW FILE: connect.php --- <?php /** Function connect_postgres takes in a database name, and returns the * database handle. */ function connect_postgres($db) { $connstr = "dbname=$db user=postgres host=localhost port=5432"; if(!($dbh = @pg_connect($connstr))) { die("Error: could not connect"); } return $dbh; } ?> --- NEW FILE: architecture.php --- <html> <head> <link type="text/css" rel="stylesheet" href="firebug.css"> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <title> FireBug </title> </head> <body> <?php include("header.php"); ?> <h1>System Architecture</h1> <p> The FireBug system is composed of a network of GPS-enabled, wireless thermal sensors, a control layer for processing sensor data, and a command center for interactively communicating with the sensor network. Each of these layers are independent of the others, communicating through well-defined interfaces. </p> <br> <center> <img src="images/sysarch.jpg"> </center> <br> <h2>Data Flow/Tool Chains</h2> <p> A large amount of sample data are greatly needed in a timely manner. Firebug tool chains handle the data flow with standard technology, make the data with accurate data value, reliable data transfer and world wide access of data. </p> <center> <img src="images/tool_chain.jpg"> </center> <br> <?php include("links.php"); ?> </body> </html> |
From: Kevin <kar...@us...> - 2004-08-19 16:23:30
|
Update of /cvsroot/firebug/firebug/web/postgres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4559/postgres Log Message: Directory /cvsroot/firebug/firebug/web/postgres added to the repository |
From: David M. D. <do...@us...> - 2004-08-09 19:52:21
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10565/src/org/firebug Added Files: XBow4Msg.java Log Message: Added dummy xbow msg. --- NEW FILE: XBow4Msg.java --- /** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This class implements a Java interface to the 'XBow4Msg' * message type. */ package org.firebug; public class XBow4Msg extends net.tinyos.message.Message { /** The default size of this message type in bytes. */ public static final int DEFAULT_MESSAGE_SIZE = 19; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 140; /** Create a new XBow4Msg of size 19. */ public XBow4Msg() { super(DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** Create a new XBow4Msg of the given data_length. */ public XBow4Msg(int data_length) { super(data_length); amTypeSet(AM_TYPE); } /** * Create a new XBow4Msg with the given data_length * and base offset. */ public XBow4Msg(int data_length, int base_offset) { super(data_length, base_offset); amTypeSet(AM_TYPE); } /** * Create a new XBow4Msg using the given byte array * as backing store. */ public XBow4Msg(byte[] data) { super(data); amTypeSet(AM_TYPE); } /** * Create a new XBow4Msg using the given byte array * as backing store, with the given base offset. */ public XBow4Msg(byte[] data, int base_offset) { super(data, base_offset); amTypeSet(AM_TYPE); } /** * Create a new XBow4Msg using the given byte array * as backing store, with the given base offset and data length. */ public XBow4Msg(byte[] data, int base_offset, int data_length) { super(data, base_offset, data_length); amTypeSet(AM_TYPE); } /** * Create a new XBow4Msg embedded in the given message * at the given base offset. */ public XBow4Msg(net.tinyos.message.Message msg, int base_offset) { super(msg, base_offset, DEFAULT_MESSAGE_SIZE); amTypeSet(AM_TYPE); } /** * Create a new XBow4Msg embedded in the given message * at the given base offset and length. */ public XBow4Msg(net.tinyos.message.Message msg, int base_offset, int data_length) { super(msg, base_offset, data_length); amTypeSet(AM_TYPE); } /** /* Return a String representation of this message. Includes the * message type name and the non-indexed field values. */ public String toString() { String s = "Message <XBow4Msg> \n"; try { s += " [hours=0x"+Long.toHexString(get_hours())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [minutes=0x"+Long.toHexString(get_minutes())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [Lat_deg=0x"+Long.toHexString(get_Lat_deg())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [Long_deg=0x"+Long.toHexString(get_Long_deg())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [dec_sec=0x"+Long.toHexString(get_dec_sec())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [Lat_dec_min=0x"+Long.toHexString(get_Lat_dec_min())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [Long_dec_min=0x"+Long.toHexString(get_Long_dec_min())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [NSEWind=0x"+Long.toHexString(get_NSEWind())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [Fixed=0x"+Long.toHexString(get_Fixed())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } try { s += " [num_sats=0x"+Long.toHexString(get_num_sats())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } // Message-type-specific access methods appear below. ///////////////////////////////////////////////////////// // Accessor methods for field: hours // Field type: short, unsigned // Offset (bits): 0 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'hours' is signed (false). */ public static boolean isSigned_hours() { return false; } /** * Return whether the field 'hours' is an array (false). */ public static boolean isArray_hours() { return false; } /** * Return the offset (in bytes) of the field 'hours' */ public static int offset_hours() { return (0 / 8); } /** * Return the offset (in bits) of the field 'hours' */ public static int offsetBits_hours() { return 0; } /** * Return the value (as a short) of the field 'hours' */ public short get_hours() { return (short)getUIntElement(offsetBits_hours(), 8); } /** * Set the value of the field 'hours' */ public void set_hours(short value) { setUIntElement(offsetBits_hours(), 8, value); } /** * Return the size, in bytes, of the field 'hours' */ public static int size_hours() { return (8 / 8); } /** * Return the size, in bits, of the field 'hours' */ public static int sizeBits_hours() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: minutes // Field type: short, unsigned // Offset (bits): 8 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'minutes' is signed (false). */ public static boolean isSigned_minutes() { return false; } /** * Return whether the field 'minutes' is an array (false). */ public static boolean isArray_minutes() { return false; } /** * Return the offset (in bytes) of the field 'minutes' */ public static int offset_minutes() { return (8 / 8); } /** * Return the offset (in bits) of the field 'minutes' */ public static int offsetBits_minutes() { return 8; } /** * Return the value (as a short) of the field 'minutes' */ public short get_minutes() { return (short)getUIntElement(offsetBits_minutes(), 8); } /** * Set the value of the field 'minutes' */ public void set_minutes(short value) { setUIntElement(offsetBits_minutes(), 8, value); } /** * Return the size, in bytes, of the field 'minutes' */ public static int size_minutes() { return (8 / 8); } /** * Return the size, in bits, of the field 'minutes' */ public static int sizeBits_minutes() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: Lat_deg // Field type: short, unsigned // Offset (bits): 16 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'Lat_deg' is signed (false). */ public static boolean isSigned_Lat_deg() { return false; } /** * Return whether the field 'Lat_deg' is an array (false). */ public static boolean isArray_Lat_deg() { return false; } /** * Return the offset (in bytes) of the field 'Lat_deg' */ public static int offset_Lat_deg() { return (16 / 8); } /** * Return the offset (in bits) of the field 'Lat_deg' */ public static int offsetBits_Lat_deg() { return 16; } /** * Return the value (as a short) of the field 'Lat_deg' */ public short get_Lat_deg() { return (short)getUIntElement(offsetBits_Lat_deg(), 8); } /** * Set the value of the field 'Lat_deg' */ public void set_Lat_deg(short value) { setUIntElement(offsetBits_Lat_deg(), 8, value); } /** * Return the size, in bytes, of the field 'Lat_deg' */ public static int size_Lat_deg() { return (8 / 8); } /** * Return the size, in bits, of the field 'Lat_deg' */ public static int sizeBits_Lat_deg() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: Long_deg // Field type: short, unsigned // Offset (bits): 24 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'Long_deg' is signed (false). */ public static boolean isSigned_Long_deg() { return false; } /** * Return whether the field 'Long_deg' is an array (false). */ public static boolean isArray_Long_deg() { return false; } /** * Return the offset (in bytes) of the field 'Long_deg' */ public static int offset_Long_deg() { return (24 / 8); } /** * Return the offset (in bits) of the field 'Long_deg' */ public static int offsetBits_Long_deg() { return 24; } /** * Return the value (as a short) of the field 'Long_deg' */ public short get_Long_deg() { return (short)getUIntElement(offsetBits_Long_deg(), 8); } /** * Set the value of the field 'Long_deg' */ public void set_Long_deg(short value) { setUIntElement(offsetBits_Long_deg(), 8, value); } /** * Return the size, in bytes, of the field 'Long_deg' */ public static int size_Long_deg() { return (8 / 8); } /** * Return the size, in bits, of the field 'Long_deg' */ public static int sizeBits_Long_deg() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: dec_sec // Field type: long, unsigned // Offset (bits): 32 // Size (bits): 32 ///////////////////////////////////////////////////////// /** * Return whether the field 'dec_sec' is signed (false). */ public static boolean isSigned_dec_sec() { return false; } /** * Return whether the field 'dec_sec' is an array (false). */ public static boolean isArray_dec_sec() { return false; } /** * Return the offset (in bytes) of the field 'dec_sec' */ public static int offset_dec_sec() { return (32 / 8); } /** * Return the offset (in bits) of the field 'dec_sec' */ public static int offsetBits_dec_sec() { return 32; } /** * Return the value (as a long) of the field 'dec_sec' */ public long get_dec_sec() { return (long)getUIntElement(offsetBits_dec_sec(), 32); } /** * Set the value of the field 'dec_sec' */ public void set_dec_sec(long value) { setUIntElement(offsetBits_dec_sec(), 32, value); } /** * Return the size, in bytes, of the field 'dec_sec' */ public static int size_dec_sec() { return (32 / 8); } /** * Return the size, in bits, of the field 'dec_sec' */ public static int sizeBits_dec_sec() { return 32; } ///////////////////////////////////////////////////////// // Accessor methods for field: Lat_dec_min // Field type: long, unsigned // Offset (bits): 64 // Size (bits): 32 ///////////////////////////////////////////////////////// /** * Return whether the field 'Lat_dec_min' is signed (false). */ public static boolean isSigned_Lat_dec_min() { return false; } /** * Return whether the field 'Lat_dec_min' is an array (false). */ public static boolean isArray_Lat_dec_min() { return false; } /** * Return the offset (in bytes) of the field 'Lat_dec_min' */ public static int offset_Lat_dec_min() { return (64 / 8); } /** * Return the offset (in bits) of the field 'Lat_dec_min' */ public static int offsetBits_Lat_dec_min() { return 64; } /** * Return the value (as a long) of the field 'Lat_dec_min' */ public long get_Lat_dec_min() { return (long)getUIntElement(offsetBits_Lat_dec_min(), 32); } /** * Set the value of the field 'Lat_dec_min' */ public void set_Lat_dec_min(long value) { setUIntElement(offsetBits_Lat_dec_min(), 32, value); } /** * Return the size, in bytes, of the field 'Lat_dec_min' */ public static int size_Lat_dec_min() { return (32 / 8); } /** * Return the size, in bits, of the field 'Lat_dec_min' */ public static int sizeBits_Lat_dec_min() { return 32; } ///////////////////////////////////////////////////////// // Accessor methods for field: Long_dec_min // Field type: long, unsigned // Offset (bits): 96 // Size (bits): 32 ///////////////////////////////////////////////////////// /** * Return whether the field 'Long_dec_min' is signed (false). */ public static boolean isSigned_Long_dec_min() { return false; } /** * Return whether the field 'Long_dec_min' is an array (false). */ public static boolean isArray_Long_dec_min() { return false; } /** * Return the offset (in bytes) of the field 'Long_dec_min' */ public static int offset_Long_dec_min() { return (96 / 8); } /** * Return the offset (in bits) of the field 'Long_dec_min' */ public static int offsetBits_Long_dec_min() { return 96; } /** * Return the value (as a long) of the field 'Long_dec_min' */ public long get_Long_dec_min() { return (long)getUIntElement(offsetBits_Long_dec_min(), 32); } /** * Set the value of the field 'Long_dec_min' */ public void set_Long_dec_min(long value) { setUIntElement(offsetBits_Long_dec_min(), 32, value); } /** * Return the size, in bytes, of the field 'Long_dec_min' */ public static int size_Long_dec_min() { return (32 / 8); } /** * Return the size, in bits, of the field 'Long_dec_min' */ public static int sizeBits_Long_dec_min() { return 32; } ///////////////////////////////////////////////////////// // Accessor methods for field: NSEWind // Field type: short, unsigned // Offset (bits): 128 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'NSEWind' is signed (false). */ public static boolean isSigned_NSEWind() { return false; } /** * Return whether the field 'NSEWind' is an array (false). */ public static boolean isArray_NSEWind() { return false; } /** * Return the offset (in bytes) of the field 'NSEWind' */ public static int offset_NSEWind() { return (128 / 8); } /** * Return the offset (in bits) of the field 'NSEWind' */ public static int offsetBits_NSEWind() { return 128; } /** * Return the value (as a short) of the field 'NSEWind' */ public short get_NSEWind() { return (short)getUIntElement(offsetBits_NSEWind(), 8); } /** * Set the value of the field 'NSEWind' */ public void set_NSEWind(short value) { setUIntElement(offsetBits_NSEWind(), 8, value); } /** * Return the size, in bytes, of the field 'NSEWind' */ public static int size_NSEWind() { return (8 / 8); } /** * Return the size, in bits, of the field 'NSEWind' */ public static int sizeBits_NSEWind() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: Fixed // Field type: short, unsigned // Offset (bits): 136 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'Fixed' is signed (false). */ public static boolean isSigned_Fixed() { return false; } /** * Return whether the field 'Fixed' is an array (false). */ public static boolean isArray_Fixed() { return false; } /** * Return the offset (in bytes) of the field 'Fixed' */ public static int offset_Fixed() { return (136 / 8); } /** * Return the offset (in bits) of the field 'Fixed' */ public static int offsetBits_Fixed() { return 136; } /** * Return the value (as a short) of the field 'Fixed' */ public short get_Fixed() { return (short)getUIntElement(offsetBits_Fixed(), 8); } /** * Set the value of the field 'Fixed' */ public void set_Fixed(short value) { setUIntElement(offsetBits_Fixed(), 8, value); } /** * Return the size, in bytes, of the field 'Fixed' */ public static int size_Fixed() { return (8 / 8); } /** * Return the size, in bits, of the field 'Fixed' */ public static int sizeBits_Fixed() { return 8; } ///////////////////////////////////////////////////////// // Accessor methods for field: num_sats // Field type: short, unsigned // Offset (bits): 144 // Size (bits): 8 ///////////////////////////////////////////////////////// /** * Return whether the field 'num_sats' is signed (false). */ public static boolean isSigned_num_sats() { return false; } /** * Return whether the field 'num_sats' is an array (false). */ public static boolean isArray_num_sats() { return false; } /** * Return the offset (in bytes) of the field 'num_sats' */ public static int offset_num_sats() { return (144 / 8); } /** * Return the offset (in bits) of the field 'num_sats' */ public static int offsetBits_num_sats() { return 144; } /** * Return the value (as a short) of the field 'num_sats' */ public short get_num_sats() { return (short)getUIntElement(offsetBits_num_sats(), 8); } /** * Set the value of the field 'num_sats' */ public void set_num_sats(short value) { setUIntElement(offsetBits_num_sats(), 8, value); } /** * Return the size, in bytes, of the field 'num_sats' */ public static int size_num_sats() { return (8 / 8); } /** * Return the size, in bits, of the field 'num_sats' */ public static int sizeBits_num_sats() { return 8; } } |
From: David M. D. <do...@us...> - 2004-08-09 19:47:48
|
Update of /cvsroot/firebug/firebug/project/java/src/org/firebug In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9641/src/org/firebug Modified Files: FireMsg.java ListenFB.java RangeMsg.java XBowLogger.java Log Message: Working java code. Index: XBowLogger.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/XBowLogger.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** XBowLogger.java 5 Jul 2004 20:44:21 -0000 1.4 --- XBowLogger.java 9 Aug 2004 19:47:37 -0000 1.5 *************** *** 196,200 **** public void parse_packet_2(byte [] packet) { ! print_packet_raw(packet); } --- 196,254 ---- public void parse_packet_2(byte [] packet) { ! //print_packet_raw(packet); ! ! XBow4Msg msg = new XBow4Msg(packet,9); ! Connection conn = dbh.getConnection(); ! ! int mote_id = packet[7]; ! System.out.println("Mote id: " + packet[7]); ! ! int hours = msg.get_hours(); ! int minutes = msg.get_minutes(); ! int Lat_deg = msg.get_Lat_deg(); ! int Long_deg = msg.get_Long_deg(); ! int num_sats = msg.get_num_sats(); ! int NSEWind = 17; ! double Lat_dec_min = msg.get_Lat_dec_min(); ! double Long_dec_min = msg.get_Long_dec_min(); ! double dec_sec = msg.get_dec_sec(); ! ! ! /** FIXME: Ugly flow control using exception logic to ! * to track down a bbad statement, needs to be cleaned up. ! */ ! try { ! ResultSet rs; ! Statement stmt = conn.createStatement(); ! ! ! String insertquery = "INSERT INTO location VALUES (" ! + mote_id + ", " ! + hours + ", " ! + minutes + ", " ! + dec_sec + ", " ! + Lat_deg + ", " ! + Lat_dec_min + ", " ! + Long_deg + ", " ! + Long_dec_min + ", " ! + NSEWind + "," ! + num_sats + ")"; ! ! ! try { ! rs = stmt.executeQuery(insertquery); ! } catch (SQLException sqle) { ! System.out.println("Problem with insert statement: " + insertquery); ! sqle.printStackTrace(); ! } ! stmt.close(); ! } catch (SQLException sqle) { ! System.out.println("Problem with statement"); ! sqle.printStackTrace(); ! } ! ! ! ! dbh.return_connection(conn); } Index: FireMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/FireMsg.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FireMsg.java 2 Jul 2004 00:08:30 -0000 1.4 --- FireMsg.java 9 Aug 2004 19:47:37 -0000 1.5 *************** *** 88,91 **** --- 88,94 ---- String s = "Message <FireMsg> \n"; try { + s += " [magic=0x"+Long.toHexString(get_magic())+"]\n"; + } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } + try { s += " [mote_id=0x"+Long.toHexString(get_mote_id())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } *************** *** 105,111 **** s += " [lux="+Float.toString(get_lux())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } - try { - s += " [magic=0x"+Long.toHexString(get_magic())+"]\n"; - } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } --- 108,111 ---- *************** *** 114,128 **** ///////////////////////////////////////////////////////// ! // Accessor methods for field: mote_id ! // Field type: int, unsigned // Offset (bits): 0 // Size (bits): 16 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'mote_id' is signed (false). */ public static boolean isSigned_mote_id() { ! return false; } --- 114,191 ---- ///////////////////////////////////////////////////////// ! // Accessor methods for field: magic ! // Field type: short // Offset (bits): 0 + // Size (bits): 8 + ///////////////////////////////////////////////////////// + + /** + * Return whether the field 'magic' is signed (true). + */ + public static boolean isSigned_magic() { + return true; + } + + /** + * Return whether the field 'magic' is an array (false). + */ + public static boolean isArray_magic() { + return false; + } + + /** + * Return the offset (in bytes) of the field 'magic' + */ + public static int offset_magic() { + return (0 / 8); + } + + /** + * Return the offset (in bits) of the field 'magic' + */ + public static int offsetBits_magic() { + return 0; + } + + /** + * Return the value (as a short) of the field 'magic' + */ + public short get_magic() { + return (short)getUIntElement(offsetBits_magic(), 8); + } + + /** + * Set the value of the field 'magic' + */ + public void set_magic(short value) { + setUIntElement(offsetBits_magic(), 8, value); + } + + /** + * Return the size, in bytes, of the field 'magic' + */ + public static int size_magic() { + return (8 / 8); + } + + /** + * Return the size, in bits, of the field 'magic' + */ + public static int sizeBits_magic() { + return 8; + } + + ///////////////////////////////////////////////////////// + // Accessor methods for field: mote_id + // Field type: int + // Offset (bits): 8 // Size (bits): 16 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'mote_id' is signed (true). */ public static boolean isSigned_mote_id() { ! return true; } *************** *** 138,142 **** */ public static int offset_mote_id() { ! return (0 / 8); } --- 201,205 ---- */ public static int offset_mote_id() { ! return (8 / 8); } *************** *** 145,149 **** */ public static int offsetBits_mote_id() { ! return 0; } --- 208,212 ---- */ public static int offsetBits_mote_id() { ! return 8; } *************** *** 178,191 **** ///////////////////////////////////////////////////////// // Accessor methods for field: cnt ! // Field type: int, unsigned ! // Offset (bits): 16 // Size (bits): 16 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'cnt' is signed (false). */ public static boolean isSigned_cnt() { ! return false; } --- 241,254 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: cnt ! // Field type: int ! // Offset (bits): 24 // Size (bits): 16 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'cnt' is signed (true). */ public static boolean isSigned_cnt() { ! return true; } *************** *** 201,205 **** */ public static int offset_cnt() { ! return (16 / 8); } --- 264,268 ---- */ public static int offset_cnt() { ! return (24 / 8); } *************** *** 208,212 **** */ public static int offsetBits_cnt() { ! return 16; } --- 271,275 ---- */ public static int offsetBits_cnt() { ! return 24; } *************** *** 241,254 **** ///////////////////////////////////////////////////////// // Accessor methods for field: temp ! // Field type: float, unsigned ! // Offset (bits): 32 // Size (bits): 32 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'temp' is signed (false). */ public static boolean isSigned_temp() { ! return false; } --- 304,317 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: temp ! // Field type: float ! // Offset (bits): 40 // Size (bits): 32 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'temp' is signed (true). */ public static boolean isSigned_temp() { ! return true; } *************** *** 264,268 **** */ public static int offset_temp() { ! return (32 / 8); } --- 327,331 ---- */ public static int offset_temp() { ! return (40 / 8); } *************** *** 271,275 **** */ public static int offsetBits_temp() { ! return 32; } --- 334,338 ---- */ public static int offsetBits_temp() { ! return 40; } *************** *** 304,317 **** ///////////////////////////////////////////////////////// // Accessor methods for field: rel_hum ! // Field type: float, unsigned ! // Offset (bits): 64 // Size (bits): 32 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'rel_hum' is signed (false). */ public static boolean isSigned_rel_hum() { ! return false; } --- 367,380 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: rel_hum ! // Field type: float ! // Offset (bits): 72 // Size (bits): 32 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'rel_hum' is signed (true). */ public static boolean isSigned_rel_hum() { ! return true; } *************** *** 327,331 **** */ public static int offset_rel_hum() { ! return (64 / 8); } --- 390,394 ---- */ public static int offset_rel_hum() { ! return (72 / 8); } *************** *** 334,338 **** */ public static int offsetBits_rel_hum() { ! return 64; } --- 397,401 ---- */ public static int offsetBits_rel_hum() { ! return 72; } *************** *** 367,380 **** ///////////////////////////////////////////////////////// // Accessor methods for field: baro_pres ! // Field type: float, unsigned ! // Offset (bits): 96 // Size (bits): 32 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'baro_pres' is signed (false). */ public static boolean isSigned_baro_pres() { ! return false; } --- 430,443 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: baro_pres ! // Field type: float ! // Offset (bits): 104 // Size (bits): 32 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'baro_pres' is signed (true). */ public static boolean isSigned_baro_pres() { ! return true; } *************** *** 390,394 **** */ public static int offset_baro_pres() { ! return (96 / 8); } --- 453,457 ---- */ public static int offset_baro_pres() { ! return (104 / 8); } *************** *** 397,401 **** */ public static int offsetBits_baro_pres() { ! return 96; } --- 460,464 ---- */ public static int offsetBits_baro_pres() { ! return 104; } *************** *** 430,443 **** ///////////////////////////////////////////////////////// // Accessor methods for field: lux ! // Field type: float, unsigned ! // Offset (bits): 128 // Size (bits): 32 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'lux' is signed (false). */ public static boolean isSigned_lux() { ! return false; } --- 493,506 ---- ///////////////////////////////////////////////////////// // Accessor methods for field: lux ! // Field type: float ! // Offset (bits): 136 // Size (bits): 32 ///////////////////////////////////////////////////////// /** ! * Return whether the field 'lux' is signed (true). */ public static boolean isSigned_lux() { ! return true; } *************** *** 453,457 **** */ public static int offset_lux() { ! return (128 / 8); } --- 516,520 ---- */ public static int offset_lux() { ! return (136 / 8); } *************** *** 460,464 **** */ public static int offsetBits_lux() { ! return 128; } --- 523,527 ---- */ public static int offsetBits_lux() { ! return 136; } *************** *** 491,556 **** } - ///////////////////////////////////////////////////////// - // Accessor methods for field: magic - // Field type: short, unsigned - // Offset (bits): 160 - // Size (bits): 8 - ///////////////////////////////////////////////////////// - - /** - * Return whether the field 'magic' is signed (false). - */ - public static boolean isSigned_magic() { - return false; - } - - /** - * Return whether the field 'magic' is an array (false). - */ - public static boolean isArray_magic() { - return false; - } - - /** - * Return the offset (in bytes) of the field 'magic' - */ - public static int offset_magic() { - return (160 / 8); - } - - /** - * Return the offset (in bits) of the field 'magic' - */ - public static int offsetBits_magic() { - return 160; - } - - /** - * Return the value (as a short) of the field 'magic' - */ - public short get_magic() { - return (short)getUIntElement(offsetBits_magic(), 8); - } - - /** - * Set the value of the field 'magic' - */ - public void set_magic(short value) { - setUIntElement(offsetBits_magic(), 8, value); - } - - /** - * Return the size, in bytes, of the field 'magic' - */ - public static int size_magic() { - return (8 / 8); - } - - /** - * Return the size, in bits, of the field 'magic' - */ - public static int sizeBits_magic() { - return 8; - } - } --- 554,556 ---- Index: ListenFB.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/ListenFB.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ListenFB.java 2 Jul 2004 00:08:30 -0000 1.22 --- ListenFB.java 9 Aug 2004 19:47:37 -0000 1.23 *************** *** 66,69 **** --- 66,74 ---- private XBowLogger xbowlogger; + private dispatch [] da = { + new dispatch(128,firelogger), + new dispatch(129,rangelogger), + new dispatch(0,null) + }; /** Use this interface when changing the output *************** *** 173,176 **** --- 178,182 ---- static int extract_am_type(byte [] packet) { + System.out.println("Packet[5]: " + packet[5]); return (int)(packet[5]&0xFF); } *************** *** 210,215 **** * payload to determine which kind of payload it is. */ ! //int am_type = extract_am_type(packet); ! int am_type = get_xbow_packet_id(packet); System.out.println("AM type number: " + am_type); PacketPrinter printer = GetPrinter(am_type); --- 216,221 ---- * payload to determine which kind of payload it is. */ ! int am_type = extract_am_type(packet); ! //int am_type = get_xbow_packet_id(packet); System.out.println("AM type number: " + am_type); PacketPrinter printer = GetPrinter(am_type); *************** *** 269,277 **** // at the base station level. ! //listener.firelogger = new FireLogger(dbname); ! //listener.rangelogger = new RangeLogger(dbname); ! //listener.gpslogger = new GPSLogger(dbname); ! listener.xbowlogger = new XBowLogger(dbname); try { --- 275,283 ---- // at the base station level. ! listener.firelogger = new FireLogger(dbname); ! listener.rangelogger = new RangeLogger(dbname); ! listener.gpslogger = new GPSLogger(dbname); ! //listener.xbowlogger = new XBowLogger(dbname); try { *************** *** 283,284 **** --- 289,302 ---- } + + class dispatch { + + public int type; + public ListenFB.PacketPrinter pp; + + public dispatch(int type, ListenFB.PacketPrinter pp) { + this.type = type; + this.pp = pp; + } + + } Index: RangeMsg.java =================================================================== RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/RangeMsg.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RangeMsg.java 27 Mar 2004 00:04:47 -0000 1.2 --- RangeMsg.java 9 Aug 2004 19:47:37 -0000 1.3 *************** *** 10,19 **** /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 9; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 129; ! /** Create a new RangeMsg of size 9. */ public RangeMsg() { super(DEFAULT_MESSAGE_SIZE); --- 10,19 ---- /** The default size of this message type in bytes. */ ! public static final int DEFAULT_MESSAGE_SIZE = 11; /** The Active Message type associated with this message. */ public static final int AM_TYPE = 129; ! /** Create a new RangeMsg of size 11. */ public RangeMsg() { super(DEFAULT_MESSAGE_SIZE); *************** *** 102,105 **** --- 102,114 ---- s += " [voltage=0x"+Long.toHexString(get_voltage())+"]\n"; } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } + try { + s += " [NS=0x"+Long.toHexString(get_NS())+"]\n"; + } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } + try { + s += " [EW=0x"+Long.toHexString(get_EW())+"]\n"; + } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } + try { + s += " [numsats=0x"+Long.toHexString(get_numsats())+"]\n"; + } catch (ArrayIndexOutOfBoundsException aioobe) { /* Skip field */ } return s; } *************** *** 422,424 **** --- 431,627 ---- } + ///////////////////////////////////////////////////////// + // Accessor methods for field: NS + // Field type: byte, unsigned + // Offset (bits): 72 + // Size (bits): 1 + ///////////////////////////////////////////////////////// + + /** + * Return whether the field 'NS' is signed (false). + */ + public static boolean isSigned_NS() { + return false; + } + + /** + * Return whether the field 'NS' is an array (false). + */ + public static boolean isArray_NS() { + return false; + } + + /** + * Return the offset (in bytes) of the field 'NS' + */ + public static int offset_NS() { + return (72 / 8); + } + + /** + * Return the offset (in bits) of the field 'NS' + */ + public static int offsetBits_NS() { + return 72; + } + + /** + * Return the value (as a byte) of the field 'NS' + */ + public byte get_NS() { + return (byte)getUIntElement(offsetBits_NS(), 1); + } + + /** + * Set the value of the field 'NS' + */ + public void set_NS(byte value) { + setUIntElement(offsetBits_NS(), 1, value); + } + + /** + * Return the size, in bytes, of the field 'NS' + * WARNING: This field is not an even-sized number of bytes (1 bits). + */ + public static int size_NS() { + return (1 / 8) + 1; + } + + /** + * Return the size, in bits, of the field 'NS' + */ + public static int sizeBits_NS() { + return 1; + } + + ///////////////////////////////////////////////////////// + // Accessor methods for field: EW + // Field type: byte, unsigned + // Offset (bits): 73 + // Size (bits): 1 + ///////////////////////////////////////////////////////// + + /** + * Return whether the field 'EW' is signed (false). + */ + public static boolean isSigned_EW() { + return false; + } + + /** + * Return whether the field 'EW' is an array (false). + */ + public static boolean isArray_EW() { + return false; + } + + /** + * Return the offset (in bytes) of the field 'EW' + * WARNING: This field is not byte-aligned (bit offset 73). + */ + public static int offset_EW() { + return (73 / 8); + } + + /** + * Return the offset (in bits) of the field 'EW' + */ + public static int offsetBits_EW() { + return 73; + } + + /** + * Return the value (as a byte) of the field 'EW' + */ + public byte get_EW() { + return (byte)getUIntElement(offsetBits_EW(), 1); + } + + /** + * Set the value of the field 'EW' + */ + public void set_EW(byte value) { + setUIntElement(offsetBits_EW(), 1, value); + } + + /** + * Return the size, in bytes, of the field 'EW' + * WARNING: This field is not an even-sized number of bytes (1 bits). + */ + public static int size_EW() { + return (1 / 8) + 1; + } + + /** + * Return the size, in bits, of the field 'EW' + */ + public static int sizeBits_EW() { + return 1; + } + + ///////////////////////////////////////////////////////// + // Accessor methods for field: numsats + // Field type: byte, unsigned + // Offset (bits): 74 + // Size (bits): 4 + ///////////////////////////////////////////////////////// + + /** + * Return whether the field 'numsats' is signed (false). + */ + public static boolean isSigned_numsats() { + return false; + } + + /** + * Return whether the field 'numsats' is an array (false). + */ + public static boolean isArray_numsats() { + return false; + } + + /** + * Return the offset (in bytes) of the field 'numsats' + * WARNING: This field is not byte-aligned (bit offset 74). + */ + public static int offset_numsats() { + return (74 / 8); + } + + /** + * Return the offset (in bits) of the field 'numsats' + */ + public static int offsetBits_numsats() { + return 74; + } + + /** + * Return the value (as a byte) of the field 'numsats' + */ + public byte get_numsats() { + return (byte)getUIntElement(offsetBits_numsats(), 4); + } + + /** + * Set the value of the field 'numsats' + */ + public void set_numsats(byte value) { + setUIntElement(offsetBits_numsats(), 4, value); + } + + /** + * Return the size, in bytes, of the field 'numsats' + * WARNING: This field is not an even-sized number of bytes (4 bits). + */ + public static int size_numsats() { + return (4 / 8) + 1; + } + + /** + * Return the size, in bits, of the field 'numsats' + */ + public static int sizeBits_numsats() { + return 4; + } + } |
From: Alex Do <use...@us...> - 2004-08-06 07:11:25
|
Update of /cvsroot/firebug/firebug/doc/chassis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5025 Modified Files: chassis.tex Log Message: Developed background and need; added outline notes in DFA, mounting, and DFM sections Index: chassis.tex =================================================================== RCS file: /cvsroot/firebug/firebug/doc/chassis/chassis.tex,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** chassis.tex 21 Jul 2004 18:56:00 -0000 1.11 --- chassis.tex 6 Aug 2004 07:11:16 -0000 1.12 *************** *** 1,255 **** ! \documentclass{article} ! ! \usepackage{chicago} ! \usepackage{graphicx} ! \usepackage{subfigure} ! %\input{comment} ! ! \setlength{\textheight}{8.5in} ! \setlength{\topmargin}{0in} ! \setlength{\oddsidemargin}{0in} ! \setlength{\textwidth}{6.5in} ! ! ! ! ! \begin{document} ! ! \title{Chassis design for motes} ! \author{Kevin Lee, Alex Do, David M. Doolin, Nicholas Sitar} ! \date{\today} ! \maketitle ! ! \section{Introduction} ! Wireless sensors networks (WSN) are currently emerging as solutions to monitor ! and collect data in situations where traditional ``wired'' sensing components ! are cumbersome or impractical. Though originally developed in the late 1990's ! for the military to monitor hostile combat situations~\cite{need_ref}, ! scientists, engineers and domain experts in many fields ! now see applications in monitoring structural conditions in large skyscrapers ! or bridges, industrial manufacturing operations, heating and cooling systems, ! and an endless addition of other applications. The technology, however, is ! extremely early in its lifecycle -- where commercial markets are minute and ! the bulk of the current customers are comprised of government, academic, and ! corporate researchers~\cite{appropriate_refs} ! ! These researchers are continually developing and optimizing WSN for use in ! untracked territory (often literally)~\shortcite{mainwaring:a2002}, ! and require hardware that can repeatedly be rapidly deployed, operated, and ! then taken down for constant revision. Because of the nascence of the ! technology, there are no commercially available housings or chassis units ! available that serve as the ``AT computer case'' of wireless sensor hardware. ! ! We are developing a mechanical chassis for wireless sensor network equipment ! distributed by Crossbow Inc. The chassis will allow for rapid assembly, ! deployment, and dissasembly of the Crossbow WSN hardware. ! ! This paper reviews the design process and technical issues for creating such a chassis. ! ! \section{Hardware Overview} ! -Components overview ! -sensing ! -mote board ! --radio antenna ! -power ! ! Discuss issues that stem from interconnections and assembly. ! ! \section{Design Objectives} ! Discuss needs for the following features: ! -Tool-less; requires only hands and possibly a coin to open, disassemble, reassemble (rapid and simple) ! -Separation of modular components: sensing, power, mote, antennas ! -Wiring harness to separate power connection ! -battery cage design to accommodate different battery candidates ! -Supports mounting by: screw, strap, zip-tie, magnet ! -Injection moldable for low-cost production ! ! ! \section{Design for Assembly} ! ! ! \section{Wiring harness} ! ! To create wiring harnesses for the motes, the issues that were encountered ! can be separated into roughly two sections: crimping the connectors ! and connecting the connectors to the battery cases. ! ! ! \subsection{Crimping the connectors} ! ! ! In order to utilize the Molex power connector on the mote, we ! purchased 50058-8100 Molex crimp terminals and 51021-0200 Molex ! crimp housings. To accommodate the size of these two parts, ! we found it best to use 26 AWG wire. In order to crimp these ! connectors, we were officially supposed to use a specific Molex ! crimping tool.However, the cost of this tool is roughly \$180, ! making it quite a hefty investment. Thus, we instead went with ! a \$7 crimping tool from a nearby electronics store, and did our ! best to make working connectors. But because of the size of ! these parts, crimping the terminals was very difficult, and even ! now there is no telling just how robust these connectors are. ! ! \subsection{Connecting the connectors to the battery cases} ! ! The battery cases provided with the motes caused a predicament ! when it came to connecting the connectors to an actual power ! source, which in this case meant batteries. For some of the ! battery cases that no longer had wires extending from them, we ! tried to solder wires to the cases, but to no avail. The cases ! just were not designed for soldering wires to them. And even ! for the cases that did still have wires connected to them, ! there were still issues to be addressed. ! ! To join the wires and form one piece that went from the battery case to ! the connector, solder was first applied on each pair of wire separately ! (the two red and two black wires) and then reinforced altogether with some ! plastic heat-shrinking material. This process, however, had some flaws. ! First, the diameter of the heat shrink (expanded diameter of .187) ! could not fit over the crimp housings, so the heat shrink had to be ! placed on the wires prior to soldering. It is important to note that ! since the heat-shrinking material only shrinks up to 50\% of its expanded ! diameter, a larger heat shrink would have been too loose to properly ! insulate the two sets of wires together. Thus, we could not use heat ! shrinks with a larger diameter to remedy this problem.As a result, ! since we had to place the heat shrink on the wires before soldering, ! the length of heat shrink that we were allowed to use was limited ! by where the joining of the wires would take place. This was rather ! disappointing, because we had hoped to cover up the two wires entirely ! with heat-shrinking material so that the two sets of wires would act as ! one. The second flaw we found was that the soldered wires could not ! just be wrapped in heat-shrinking material, because a short would then ! exist at the soldered areas between the red and black wires. To prevent ! a short from happening, the two options were to either first wrap each ! wire separately with heat-shrinking material and then wrap both of these ! with a heat shrink, or to use electrical tape and first insulate each of ! the wires before applying the heat shrink. The former could not be done, ! however, because we did not have heat shrink with a large enough diameter ! that would insulate the two heat-shrinked wires. The latter proved to ! be quite difficult too, because the heat shrink barely (and in some cases ! failed to) fit over the taped-and-soldered wires. ! ! \subsection{Suggestions} ! ! ! From these experiences with creating wire harnesses for the ! motes, we have a couple of suggestions to make. The first ! one is regarding the Molex power connector on the mote board. ! It would be nicer if Crossbow could use a larger (and possibly ! structurally different) connector so that we could manually make ! more robust connections. Secondly, it would be very helpful if ! Crossbow could provide better battery cases. Since there is a ! Molex power connector on the mote board, Crossbow should devise ! a way for people to utilize that connector instead of just the ! soldered connections. Using the current battery cases for this ! purpose is very difficult, largely because of the different sizes ! of the wires, and the difficulty of insulating them properly. ! It would be great if Crossbow could either provide battery cases ! that would allow us to connect our wires directly to them (instead ! of having to find a way to couple our wires with existing ones), ! or to maybe even provide a battery case that already has a molex ! connector on the end. ! ! ! \section{Batteries} ! ! ! When considering whether to use the Nickel-Cadmium (Ni-Cd) ! or Lithium Ion (Li-ion) batteries, we took into account ! several factors, focusing on its ease of use and whether ! there would be detrimental effects to the environment ! given the proposed usage of these batteries. Since ! firefighters will be placing these battery-powered ! devices on their helmets, one issue is to have the ! batteries be as light as possible. In this case, the ! Li-Ion battery chemistry is much lighter than the ! Nickel-Cadmium one, providing less of a burden on ! firefighters. Now the idea of using rechargeable ! batteries was so that firefighters would not have to ! frequently open up the device and replace the AA ! batteries. However, Ni-Cd batteries have what is ! known as ``the memory effect,'' where partial ! discharges will lead to a decrease in the capacity ! of the battery. Thus, to combat the memory effect, ! it is recommended that the Ni-Cd batteries be fully ! discharged before recharging. If we were to require ! firefighters to completely discharge the batteries ! first each time, then this idea of using rechargeable ! batteries would not be that much more convenient than ! having to replace the AAs. Moreover, if the batteries were to only be used for motes, then they would never be completely discharged. Luckily, Li-Ion batteries ! do not have this effect, and it is even recommended that ! only partial discharges be made before recharging them. ! Lastly, another concern was what effects the batteries ! could have on the environment if they were burned up. ! Again, the Li-Ion batteries prove to be the better choice, ! as Ni-Cd batteries are toxic and harmful to the environment. ! Li-Ion batteries do not even contain free lithium, thus ! making them much safer for this particular use. Given ! these considerations, Li-Ion batteries are much more ! suitable than Ni-Cd batteries for this project. ! ! \subsection{Combining the Battery with the Motes} ! ! ! Currently we are using 3.7V, 600mAh Li-Ion rechargeable batteries, manufactured by Ultralife Batteries, Inc. Unlike normal rechargeable batteries that are found in electronic devices, these OEM batteries do not have connectors on them already, only two wires with positive and negative polarities. What this means is that we also have to decide on the type of connector to use. Judging from the amount of difficulty we have had with the Molex 51021-0200 crimp housings, it would be nice if some other sort of connector could be used, especially a larger one, since the battery wires are larger than the ones used to attach the battery case to the Molex power connector on the board. ! (to be continued...) ! ! Ideally, it would be nice if we could use the one connector for the entire mote. This would leave us with three options: use the molex power connector, the adaptor jack, or a mini-USB jack. ! ! \section{Mounting} ! ! ! \section{Design for Injection Molding} ! ! ! \begin{figure} ! \begin{center} ! \includegraphics[width=3in]{figs/exploded_view_2.eps} ! \caption{An exploded view of the ``candy bar'' chassis ! used for the controlled burn test at East Bay Regional ! Parks Fire Department, Lake Chabot.} ! \label{fig:exploded_view_2} ! \end{center} ! \end{figure} ! ! ! ! A prototyped ``candy bar'' chassis machined from acrylic ! is shown in Fig.~\ref{fig:exploded_view_2}. ! ! ! \begin{figure} ! \begin{center} ! \subfigure[Front view.]{\label{subfig:candy_bar_injection_moldable_front}% ! \includegraphics[width=2.5in]{figs/candy_bar_injection_moldable_front.eps}} ! \subfigure[Back view.]{\label{subfig:candy_bar_injection_moldable_back}% ! \includegraphics[width=2.5in]{figs/candy_bar_injection_moldable_back.eps}} ! \subfigure[FDM front view.]{\label{subfig:fdm_front}% ! \includegraphics[width=2.5in]{figs/fdm_front.eps}} ! \subfigure[FDM back view.]{\label{subfig:fdm_back}% ! \includegraphics[width=2.5in]{figs/fdm_back.eps}} ! \caption{Injection mold design, and prototype using FDM technology.} ! \label{fig:cbim} ! \end{center} ! \end{figure} ! ! An injection moldable chassis, as shown in ! Fig.~\ref{fig:cbim} was designed with the ??? software. ! ! \begin{figure} ! \begin{center} ! \includegraphics[width=3in]{figs/fdm_assembled.eps} ! \caption{Assembled mote using FDM prototype.} ! \label{fig:fdm_assembled} ! \end{center} ! \end{figure} ! ! ! \section{Conclusions} ! ! ! \bibliographystyle{chicago} ! \bibliography{tinyos,sensor} ! ! \end{document} ! --- 1,297 ---- ! \documentclass{article} ! ! \usepackage{chicago} ! \usepackage{graphicx} ! \usepackage{subfigure} ! %\input{comment} ! ! \setlength{\textheight}{8.5in} ! \setlength{\topmargin}{0in} ! \setlength{\oddsidemargin}{0in} ! \setlength{\textwidth}{6.5in} ! ! ! ! ! \begin{document} ! ! \title{Chassis design for motes} ! \author{Kevin Lee, Alex Do, David M. Doolin, Nicholas Sitar} ! \date{\today} ! \maketitle ! ! \section{Introduction} ! Wireless sensors networks (WSN) are currently emerging as solutions to monitor ! and collect data in situations where traditional ``wired'' sensing components ! are cumbersome or impractical. Though originally developed in the late 1990's ! for the military to monitor hostile combat situations~\cite{need_ref}, ! scientists, engineers and domain experts in many fields ! now see applications in monitoring structural conditions in large skyscrapers ! or bridges, industrial manufacturing operations, heating and cooling systems, ! and an endless addition of other applications. The technology, however, is ! extremely early in its lifecycle -- where commercial markets are minute and ! the bulk of the current customers are comprised of government, academic, and ! corporate researchers~\cite{appropriate_refs} ! ! These researchers are continually developing and optimizing WSN for use in ! untracked territory (often literally)~\shortcite{mainwaring:a2002}, ! and require hardware that can repeatedly be rapidly deployed, operated, and ! then taken down for constant revision. Because of the nascence of the ! technology, there are no commercially available housings or chassis units ! available that serve as the ``AT computer case'' of wireless sensor hardware. ! ! We are developing a mechanical chassis for wireless sensor network equipment ! distributed by Crossbow Inc. The chassis will allow for rapid assembly, ! deployment, and dissasembly of the Crossbow WSN hardware. ! ! This paper reviews the design process and technical issues for creating such a chassis. ! ! \section{Background} ! The architecture of a typical wireless sensor consists of the following layers: sensing, ! communications, and power. Because WSN sensors operate in mesh networks rather ! than through point-to-point communication, the communications boards (motes) are ! more than simple radio transmitters; they consist of an operating system that manages ! use of power, operates the sensors, and receives and transmits data packets. As this ! is a mechanical design study, we will not discuss software since it has no bearing ! on the mechanical package. ! ! >>need figure of mica mote ! ! The Crossbow Mica platform isolates the remaining layers into the following physical ! components: sensor boards, a mote board (along with an external radio antenna), and ! a battery clip that holds two AA battery cells. The sensor boards connect to the mote ! using a stackable 52-pin edge connector that allows multiple sensors to be used simultaneously. ! The battery clip is connected to the mote through two inch-long narrow-gauge stranded wires that ! soldered directly to the mote board (*footnote: earlier versions used solid wire that was not flexible). ! The mote board is secured to the battery clip with a small piece of foam adhesive. For the radio ! antennas, Mica users can choose from a solder-on wire antenna or a removable antenna ! that plugs into an MMCX connector on the mote board. ! ! While a Mica wireless sensor is functional "out-of-the-box," the default configuration is ! not rugged enough for practical use. Network testing and deployment requires the motes ! to be physically handled, mounted to walls and ceilings, disassembled and reassembled. The ! current interconnections between each of the components break or fail, ceasing operation of ! the sensor node until the unit is repaired. Here is a summary of common problems must be solved ! in the design of a chassis: ! -the edge connectors do not feature any locking engagement, so the sensor boards can become loosened from the mote or from each other ! -the wires from the battery clips are stressed very highly at the solder junctions, and break frequently even with light handling ! -the foam adhesive is not very strong, so the mote and sensors easily become loosened from the battery clip and often causing the fault above ! -the solder-on antenna becomes stressed from repeated repositioning and breaks off from the mote often ! ! In addition, the current mechanical package does not support for mounting. It is nearly impossible to ! secure a bare mote to a tree or a wooden post. Even in an indoor environment, the only common method ! of mounting a mote is by using Velcro (trademark) or other two-sided adhesive, and still many of the ! aforementioned problems occur. ! ! \section{Design Objectives} ! Early on we identified the following design objectives in a mounting chassis: ! -Tool-less; requires only hands and possibly a coin to open, disassemble, reassemble (rapid and simple) ! -Separation of modular components: sensing, power, mote, antennas ! -Wiring harness to separate power connection ! -battery cage design to accommodate different battery candidates ! -Supports mounting by: screw, strap, zip-tie, magnet ! -Injection moldable for low-cost high-volume production ! ! ! \section{Design for Assembly} ! >>Boothroyd references ! ! -mounting mote onto chassis; supporting edge connectors ! -using wiring harness to connect power to mote ! ! -pyramid assembly ! -using standoffs as thumbnuts ! -chamfers on the battery clip ! ! \section{Wiring harness} ! ! To create wiring harnesses for the motes, the issues that were encountered ! can be separated into roughly two sections: crimping the connectors ! and connecting the connectors to the battery cases. ! ! ! \subsection{Crimping the connectors} ! ! ! In order to utilize the Molex power connector on the mote, we ! purchased 50058-8100 Molex crimp terminals and 51021-0200 Molex ! crimp housings. To accommodate the size of these two parts, ! we found it best to use 26 AWG wire. In order to crimp these ! connectors, we were officially supposed to use a specific Molex ! crimping tool.However, the cost of this tool is roughly \$180, ! making it quite a hefty investment. Thus, we instead went with ! a \$7 crimping tool from a nearby electronics store, and did our ! best to make working connectors. But because of the size of ! these parts, crimping the terminals was very difficult, and even ! now there is no telling just how robust these connectors are. ! ! \subsection{Connecting the connectors to the battery cases} ! ! The battery cases provided with the motes caused a predicament ! when it came to connecting the connectors to an actual power ! source, which in this case meant batteries. For some of the ! battery cases that no longer had wires extending from them, we ! tried to solder wires to the cases, but to no avail. The cases ! just were not designed for soldering wires to them. And even ! for the cases that did still have wires connected to them, ! there were still issues to be addressed. ! ! To join the wires and form one piece that went from the battery case to ! the connector, solder was first applied on each pair of wire separately ! (the two red and two black wires) and then reinforced altogether with some ! plastic heat-shrinking material. This process, however, had some flaws. ! First, the diameter of the heat shrink (expanded diameter of .187) ! could not fit over the crimp housings, so the heat shrink had to be ! placed on the wires prior to soldering. It is important to note that ! since the heat-shrinking material only shrinks up to 50\% of its expanded ! diameter, a larger heat shrink would have been too loose to properly ! insulate the two sets of wires together. Thus, we could not use heat ! shrinks with a larger diameter to remedy this problem.As a result, ! since we had to place the heat shrink on the wires before soldering, ! the length of heat shrink that we were allowed to use was limited ! by where the joining of the wires would take place. This was rather ! disappointing, because we had hoped to cover up the two wires entirely ! with heat-shrinking material so that the two sets of wires would act as ! one. The second flaw we found was that the soldered wires could not ! just be wrapped in heat-shrinking material, because a short would then ! exist at the soldered areas between the red and black wires. To prevent ! a short from happening, the two options were to either first wrap each ! wire separately with heat-shrinking material and then wrap both of these ! with a heat shrink, or to use electrical tape and first insulate each of ! the wires before applying the heat shrink. The former could not be done, ! however, because we did not have heat shrink with a large enough diameter ! that would insulate the two heat-shrinked wires. The latter proved to ! be quite difficult too, because the heat shrink barely (and in some cases ! failed to) fit over the taped-and-soldered wires. ! ! \subsection{Suggestions} ! ! ! From these experiences with creating wire harnesses for the ! motes, we have a couple of suggestions to make. The first ! one is regarding the Molex power connector on the mote board. ! It would be nicer if Crossbow could use a larger (and possibly ! structurally different) connector so that we could manually make ! more robust connections. Secondly, it would be very helpful if ! Crossbow could provide better battery cases. Since there is a ! Molex power connector on the mote board, Crossbow should devise ! a way for people to utilize that connector instead of just the ! soldered connections. Using the current battery cases for this ! purpose is very difficult, largely because of the different sizes ! of the wires, and the difficulty of insulating them properly. ! It would be great if Crossbow could either provide battery cases ! that would allow us to connect our wires directly to them (instead ! of having to find a way to couple our wires with existing ones), ! or to maybe even provide a battery case that already has a molex ! connector on the end. ! ! ! \section{Batteries} ! ! ! When considering whether to use the Nickel-Cadmium (Ni-Cd) ! or Lithium Ion (Li-ion) batteries, we took into account ! several factors, focusing on its ease of use and whether ! there would be detrimental effects to the environment ! given the proposed usage of these batteries. Since ! firefighters will be placing these battery-powered ! devices on their helmets, one issue is to have the ! batteries be as light as possible. In this case, the ! Li-Ion battery chemistry is much lighter than the ! Nickel-Cadmium one, providing less of a burden on ! firefighters. Now the idea of using rechargeable ! batteries was so that firefighters would not have to ! frequently open up the device and replace the AA ! batteries. However, Ni-Cd batteries have what is ! known as ``the memory effect,'' where partial ! discharges will lead to a decrease in the capacity ! of the battery. Thus, to combat the memory effect, ! it is recommended that the Ni-Cd batteries be fully ! discharged before recharging. If we were to require ! firefighters to completely discharge the batteries ! first each time, then this idea of using rechargeable ! batteries would not be that much more convenient than ! having to replace the AAs. Moreover, if the batteries were to only be used for motes, then they would never be completely discharged. Luckily, Li-Ion batteries ! do not have this effect, and it is even recommended that ! only partial discharges be made before recharging them. ! Lastly, another concern was what effects the batteries ! could have on the environment if they were burned up. ! Again, the Li-Ion batteries prove to be the better choice, ! as Ni-Cd batteries are toxic and harmful to the environment. ! Li-Ion batteries do not even contain free lithium, thus ! making them much safer for this particular use. Given ! these considerations, Li-Ion batteries are much more ! suitable than Ni-Cd batteries for this project. ! ! \subsection{Combining the Battery with the Motes} ! ! ! Currently we are using 3.7V, 600mAh Li-Ion rechargeable batteries, manufactured by Ultralife Batteries, Inc. Unlike normal rechargeable batteries that are found in electronic devices, these OEM batteries do not have connectors on them already, only two wires with positive and negative polarities. What this means is that we also have to decide on the type of connector to use. Judging from the amount of difficulty we have had with the Molex 51021-0200 crimp housings, it would be nice if some other sort of connector could be used, especially a larger one, since the battery wires are larger than the ones used to attach the battery case to the Molex power connector on the board. ! (to be continued...) ! ! Ideally, it would be nice if we could use the one connector for the entire mote. This would leave us with three options: use the molex power connector, the adaptor jack, or a mini-USB jack. ! ! \section{Mounting} ! -strapping (velcro, zip-tie) ! -hooks ! -magnets ! ! \section{Design for Injection Molding} ! ! -straight-pull design ! -avoiding undercuts ! -constant wall thickness to avoid shrinkage ! -shelled design ! -strapping slots ribbed for rigidity ! ! \begin{figure} ! \begin{center} ! \includegraphics[width=3in]{figs/exploded_view_2.eps} ! \caption{An exploded view of the ``candy bar'' chassis ! used for the controlled burn test at East Bay Regional ! Parks Fire Department, Lake Chabot.} ! \label{fig:exploded_view_2} ! \end{center} ! \end{figure} ! ! ! ! A prototyped ``candy bar'' chassis machined from acrylic ! is shown in Fig.~\ref{fig:exploded_view_2}. ! ! ! \begin{figure} ! \begin{center} ! \subfigure[Front view.]{\label{subfig:candy_bar_injection_moldable_front}% ! \includegraphics[width=2.5in]{figs/candy_bar_injection_moldable_front.eps}} ! \subfigure[Back view.]{\label{subfig:candy_bar_injection_moldable_back}% ! \includegraphics[width=2.5in]{figs/candy_bar_injection_moldable_back.eps}} ! \subfigure[FDM front view.]{\label{subfig:fdm_front}% ! \includegraphics[width=2.5in]{figs/fdm_front.eps}} ! \subfigure[FDM back view.]{\label{subfig:fdm_back}% ! \includegraphics[width=2.5in]{figs/fdm_back.eps}} ! \caption{Injection mold design, and prototype using FDM technology.} ! \label{fig:cbim} ! \end{center} ! \end{figure} ! ! An injection moldable chassis, as shown in ! Fig.~\ref{fig:cbim} was designed with the ??? software. ! ! \begin{figure} ! \begin{center} ! \includegraphics[width=3in]{figs/fdm_assembled.eps} ! \caption{Assembled mote using FDM prototype.} ! \label{fig:fdm_assembled} ! \end{center} ! \end{figure} ! ! ! \section{Conclusions} ! ! ! \bibliographystyle{chicago} ! \bibliography{tinyos,sensor} ! ! \end{document} ! |
From: David M. D. <do...@us...> - 2004-08-04 01:56:22
|
Update of /cvsroot/firebug/fireboard/tools/src/xlisten/boards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25760/boards Modified Files: mts400.c Log Message: Fixed xlisten code, added voltage output. Index: mts400.c =================================================================== RCS file: /cvsroot/firebug/fireboard/tools/src/xlisten/boards/mts400.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mts400.c 3 Aug 2004 23:22:35 -0000 1.3 --- mts400.c 4 Aug 2004 01:56:14 -0000 1.4 *************** *** 114,118 **** * @version 2004/3/29 husiquan Initial revision */ ! int mts400_convert_intersemapressure(XbowSensorboardPacket *packet) { --- 114,119 ---- * @version 2004/3/29 husiquan Initial revision */ ! float ! mts400_convert_intersemapressure(XbowSensorboardPacket *packet) { *************** *** 147,151 **** Press = X/32.0 + 250.0; ! return (int)Press; } --- 148,152 ---- Press = X/32.0 + 250.0; ! return Press; } *************** *** 158,162 **** * @version 2004/3/29 husiquan Initial revision */ ! int mts400_convert_intersematemp(XbowSensorboardPacket *packet) { float UT1,dT,Temp; --- 159,164 ---- * @version 2004/3/29 husiquan Initial revision */ ! float ! mts400_convert_intersematemp(XbowSensorboardPacket *packet) { float UT1,dT,Temp; *************** *** 179,183 **** Temp /=10.0; ! return (int)Temp; } --- 181,185 ---- Temp /=10.0; ! return Temp; } *************** *** 199,203 **** * @version 2004/3/29 husiquan Initial revision */ ! int mts400_convert_humidity(XbowSensorboardPacket *packet){ float fTemp,fHumidity; --- 201,206 ---- * @version 2004/3/29 husiquan Initial revision */ ! float ! mts400_convert_humidity(XbowSensorboardPacket *packet){ float fTemp,fHumidity; *************** *** 212,216 **** fHumidity= (fTemp-25.0)* (0.01 + 0.00008 * HumData) + fHumidity; ! return (int)fHumidity; } --- 215,219 ---- fHumidity= (fTemp-25.0)* (0.01 + 0.00008 * HumData) + fHumidity; ! return fHumidity; } *************** *** 223,227 **** * @version 2004/3/29 husiquan Initial revision */ ! int mts400_convert_temp(XbowSensorboardPacket *packet) { float fTemp; --- 226,231 ---- * @version 2004/3/29 husiquan Initial revision */ ! float ! mts400_convert_temp(XbowSensorboardPacket *packet) { float fTemp; *************** *** 231,236 **** fTemp = -38.4 + 0.0098*(float)TempData; ! return (int)fTemp; ! } /** --- 235,240 ---- fTemp = -38.4 + 0.0098*(float)TempData; ! return fTemp; ! } /** *************** *** 593,597 **** // Packet data should be dereferenced and passed to the // conversion functions, don't pass the entire packet. ! fprintf(logfile,"%s\t%i\t%i\t%i\t%i\t%i\n", timestring, packet->node_id, --- 597,601 ---- // Packet data should be dereferenced and passed to the // conversion functions, don't pass the entire packet. ! fprintf(stdout,"%s\t%i\t%.2f\t%.2f\t%.2f\t%.2f\t%i\n", timestring, packet->node_id, *************** *** 599,604 **** mts400_convert_temp(packet), mts400_convert_intersematemp(packet), ! mts400_convert_intersemapressure(packet)); ! fflush(logfile); } --- 603,609 ---- mts400_convert_temp(packet), mts400_convert_intersematemp(packet), ! mts400_convert_intersemapressure(packet), ! (int)mts400_convert_battery(packet)); ! //fflush(logfile); } |
From: David M. D. <do...@us...> - 2004-08-04 01:56:22
|
Update of /cvsroot/firebug/fireboard/tools/src/xlisten In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25760 Modified Files: xlisten.c xpacket.c xsensors.h Log Message: Fixed xlisten code, added voltage output. Index: xpacket.c =================================================================== RCS file: /cvsroot/firebug/fireboard/tools/src/xlisten/xpacket.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** xpacket.c 23 Jul 2004 00:32:07 -0000 1.4 --- xpacket.c 4 Aug 2004 01:56:13 -0000 1.5 *************** *** 210,214 **** case XPACKET_TEXT_MSG: packet->reserved2 = '\0'; ! printf("MSG from id=%d: %s\n\n", packet->node_id, packet->data); return; } --- 210,215 ---- case XPACKET_TEXT_MSG: packet->reserved2 = '\0'; ! printf("MSG from id=%d: %s\n\n", packet->node_id, ! (char*)packet->data); return; } *************** *** 221,228 **** if (packet_printer[i].type == sensorboard_id) { packet_printer[i].print_cooked(packet); ! break; } i++; } } --- 222,230 ---- if (packet_printer[i].type == sensorboard_id) { packet_printer[i].print_cooked(packet); ! return; } i++; } + fprintf(stderr,"No print function defined for this sensor board.\n"); } *************** *** 321,325 **** case XTYPE_MTS420: ! //mts420_print_tabbed(packet); break; --- 323,327 ---- case XTYPE_MTS420: ! //mts420_print_cooked(packet); break; Index: xsensors.h =================================================================== RCS file: /cvsroot/firebug/fireboard/tools/src/xlisten/xsensors.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** xsensors.h 15 Jul 2004 17:03:39 -0000 1.1 --- xsensors.h 4 Aug 2004 01:56:13 -0000 1.2 *************** *** 70,74 **** #define XPACKET_LENGTH 4 //!< offset to length of TOS packet #define XPACKET_DATASTART 5 //!< UART offset to data payload ! #define XPACKET_DATASTART_WIRELESS 7 //!< Wireless offset to data payload /* Sensorboard data packet definitions */ --- 70,75 ---- #define XPACKET_LENGTH 4 //!< offset to length of TOS packet #define XPACKET_DATASTART 5 //!< UART offset to data payload ! #define XPACKET_DATASTART_WIRELESS 5 //!< Wireless offset to data payload ! #define XPACKET_DATASTART_MULTIHOP 12 //!< Multihop offset to data payload /* Sensorboard data packet definitions */ Index: xlisten.c =================================================================== RCS file: /cvsroot/firebug/fireboard/tools/src/xlisten/xlisten.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** xlisten.c 15 Jul 2004 17:03:39 -0000 1.1 --- xlisten.c 4 Aug 2004 01:56:13 -0000 1.2 *************** *** 57,60 **** --- 57,63 ---- + /** + * Shut down cleanly. + */ void catch_sigint(int signal) { *************** *** 114,118 **** case 'w': g_params.bits.mode_wireless = 1; ! xpacket_set_start(XPACKET_DATASTART_WIRELESS); break; --- 117,124 ---- case 'w': g_params.bits.mode_wireless = 1; ! int offset = XPACKET_DATASTART_WIRELESS; ! if (argv[argc][2] == '=') ! offset = atoi(argv[argc]+3); ! xpacket_set_start(offset); break; *************** *** 229,232 **** --- 235,239 ---- if (g_params.bits.display_cooked) xpacket_print_cooked(buffer); + //if (g_params.bits.display_cooked) xpacket_print_tabbed(buffer); } } |
From: David M. D. <do...@us...> - 2004-08-03 23:22:45
|
Update of /cvsroot/firebug/fireboard/tools/src/xlisten/boards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4154 Modified Files: mts400.c Log Message: Syncing xlisten code. Index: mts400.c =================================================================== RCS file: /cvsroot/firebug/fireboard/tools/src/xlisten/boards/mts400.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mts400.c 23 Jul 2004 00:32:07 -0000 1.2 --- mts400.c 3 Aug 2004 23:22:35 -0000 1.3 *************** *** 600,629 **** mts400_convert_intersematemp(packet), mts400_convert_intersemapressure(packet)); ! #if 0 ! // cooked output ! fprintf(logfile,"MTS420 [sensor data converted to engineering units]:\n" ! " health: node id = %i\n" ! " battery: = %i mv \n" ! " humidity: = %i %% \n" ! " Temperature: = %i degC \n" ! " IntersemaTemperature: = %i degC \n" ! " IntersemaPressure: = %i mbar \n", ! packet->node_id, ! mts400_convert_battery(packet), ! mts400_convert_humidity(packet), ! mts400_convert_temp(packet), ! mts400_convert_intersematemp(packet), ! mts400_convert_intersemapressure(packet) ! ); ! if(light<-0.5) fprintf(logfile," One of the CHs overflow,Light reading invalid.\n"); ! else fprintf(logfile," Light: = %f lux \n",light); ! fprintf(logfile," X-axis Accel: = %f mg \n" ! " Y-axis Accel: = %f mg \n", ! mts400_convert_accel_x(packet), ! mts400_convert_accel_y(packet)); ! fprintf(logfile,"\n"); ! timestamp_get_ymdhms(ts,timestring); ! printf("\n\nTime stamp: %s.\n\n",timestring); ! #endif } --- 600,604 ---- mts400_convert_intersematemp(packet), mts400_convert_intersemapressure(packet)); ! fflush(logfile); } |
From: Kevin <kar...@us...> - 2004-08-03 22:31:44
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28437 Modified Files: index.php Log Message: Updated version of the website. Index: index.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/index.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** index.php 3 Aug 2004 01:35:41 -0000 1.3 --- index.php 3 Aug 2004 22:31:35 -0000 1.4 *************** *** 18,23 **** ?> <p> ! <font size = 5> --- 18,27 ---- ?> + <br> + <br> + <br> + <p> ! <font size = 4> *************** *** 26,34 **** Collecting real time data from wildfires is important for life safety considerations, and allows predictive analysis of evolving fire behavior. One way to collect such data is to deploy sensors in the wild fire environment. FireBugs are small, wireless sensors (motes) based on TinyOS that self-organize into networks for collecting real time data in wild fire environments. The FireBug system combines state-of-the-art sensor hardware running TinyOS with standard, off-the-shelf World Wide Web and database technology for allowing users to rapidly deploy FireBugs and monitor network behavior. ! </f> </p> <br> <br> <br> --- 30,45 ---- Collecting real time data from wildfires is important for life safety considerations, and allows predictive analysis of evolving fire behavior. One way to collect such data is to deploy sensors in the wild fire environment. FireBugs are small, wireless sensors (motes) based on TinyOS that self-organize into networks for collecting real time data in wild fire environments. The FireBug system combines state-of-the-art sensor hardware running TinyOS with standard, off-the-shelf World Wide Web and database technology for allowing users to rapidly deploy FireBugs and monitor network behavior. ! </font> </p> <br> <br> + + <center> + <img src="images/forestfire_small.jpg"> + </center> + + <br> + <br> <br> *************** *** 42,46 **** <table> <tr> ! <td><img src = "images/nsf_small.gif"></td> <td> <font size = 2> --- 53,61 ---- <table> <tr> ! <td> ! <a href="http://www.nsf.gov"> ! <img src = "images/nsf_small.gif"> ! </a> ! </td> <td> <font size = 2> *************** *** 50,53 **** --- 65,81 ---- </tr> </table> + <table> + <tr> + <td> + <a href="http://www.citris.berkeley.edu/index.html"> + <img src="images/citris_logo_top.gif"> + </a> + </td> + <td> + <font size = 2>The Firebug Project is affiliated with the Center for Information Technology Research in the Interest of Society (<a href="http://www.citris.berkeley.edu/index.html">CITRIS</a>). + </font> + </td> + </tr> + </table> </center> |