[Firebug-cvs] fireboard/beta/tools/src/xlisten/boards sirf_id2_1.c,NONE,1.1 sirf_id2_2.c,NONE,1.1
Brought to you by:
doolin
From: David M. D. <do...@us...> - 2005-07-30 02:14:42
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19931 Added Files: sirf_id2_1.c sirf_id2_2.c Log Message: sirf message 2 autogenerated and compiles. --- NEW FILE: sirf_id2_2.c --- /** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This code implements C interface to the 'SiRF_ID2_2' * message type. */ #include <stdio.h> #include <stdlib.h> #include <memory.h> /** Private header is programmer specified for handling * conversion functions, etc. */ //#include "SiRF_ID2_2_private.h" /** Not the best way to handle xbow dependencies. */ #include "../xdb.h" /** These need to be moved to a header file. */ typedef struct _SiRF_ID2_2 SiRF_ID2_2; typedef struct _XbowSensorboardPacket XbowSensorboardPacket; // This struct is defined to keep gcc happy while the module // is under development. At some point in the near future, a // a convention for passing arguments into the functions will // have to be defined. struct _XbowSensorboardPacket { unsigned char data[29]; }; struct _SiRF_ID2_2 { uint8_t header_seqno; uint8_t header_am_type; uint8_t header_rsrvd1; uint8_t header_rsrvd2; uint32_t gps_tow; uint8_t sv_in_fix; uint8_t ch1; uint8_t ch2; uint8_t ch3; uint8_t ch4; uint8_t ch5; uint8_t ch6; uint8_t ch7; uint8_t ch8; uint8_t ch9; uint8_t ch10; uint8_t ch11; uint8_t ch12; }; void SiRF_ID2_2_set_header_seqno(SiRF_ID2_2 * userdata, uint8_t header_seqno) { userdata->header_seqno = header_seqno; } uint8_t SiRF_ID2_2_get_header_seqno(SiRF_ID2_2 * userdata) { return userdata->header_seqno; } void SiRF_ID2_2_set_header_am_type(SiRF_ID2_2 * userdata, uint8_t header_am_type) { userdata->header_am_type = header_am_type; } uint8_t SiRF_ID2_2_get_header_am_type(SiRF_ID2_2 * userdata) { return userdata->header_am_type; } void SiRF_ID2_2_set_header_rsrvd1(SiRF_ID2_2 * userdata, uint8_t header_rsrvd1) { userdata->header_rsrvd1 = header_rsrvd1; } uint8_t SiRF_ID2_2_get_header_rsrvd1(SiRF_ID2_2 * userdata) { return userdata->header_rsrvd1; } void SiRF_ID2_2_set_header_rsrvd2(SiRF_ID2_2 * userdata, uint8_t header_rsrvd2) { userdata->header_rsrvd2 = header_rsrvd2; } uint8_t SiRF_ID2_2_get_header_rsrvd2(SiRF_ID2_2 * userdata) { return userdata->header_rsrvd2; } void SiRF_ID2_2_set_gps_tow(SiRF_ID2_2 * userdata, uint32_t gps_tow) { userdata->gps_tow = gps_tow; } uint32_t SiRF_ID2_2_get_gps_tow(SiRF_ID2_2 * userdata) { return userdata->gps_tow; } void SiRF_ID2_2_set_sv_in_fix(SiRF_ID2_2 * userdata, uint8_t sv_in_fix) { userdata->sv_in_fix = sv_in_fix; } uint8_t SiRF_ID2_2_get_sv_in_fix(SiRF_ID2_2 * userdata) { return userdata->sv_in_fix; } void SiRF_ID2_2_set_ch1(SiRF_ID2_2 * userdata, uint8_t ch1) { userdata->ch1 = ch1; } uint8_t SiRF_ID2_2_get_ch1(SiRF_ID2_2 * userdata) { return userdata->ch1; } void SiRF_ID2_2_set_ch2(SiRF_ID2_2 * userdata, uint8_t ch2) { userdata->ch2 = ch2; } uint8_t SiRF_ID2_2_get_ch2(SiRF_ID2_2 * userdata) { return userdata->ch2; } void SiRF_ID2_2_set_ch3(SiRF_ID2_2 * userdata, uint8_t ch3) { userdata->ch3 = ch3; } uint8_t SiRF_ID2_2_get_ch3(SiRF_ID2_2 * userdata) { return userdata->ch3; } void SiRF_ID2_2_set_ch4(SiRF_ID2_2 * userdata, uint8_t ch4) { userdata->ch4 = ch4; } uint8_t SiRF_ID2_2_get_ch4(SiRF_ID2_2 * userdata) { return userdata->ch4; } void SiRF_ID2_2_set_ch5(SiRF_ID2_2 * userdata, uint8_t ch5) { userdata->ch5 = ch5; } uint8_t SiRF_ID2_2_get_ch5(SiRF_ID2_2 * userdata) { return userdata->ch5; } void SiRF_ID2_2_set_ch6(SiRF_ID2_2 * userdata, uint8_t ch6) { userdata->ch6 = ch6; } uint8_t SiRF_ID2_2_get_ch6(SiRF_ID2_2 * userdata) { return userdata->ch6; } void SiRF_ID2_2_set_ch7(SiRF_ID2_2 * userdata, uint8_t ch7) { userdata->ch7 = ch7; } uint8_t SiRF_ID2_2_get_ch7(SiRF_ID2_2 * userdata) { return userdata->ch7; } void SiRF_ID2_2_set_ch8(SiRF_ID2_2 * userdata, uint8_t ch8) { userdata->ch8 = ch8; } uint8_t SiRF_ID2_2_get_ch8(SiRF_ID2_2 * userdata) { return userdata->ch8; } void SiRF_ID2_2_set_ch9(SiRF_ID2_2 * userdata, uint8_t ch9) { userdata->ch9 = ch9; } uint8_t SiRF_ID2_2_get_ch9(SiRF_ID2_2 * userdata) { return userdata->ch9; } void SiRF_ID2_2_set_ch10(SiRF_ID2_2 * userdata, uint8_t ch10) { userdata->ch10 = ch10; } uint8_t SiRF_ID2_2_get_ch10(SiRF_ID2_2 * userdata) { return userdata->ch10; } void SiRF_ID2_2_set_ch11(SiRF_ID2_2 * userdata, uint8_t ch11) { userdata->ch11 = ch11; } uint8_t SiRF_ID2_2_get_ch11(SiRF_ID2_2 * userdata) { return userdata->ch11; } void SiRF_ID2_2_set_ch12(SiRF_ID2_2 * userdata, uint8_t ch12) { userdata->ch12 = ch12; } uint8_t SiRF_ID2_2_get_ch12(SiRF_ID2_2 * userdata) { return userdata->ch12; } //Format string generated automatically, //static char formatstring[] = "%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i"; //static char formatstring[] = "%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i"; static char insert_stmt[] = "INSERT into SiRF_ID2_2 (" "header_seqno," "header_am_type," "header_rsrvd1," "header_rsrvd2," "gps_tow," "sv_in_fix," "ch1," "ch2," "ch3," "ch4," "ch5," "ch6," "ch7," "ch8," "ch9," "ch10," "ch11," "ch12) values (%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"; void SiRF_ID2_2_pg_log(XbowSensorboardPacket * userdata) { char pg_command[255]; SiRF_ID2_2 * data = (SiRF_ID2_2*)userdata; sprintf(pg_command,insert_stmt, data->header_seqno, data->header_am_type, data->header_rsrvd1, data->header_rsrvd2, data->gps_tow, data->sv_in_fix, data->ch1, data->ch2, data->ch3, data->ch4, data->ch5, data->ch6, data->ch7, data->ch8, data->ch9, data->ch10, data->ch11, data->ch12); xdb_execute(pg_command); } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t header_seqno_convert(uint8_t header_seqno) { return header_seqno; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t header_am_type_convert(uint8_t header_am_type) { return header_am_type; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t header_rsrvd1_convert(uint8_t header_rsrvd1) { return header_rsrvd1; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t header_rsrvd2_convert(uint8_t header_rsrvd2) { return header_rsrvd2; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint32_t gps_tow_convert(uint32_t gps_tow) { return gps_tow; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t sv_in_fix_convert(uint8_t sv_in_fix) { return sv_in_fix; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t ch1_convert(uint8_t ch1) { return ch1; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t ch2_convert(uint8_t ch2) { return ch2; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t ch3_convert(uint8_t ch3) { return ch3; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t ch4_convert(uint8_t ch4) { return ch4; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t ch5_convert(uint8_t ch5) { return ch5; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t ch6_convert(uint8_t ch6) { return ch6; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t ch7_convert(uint8_t ch7) { return ch7; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t ch8_convert(uint8_t ch8) { return ch8; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t ch9_convert(uint8_t ch9) { return ch9; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t ch10_convert(uint8_t ch10) { return ch10; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t ch11_convert(uint8_t ch11) { return ch11; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t ch12_convert(uint8_t ch12) { return ch12; } void SiRF_ID2_2_cook_packet(SiRF_ID2_2 * userdata) { userdata->header_seqno = header_seqno_convert(userdata->header_seqno); userdata->header_am_type = header_am_type_convert(userdata->header_am_type); userdata->header_rsrvd1 = header_rsrvd1_convert(userdata->header_rsrvd1); userdata->header_rsrvd2 = header_rsrvd2_convert(userdata->header_rsrvd2); userdata->gps_tow = gps_tow_convert(userdata->gps_tow); userdata->sv_in_fix = sv_in_fix_convert(userdata->sv_in_fix); userdata->ch1 = ch1_convert(userdata->ch1); userdata->ch2 = ch2_convert(userdata->ch2); userdata->ch3 = ch3_convert(userdata->ch3); userdata->ch4 = ch4_convert(userdata->ch4); userdata->ch5 = ch5_convert(userdata->ch5); userdata->ch6 = ch6_convert(userdata->ch6); userdata->ch7 = ch7_convert(userdata->ch7); userdata->ch8 = ch8_convert(userdata->ch8); userdata->ch9 = ch9_convert(userdata->ch9); userdata->ch10 = ch10_convert(userdata->ch10); userdata->ch11 = ch11_convert(userdata->ch11); userdata->ch12 = ch12_convert(userdata->ch12); } /** User has to fill in any conversion code * necessary for processing. */ SiRF_ID2_2 * SiRF_ID2_2_convert(char * data) { // Just to keep gcc happy. return (SiRF_ID2_2*)data; } /** Print the bytes of the packet. */ void SiRF_ID2_2_print_raw (XbowSensorboardPacket *packet) { } /** Print cooked output. */ void SiRF_ID2_2_print_cooked (XbowSensorboardPacket * userdata) { SiRF_ID2_2 * data = (SiRF_ID2_2*)userdata; printf("header_seqno: %i,\n",data->header_seqno); printf("header_am_type: %i,\n",data->header_am_type); printf("header_rsrvd1: %i,\n",data->header_rsrvd1); printf("header_rsrvd2: %i,\n",data->header_rsrvd2); printf("gps_tow: %i,\n",data->gps_tow); printf("sv_in_fix: %i,\n",data->sv_in_fix); printf("ch1: %i,\n",data->ch1); printf("ch2: %i,\n",data->ch2); printf("ch3: %i,\n",data->ch3); printf("ch4: %i,\n",data->ch4); printf("ch5: %i,\n",data->ch5); printf("ch6: %i,\n",data->ch6); printf("ch7: %i,\n",data->ch7); printf("ch8: %i,\n",data->ch8); printf("ch9: %i,\n",data->ch9); printf("ch10: %i,\n",data->ch10); printf("ch11: %i,\n",data->ch11); printf("ch12: %i,\n",data->ch12); } /** The default size of this message type in bytes. */ //static int DEFAULT_MESSAGE_SIZE = 21; /** The Active Message type associated with this message. */ //static int AM_TYPE = 151; /** If incomplete types are used, we need to provide a way * to manage memory. */ SiRF_ID2_2 * SiRF_ID2_2_new() { SiRF_ID2_2 * userdata = (SiRF_ID2_2*)malloc(sizeof(SiRF_ID2_2)); memset((void*)userdata,0xda,sizeof(SiRF_ID2_2)); return userdata; } void SiRF_ID2_2_delete(SiRF_ID2_2 * userdata) { memset((void*)userdata,0xdd,sizeof(SiRF_ID2_2)); free(userdata); } --- NEW FILE: sirf_id2_1.c --- /** * This class is automatically generated by mig. DO NOT EDIT THIS FILE. * This code implements C interface to the 'SiRF_ID2_1' * message type. */ #include <stdio.h> #include <stdlib.h> #include <memory.h> /** Private header is programmer specified for handling * conversion functions, etc. */ //#include "SiRF_ID2_1_private.h" /** Not the best way to handle xbow dependencies. */ #include "../xdb.h" /** These need to be moved to a header file. */ typedef struct _SiRF_ID2_1 SiRF_ID2_1; typedef struct _XbowSensorboardPacket XbowSensorboardPacket; // This struct is defined to keep gcc happy while the module // is under development. At some point in the near future, a // a convention for passing arguments into the functions will // have to be defined. struct _XbowSensorboardPacket { unsigned char data[29]; }; struct _SiRF_ID2_1 { uint8_t header_seqno; uint8_t header_am_type; uint8_t header_rsrvd1; uint8_t header_rsrvd2; int xpos; int ypos; int zpos; uint16_t xvel; uint16_t yvel; uint16_t zvel; uint8_t mode1; uint8_t dop; uint8_t mode2; uint16_t gps_week; }; void SiRF_ID2_1_set_header_seqno(SiRF_ID2_1 * userdata, uint8_t header_seqno) { userdata->header_seqno = header_seqno; } uint8_t SiRF_ID2_1_get_header_seqno(SiRF_ID2_1 * userdata) { return userdata->header_seqno; } void SiRF_ID2_1_set_header_am_type(SiRF_ID2_1 * userdata, uint8_t header_am_type) { userdata->header_am_type = header_am_type; } uint8_t SiRF_ID2_1_get_header_am_type(SiRF_ID2_1 * userdata) { return userdata->header_am_type; } void SiRF_ID2_1_set_header_rsrvd1(SiRF_ID2_1 * userdata, uint8_t header_rsrvd1) { userdata->header_rsrvd1 = header_rsrvd1; } uint8_t SiRF_ID2_1_get_header_rsrvd1(SiRF_ID2_1 * userdata) { return userdata->header_rsrvd1; } void SiRF_ID2_1_set_header_rsrvd2(SiRF_ID2_1 * userdata, uint8_t header_rsrvd2) { userdata->header_rsrvd2 = header_rsrvd2; } uint8_t SiRF_ID2_1_get_header_rsrvd2(SiRF_ID2_1 * userdata) { return userdata->header_rsrvd2; } void SiRF_ID2_1_set_xpos(SiRF_ID2_1 * userdata, int xpos) { userdata->xpos = xpos; } int SiRF_ID2_1_get_xpos(SiRF_ID2_1 * userdata) { return userdata->xpos; } void SiRF_ID2_1_set_ypos(SiRF_ID2_1 * userdata, int ypos) { userdata->ypos = ypos; } int SiRF_ID2_1_get_ypos(SiRF_ID2_1 * userdata) { return userdata->ypos; } void SiRF_ID2_1_set_zpos(SiRF_ID2_1 * userdata, int zpos) { userdata->zpos = zpos; } int SiRF_ID2_1_get_zpos(SiRF_ID2_1 * userdata) { return userdata->zpos; } void SiRF_ID2_1_set_xvel(SiRF_ID2_1 * userdata, uint16_t xvel) { userdata->xvel = xvel; } uint16_t SiRF_ID2_1_get_xvel(SiRF_ID2_1 * userdata) { return userdata->xvel; } void SiRF_ID2_1_set_yvel(SiRF_ID2_1 * userdata, uint16_t yvel) { userdata->yvel = yvel; } uint16_t SiRF_ID2_1_get_yvel(SiRF_ID2_1 * userdata) { return userdata->yvel; } void SiRF_ID2_1_set_zvel(SiRF_ID2_1 * userdata, uint16_t zvel) { userdata->zvel = zvel; } uint16_t SiRF_ID2_1_get_zvel(SiRF_ID2_1 * userdata) { return userdata->zvel; } void SiRF_ID2_1_set_mode1(SiRF_ID2_1 * userdata, uint8_t mode1) { userdata->mode1 = mode1; } uint8_t SiRF_ID2_1_get_mode1(SiRF_ID2_1 * userdata) { return userdata->mode1; } void SiRF_ID2_1_set_dop(SiRF_ID2_1 * userdata, uint8_t dop) { userdata->dop = dop; } uint8_t SiRF_ID2_1_get_dop(SiRF_ID2_1 * userdata) { return userdata->dop; } void SiRF_ID2_1_set_mode2(SiRF_ID2_1 * userdata, uint8_t mode2) { userdata->mode2 = mode2; } uint8_t SiRF_ID2_1_get_mode2(SiRF_ID2_1 * userdata) { return userdata->mode2; } void SiRF_ID2_1_set_gps_week(SiRF_ID2_1 * userdata, uint16_t gps_week) { userdata->gps_week = gps_week; } uint16_t SiRF_ID2_1_get_gps_week(SiRF_ID2_1 * userdata) { return userdata->gps_week; } //Format string generated automatically, //static char formatstring[] = "%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i"; //static char formatstring[] = "%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i"; static char insert_stmt[] = "INSERT into SiRF_ID2_1 (" "header_seqno," "header_am_type," "header_rsrvd1," "header_rsrvd2," "xpos," "ypos," "zpos," "xvel," "yvel," "zvel," "mode1," "dop," "mode2," "gps_week) values (%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"; void SiRF_ID2_1_pg_log(XbowSensorboardPacket * userdata) { char pg_command[255]; SiRF_ID2_1 * data = (SiRF_ID2_1*)userdata; sprintf(pg_command,insert_stmt, data->header_seqno, data->header_am_type, data->header_rsrvd1, data->header_rsrvd2, data->xpos, data->ypos, data->zpos, data->xvel, data->yvel, data->zvel, data->mode1, data->dop, data->mode2, data->gps_week); xdb_execute(pg_command); } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t header_seqno_convert(uint8_t header_seqno) { return header_seqno; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t header_am_type_convert(uint8_t header_am_type) { return header_am_type; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t header_rsrvd1_convert(uint8_t header_rsrvd1) { return header_rsrvd1; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t header_rsrvd2_convert(uint8_t header_rsrvd2) { return header_rsrvd2; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static int xpos_convert(int xpos) { return xpos; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static int ypos_convert(int ypos) { return ypos; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static int zpos_convert(int zpos) { return zpos; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint16_t xvel_convert(uint16_t xvel) { return xvel; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint16_t yvel_convert(uint16_t yvel) { return yvel; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint16_t zvel_convert(uint16_t zvel) { return zvel; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t mode1_convert(uint8_t mode1) { return mode1; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t dop_convert(uint8_t dop) { return dop; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint8_t mode2_convert(uint8_t mode2) { return mode2; } /** @brief Default behavior is to return the input as output. * User is responsible for "cooking" the data. */ static uint16_t gps_week_convert(uint16_t gps_week) { return gps_week; } void SiRF_ID2_1_cook_packet(SiRF_ID2_1 * userdata) { userdata->header_seqno = header_seqno_convert(userdata->header_seqno); userdata->header_am_type = header_am_type_convert(userdata->header_am_type); userdata->header_rsrvd1 = header_rsrvd1_convert(userdata->header_rsrvd1); userdata->header_rsrvd2 = header_rsrvd2_convert(userdata->header_rsrvd2); userdata->xpos = xpos_convert(userdata->xpos); userdata->ypos = ypos_convert(userdata->ypos); userdata->zpos = zpos_convert(userdata->zpos); userdata->xvel = xvel_convert(userdata->xvel); userdata->yvel = yvel_convert(userdata->yvel); userdata->zvel = zvel_convert(userdata->zvel); userdata->mode1 = mode1_convert(userdata->mode1); userdata->dop = dop_convert(userdata->dop); userdata->mode2 = mode2_convert(userdata->mode2); userdata->gps_week = gps_week_convert(userdata->gps_week); } /** User has to fill in any conversion code * necessary for processing. */ SiRF_ID2_1 * SiRF_ID2_1_convert(char * data) { // Just to keep gcc happy. return (SiRF_ID2_1*)data; } /** Print the bytes of the packet. */ void SiRF_ID2_1_print_raw (XbowSensorboardPacket *packet) { } /** Print cooked output. */ void SiRF_ID2_1_print_cooked (XbowSensorboardPacket * userdata) { SiRF_ID2_1 * data = (SiRF_ID2_1*)userdata; printf("header_seqno: %i,\n",data->header_seqno); printf("header_am_type: %i,\n",data->header_am_type); printf("header_rsrvd1: %i,\n",data->header_rsrvd1); printf("header_rsrvd2: %i,\n",data->header_rsrvd2); printf("xpos: %i,\n",data->xpos); printf("ypos: %i,\n",data->ypos); printf("zpos: %i,\n",data->zpos); printf("xvel: %i,\n",data->xvel); printf("yvel: %i,\n",data->yvel); printf("zvel: %i,\n",data->zvel); printf("mode1: %i,\n",data->mode1); printf("dop: %i,\n",data->dop); printf("mode2: %i,\n",data->mode2); printf("gps_week: %i,\n",data->gps_week); } /** The default size of this message type in bytes. */ //static int DEFAULT_MESSAGE_SIZE = 27; /** The Active Message type associated with this message. */ //static int AM_TYPE = 150; /** If incomplete types are used, we need to provide a way * to manage memory. */ SiRF_ID2_1 * SiRF_ID2_1_new() { SiRF_ID2_1 * userdata = (SiRF_ID2_1*)malloc(sizeof(SiRF_ID2_1)); memset((void*)userdata,0xda,sizeof(SiRF_ID2_1)); return userdata; } void SiRF_ID2_1_delete(SiRF_ID2_1 * userdata) { memset((void*)userdata,0xdd,sizeof(SiRF_ID2_1)); free(userdata); } |