[Firebug-cvs] fireboard/beta/tools/src/xlisten Makefile, 1.16, 1.17 genc.pm, 1.8, 1.9 xpacket.c, 1.
Brought to you by:
doolin
From: David M. D. <do...@us...> - 2006-07-10 18:19:30
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv12054 Modified Files: Makefile genc.pm xpacket.c xsensors.h Log Message: . Index: xpacket.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/xpacket.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** xpacket.c 8 Aug 2005 22:26:39 -0000 1.10 --- xpacket.c 10 Jul 2006 18:19:28 -0000 1.11 *************** *** 14,20 **** #include "xpacket.h" ! #define AM_SURGEMSG 17 ! #define AM_LINKESTIMATORMSG 20 ! #define AM_PINGMSG 21 static unsigned g_datastart = XPACKET_DATASTART; --- 14,18 ---- #include "xpacket.h" ! #include "ucb/ucb.h" static unsigned g_datastart = XPACKET_DATASTART; *************** *** 45,50 **** mts310_initialize(); /* From boards/mts300.c */ - fireboard_initialize(); - mts400_initialize(); /* From boards/mts400.c */ //mts420_initialize(); /* From boards/mts400.c */ --- 43,46 ---- *************** *** 60,66 **** xtutorial_initialize(); /* From boards/xtutorial.c */ ! LinkMsgP_initialize(); ! SurgeMsgP_initialize(); ! LinkEstimatorMsgP_initialize(); } --- 56,60 ---- xtutorial_initialize(); /* From boards/xtutorial.c */ ! ucb_initialize(); } *************** *** 114,118 **** if (len < 2) return; - //printf("Mode is %d\n", mode); switch (mode) { case 0: --- 108,111 ---- *************** *** 167,193 **** break; - /* - case AMTYPE_FIREWORKS: - datastart = XPACKET_DATASTART_FIREWORKS; - //fprintf(stderr,"fireworks datastart: %d\n", datastart); - break; - - case XTYPE_TESTLINK: - datastart = XPACKET_DATASTART_FIREWORKS; - //fprintf(stderr,"fireworks datastart: %d\n", datastart); - break; - */ - - case AM_LINKMSG: - datastart = XPACKET_DATASTART_FIREWORKS; - //fprintf(stderr,"fireworks datastart: %d\n", datastart); - break; - - case AM_LINKESTIMATORMSG: - datastart = XPACKET_DATASTART_LINKEST; - //fprintf(stderr,"fireworks datastart: %d\n", datastart); - break; - default: return NULL; } --- 160,165 ---- break; default: + // Handle firebug AM_TYPES here? return NULL; } *************** *** 299,303 **** { int i = 256, entry; - while (--i >= 0) { entry = table + i; --- 271,274 ---- *************** *** 306,319 **** return g_packetTable[entry]; } - return NULL; } ! XPacketHandler * ! xpacket_get_handler(char *tos_packet) { unsigned char am_type = tos_packet[XPACKET_TYPE]; - //fprintf("xpacket_get_handler am_type: %d\n", am_type); switch (am_type) { case AMTYPE_XMULTIHOP: --- 277,288 ---- return g_packetTable[entry]; } return NULL; } ! XPacketHandler *xpacket_get_handler(char *tos_packet) ! { unsigned char am_type = tos_packet[XPACKET_TYPE]; switch (am_type) { case AMTYPE_XMULTIHOP: *************** *** 332,380 **** } - /* - case AMTYPE_FIREWORKS: { - XbowSensorboardPacket *packet; - packet = xpacket_get_sensor_data(tos_packet); - //fprintf(stderr, "xpacket_get_handler fireworks\n"); - if (xpacket_print_common(packet)) { - fprintf(stderr, - "xpacket_get_handler error1: no packet handler for board id 0x%02x\n", - packet->board_id); - return NULL; - } - return xsensor_get_handler(am_type, XPACKET_BOARD_TABLE); - } - - - case XTYPE_TESTLINK: { - XbowSensorboardPacket *packet; - packet = xpacket_get_sensor_data(tos_packet); - //fprintf(stderr, "xpacket_get_handler fireworks\n"); - if (xpacket_print_common(packet)) { - fprintf(stderr, - "xpacket_get_handler error1: no packet handler for board id 0x%02x\n", - packet->board_id); - return NULL; - } - return xsensor_get_handler(am_type, XPACKET_BOARD_TABLE); - } - */ - case AM_LINKMSG: - case AM_LINKESTIMATORMSG: { - - XbowSensorboardPacket *packet; - packet = xpacket_get_sensor_data(tos_packet); - //fprintf(stderr, "xpacket_get_handler fireworks\n"); - if (xpacket_print_common(packet)) { - fprintf(stderr, - "xpacket_get_handler error1: no packet handler for board id 0x%02x\n", - packet->board_id); - return NULL; - } - return xsensor_get_handler(am_type, XPACKET_BOARD_TABLE); - } - - - case AMTYPE_HEALTH: case AMTYPE_SURGE_MSG: --- 301,304 ---- *************** *** 382,385 **** --- 306,311 ---- default: + //Handle firebug AM_TYPES here. + return (XPacketHandler*)fb_get_packet_handler(am_type); break; } *************** *** 390,394 **** } - /** * Display a parsed packet as raw ADC values for each sensor on the board. --- 316,319 ---- *************** *** 541,544 **** --- 466,470 ---- ); + packet = (uint8_t *)mhop; // i=2 --> skip board_id/packet_id, node/parent for (i=0; i<tosmsg->length; i++) { // include CRC *************** *** 546,551 **** printf(","); } ! uint16_t crc = *(uint16_t *)((char *)mhop + tosmsg->length); ! printf(" %u\n",crc); } --- 472,477 ---- printf(","); } ! // uint16_t crc = *(uint16_t *)((char *)mhop + tosmsg->length); ! // printf(" %u\n",crc); } Index: xsensors.h =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/xsensors.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** xsensors.h 9 Aug 2005 00:39:50 -0000 1.11 --- xsensors.h 10 Jul 2006 18:19:28 -0000 1.12 *************** *** 129,134 **** #define XPACKET_DATASTART_MULTIHOP 12 //!< Multihop offset to data payload #define XPACKET_DATASTART 12 //!< Default offset to data payload ! #define XPACKET_DATASTART_FIREWORKS 10 //!< Offset to Fireworks data ! #define XPACKET_DATASTART_LINKEST 18 //!< Offset to Fireworks data #define XPACKET_BOARD_TABLE 0 //!< offset to XSensor board table --- 129,134 ---- #define XPACKET_DATASTART_MULTIHOP 12 //!< Multihop offset to data payload #define XPACKET_DATASTART 12 //!< Default offset to data payload ! //#define XPACKET_DATASTART_FIREWORKS 10 //!< Offset to Fireworks data ! //#define XPACKET_DATASTART_LINKEST 18 //!< Offset to Fireworks data #define XPACKET_BOARD_TABLE 0 //!< offset to XSensor board table *************** *** 233,237 **** void xtutorial_initialize(); /* From baords/xtutorial.c */ ! void LinkMsgP_initialize(); #endif /* __SENSORS_H__ */ --- 233,237 ---- void xtutorial_initialize(); /* From baords/xtutorial.c */ ! void ucb_initialize(); #endif /* __SENSORS_H__ */ Index: Makefile =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/Makefile,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Makefile 8 Aug 2005 20:37:37 -0000 1.16 --- Makefile 10 Jul 2006 18:19:28 -0000 1.17 *************** *** 21,25 **** SRCS += boards/sirf_id28_1.c boards/sirf_id28_2.c boards/sirf_id28_3.c SRCS += boards/LinkEstimatorMsg.c ! SRCS += boards/SurgeMsg.c INCLUDES = -I../../../tos/sensorboards/mts400/GPS --- 21,27 ---- SRCS += boards/sirf_id28_1.c boards/sirf_id28_2.c boards/sirf_id28_3.c SRCS += boards/LinkEstimatorMsg.c ! SRCS += boards/SurgeMsg.c ! ! SRCS += ucb/ucb.c INCLUDES = -I../../../tos/sensorboards/mts400/GPS *************** *** 57,59 **** clean: ! rm -f *.o boards/*.o xlisten xlisten-arm xlisten.exe fbpacket.exe xlisten-telos.exe --- 59,61 ---- clean: ! rm -f *.o boards/*.o xlisten xlisten-arm xlisten.exe fbpacket.exe xlisten-telos.exe *~ *.bak |