Update of /cvsroot/playerstage/code/player/client_libs/libplayerc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24782/client_libs/libplayerc Modified Files: Makefile.am client.c dev_actarray.c dev_audio.c dev_camera.c dev_fiducial.c dev_gps.c dev_health.c dev_imu.c dev_laser.c dev_limb.c dev_motor.c dev_opaque.c dev_pointcloud3d.c dev_position1d.c dev_position2d.c dev_position3d.c dev_rfid.c dev_wsn.c playerc.h Log Message: applied patches 1671417, 1660887, 1660260 Index: dev_position1d.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_position1d.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dev_position1d.c 19 May 2006 09:51:36 -0000 1.3 --- dev_position1d.c 14 Mar 2007 16:41:51 -0000 1.4 *************** *** 111,116 **** } else ! PLAYERC_WARN2("skipping position1d message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 111,116 ---- } else ! PLAYERC_WARN2("skipping position1d message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } Index: dev_camera.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_camera.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** dev_camera.c 20 Nov 2006 12:36:05 -0000 1.13 --- dev_camera.c 14 Mar 2007 16:41:51 -0000 1.14 *************** *** 121,126 **** } else ! PLAYERC_WARN2("skipping camera message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); return; } --- 121,126 ---- } else ! PLAYERC_WARN2("skipping camera message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); return; } *************** *** 236,245 **** // Get the modulation frequency ! int playerc_camera_get_modulationfreq(playerc_camera_t *device, int *value) { player_camera_modulation_freq_config_t config; memset(&config, 0, sizeof(config)); ! if (playerc_client_request(device->info.client, &device->info, PLAYER_CAMERA_REQ_GET_MODULATION_FREQ, &config, &config, sizeof(config)) < 0) --- 236,245 ---- // Get the modulation frequency ! int playerc_camera_get_modulationfreq(playerc_camera_t *device, int *value) { player_camera_modulation_freq_config_t config; memset(&config, 0, sizeof(config)); ! if (playerc_client_request(device->info.client, &device->info, PLAYER_CAMERA_REQ_GET_MODULATION_FREQ, &config, &config, sizeof(config)) < 0) *************** *** 264,273 **** // Get the integration time ! int playerc_camera_get_integrationtime(playerc_camera_t *device, int *value) { player_camera_integration_time_config_t config; memset(&config, 0, sizeof(config)); ! if (playerc_client_request(device->info.client, &device->info, PLAYER_CAMERA_REQ_GET_INTEGRATION_TIME, &config, &config, sizeof(config)) < 0) --- 264,273 ---- // Get the integration time ! int playerc_camera_get_integrationtime(playerc_camera_t *device, int *value) { player_camera_integration_time_config_t config; memset(&config, 0, sizeof(config)); ! if (playerc_client_request(device->info.client, &device->info, PLAYER_CAMERA_REQ_GET_INTEGRATION_TIME, &config, &config, sizeof(config)) < 0) Index: dev_motor.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_motor.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dev_motor.c 4 Nov 2005 17:57:07 -0000 1.4 --- dev_motor.c 14 Mar 2007 16:41:51 -0000 1.5 *************** *** 112,117 **** } else ! PLAYERC_WARN2("skipping motor message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 112,117 ---- } else ! PLAYERC_WARN2("skipping motor message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } Index: dev_laser.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_laser.c,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** dev_laser.c 13 Feb 2007 21:58:29 -0000 1.40 --- dev_laser.c 14 Mar 2007 16:41:51 -0000 1.41 *************** *** 1,3 **** ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 --- 1,3 ---- ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 *************** *** 21,25 **** * Player - One Hell of a Robot Server * Copyright (C) Andrew Howard 2003 ! * * * This library is free software; you can redistribute it and/or --- 21,25 ---- * Player - One Hell of a Robot Server * Copyright (C) Andrew Howard 2003 ! * * * This library is free software; you can redistribute it and/or *************** *** 56,60 **** // Process incoming data ! void playerc_laser_putmsg(playerc_laser_t *device, player_msghdr_t *header, void *data); --- 56,60 ---- // Process incoming data ! void playerc_laser_putmsg(playerc_laser_t *device, player_msghdr_t *header, void *data); *************** *** 106,110 **** // Process incoming data ! void playerc_laser_putmsg(playerc_laser_t *device, player_msghdr_t *header, void *data) --- 106,110 ---- // Process incoming data ! void playerc_laser_putmsg(playerc_laser_t *device, player_msghdr_t *header, void *data) *************** *** 145,149 **** (header->subtype == PLAYER_LASER_DATA_SCANPOSE)) { ! player_laser_data_scanpose_t* scan_data = (player_laser_data_scanpose_t*)data; assert(scan_data->scan.ranges_count <= sizeof(device->scan) / sizeof(device->scan[0])); --- 145,149 ---- (header->subtype == PLAYER_LASER_DATA_SCANPOSE)) { ! player_laser_data_scanpose_t* scan_data = (player_laser_data_scanpose_t*)data; assert(scan_data->scan.ranges_count <= sizeof(device->scan) / sizeof(device->scan[0])); *************** *** 175,180 **** } else ! PLAYERC_WARN2("skipping laser message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 175,180 ---- } else ! PLAYERC_WARN2("skipping laser message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } *************** *** 182,190 **** // Configure the laser. int ! playerc_laser_set_config(playerc_laser_t *device, ! double min_angle, double max_angle, ! double resolution, ! double range_res, unsigned char intensity, double scanning_frequency) --- 182,190 ---- // Configure the laser. int ! playerc_laser_set_config(playerc_laser_t *device, ! double min_angle, double max_angle, ! double resolution, ! double range_res, unsigned char intensity, double scanning_frequency) *************** *** 216,224 **** // Get the laser configuration. int ! playerc_laser_get_config(playerc_laser_t *device, ! double *min_angle, double *max_angle, ! double *resolution, ! double *range_res, unsigned char *intensity, double *scanning_frequency) --- 216,224 ---- // Get the laser configuration. int ! playerc_laser_get_config(playerc_laser_t *device, ! double *min_angle, double *max_angle, ! double *resolution, ! double *range_res, unsigned char *intensity, double *scanning_frequency) *************** *** 250,254 **** player_laser_geom_t config; ! if(playerc_client_request(device->info.client, &device->info,PLAYER_LASER_REQ_GET_GEOM, NULL, &config, sizeof(config)) < 0) --- 250,254 ---- player_laser_geom_t config; ! if(playerc_client_request(device->info.client, &device->info,PLAYER_LASER_REQ_GET_GEOM, NULL, &config, sizeof(config)) < 0) *************** *** 260,268 **** device->size[0] = config.size.sl; device->size[1] = config.size.sw; ! return 0; } ! // Get the laser IDentification information. The writes the result into // the proxy rather than returning it to the caller. int --- 260,268 ---- device->size[0] = config.size.sl; device->size[1] = config.size.sw; ! return 0; } ! // Get the laser IDentification information. The writes the result into // the proxy rather than returning it to the caller. int *************** *** 271,275 **** player_laser_get_id_config_t config; ! if (playerc_client_request(device->info.client, &device->info,PLAYER_LASER_REQ_GET_ID, NULL, &config, sizeof(config)) < 0) --- 271,275 ---- player_laser_get_id_config_t config; ! if (playerc_client_request(device->info.client, &device->info,PLAYER_LASER_REQ_GET_ID, NULL, &config, sizeof(config)) < 0) *************** *** 277,295 **** device->laser_id = config.serial_number; ! return 0; } ! void playerc_laser_printout( playerc_laser_t * device, const char* prefix ) { if( prefix ) printf( "%s: ", prefix ); ! printf("[%14.3f] scan_id: %d scan_count: %d\n", device->info.datatime, ! device->scan_id, device->scan_count ); ! printf( "# ranges\n" ); int i; --- 277,295 ---- device->laser_id = config.serial_number; ! return 0; } ! void playerc_laser_printout( playerc_laser_t * device, const char* prefix ) { if( prefix ) printf( "%s: ", prefix ); ! printf("[%14.3f] scan_id: %d scan_count: %d\n", device->info.datatime, ! device->scan_id, device->scan_count ); ! printf( "# ranges\n" ); int i; Index: dev_rfid.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_rfid.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dev_rfid.c 11 Apr 2006 15:40:31 -0000 1.2 --- dev_rfid.c 14 Mar 2007 16:41:51 -0000 1.3 *************** *** 1,3 **** ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 --- 1,3 ---- ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 *************** *** 35,39 **** // Process incoming data ! void playerc_rfid_putmsg (playerc_rfid_t *device, player_msghdr_t *header, void *data); --- 35,39 ---- // Process incoming data ! void playerc_rfid_putmsg (playerc_rfid_t *device, player_msghdr_t *header, void *data); *************** *** 74,83 **** // Process incoming data ! void playerc_rfid_putmsg (playerc_rfid_t *device, player_msghdr_t *header, void *data) { int i, j; ! if((header->type == PLAYER_MSGTYPE_DATA) && (header->subtype == PLAYER_RFID_DATA)) --- 74,83 ---- // Process incoming data ! void playerc_rfid_putmsg (playerc_rfid_t *device, player_msghdr_t *header, void *data) { int i, j; ! if((header->type == PLAYER_MSGTYPE_DATA) && (header->subtype == PLAYER_RFID_DATA)) *************** *** 95,100 **** } else ! PLAYERC_WARN2("skipping rfid message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 95,100 ---- } else ! PLAYERC_WARN2("skipping rfid message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } Index: dev_gps.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_gps.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** dev_gps.c 14 Apr 2006 17:55:49 -0000 1.15 --- dev_gps.c 14 Mar 2007 16:41:51 -0000 1.16 *************** *** 1,3 **** ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 --- 1,3 ---- ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 *************** *** 21,25 **** * Player - One Hell of a Robot Server * Copyright (C) Andrew Howard 2003 ! * * * This library is free software; you can redistribute it and/or --- 21,25 ---- * Player - One Hell of a Robot Server * Copyright (C) Andrew Howard 2003 ! * * * This library is free software; you can redistribute it and/or *************** *** 69,73 **** playerc_device_init(&device->info, client, PLAYER_GPS_CODE, index, (playerc_putmsg_fn_t) playerc_gps_putmsg); ! return device; } --- 69,73 ---- playerc_device_init(&device->info, client, PLAYER_GPS_CODE, index, (playerc_putmsg_fn_t) playerc_gps_putmsg); ! return device; } *************** *** 124,129 **** } else ! PLAYERC_WARN2("skipping gps message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); return; } --- 124,129 ---- } else ! PLAYERC_WARN2("skipping gps message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); return; } Index: dev_wsn.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_wsn.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dev_wsn.c 12 May 2006 22:59:59 -0000 1.2 --- dev_wsn.c 14 Mar 2007 16:41:51 -0000 1.3 *************** *** 1,3 **** ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 --- 1,3 ---- ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 *************** *** 35,39 **** // Process incoming data ! void playerc_wsn_putmsg (playerc_wsn_t *device, player_msghdr_t *header, void *data); --- 35,39 ---- // Process incoming data ! void playerc_wsn_putmsg (playerc_wsn_t *device, player_msghdr_t *header, void *data); *************** *** 74,83 **** // Process incoming data ! void playerc_wsn_putmsg (playerc_wsn_t *device, player_msghdr_t *header, void *data) { // int i, j; ! if((header->type == PLAYER_MSGTYPE_DATA) && (header->subtype == PLAYER_WSN_DATA)) --- 74,83 ---- // Process incoming data ! void playerc_wsn_putmsg (playerc_wsn_t *device, player_msghdr_t *header, void *data) { // int i, j; ! if((header->type == PLAYER_MSGTYPE_DATA) && (header->subtype == PLAYER_WSN_DATA)) *************** *** 90,95 **** } else ! PLAYERC_WARN2("skipping wsn message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 90,95 ---- } else ! PLAYERC_WARN2("skipping wsn message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } *************** *** 144,148 **** // Change data delivery frequency. int ! playerc_wsn_datafreq(playerc_wsn_t *device, int node_id, int group_id, double frequency) { --- 144,148 ---- // Change data delivery frequency. int ! playerc_wsn_datafreq(playerc_wsn_t *device, int node_id, int group_id, double frequency) { Index: dev_position3d.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_position3d.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** dev_position3d.c 22 May 2006 15:01:11 -0000 1.12 --- dev_position3d.c 14 Mar 2007 16:41:51 -0000 1.13 *************** *** 132,137 **** } else ! PLAYERC_WARN2("skipping position3d message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 132,137 ---- } else ! PLAYERC_WARN2("skipping position3d message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } *************** *** 333,345 **** { player_position3d_reset_odom_config_t config; ! memset(&config, 0, sizeof(config)); ! ! ! return playerc_client_request(device->info.client, ! &device->info, ! PLAYER_POSITION3D_RESET_ODOM, ! &config, &config, sizeof(config)); --- 333,345 ---- { player_position3d_reset_odom_config_t config; ! memset(&config, 0, sizeof(config)); ! ! ! return playerc_client_request(device->info.client, ! &device->info, ! PLAYER_POSITION3D_RESET_ODOM, ! &config, &config, sizeof(config)); Index: dev_fiducial.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_fiducial.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** dev_fiducial.c 6 Oct 2005 08:56:17 -0000 1.14 --- dev_fiducial.c 14 Mar 2007 16:41:51 -0000 1.15 *************** *** 1,3 **** ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 --- 1,3 ---- ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 *************** *** 36,41 **** ! // Process incoming data ! void playerc_fiducial_putmsg(playerc_fiducial_t *device, player_msghdr_t *header, void *data); --- 36,41 ---- ! // Process incoming data ! void playerc_fiducial_putmsg(playerc_fiducial_t *device, player_msghdr_t *header, void *data); *************** *** 50,59 **** playerc_device_init(&device->info, client, PLAYER_FIDUCIAL_CODE, index, (playerc_putmsg_fn_t) playerc_fiducial_putmsg ); ! memset( &device->fiducial_geom, 0, sizeof(device->fiducial_geom)); // default size of detected fiducials device->fiducial_geom.size.sl = 0.1; device->fiducial_geom.size.sw = 0.01; ! return device; } --- 50,59 ---- playerc_device_init(&device->info, client, PLAYER_FIDUCIAL_CODE, index, (playerc_putmsg_fn_t) playerc_fiducial_putmsg ); ! memset( &device->fiducial_geom, 0, sizeof(device->fiducial_geom)); // default size of detected fiducials device->fiducial_geom.size.sl = 0.1; device->fiducial_geom.size.sw = 0.01; ! return device; } *************** *** 83,91 **** // Process incoming data ! void playerc_fiducial_putmsg(playerc_fiducial_t *device, player_msghdr_t *header, void* generic ) { ! if( header->type == PLAYER_MSGTYPE_DATA && header->subtype == PLAYER_FIDUCIAL_DATA_SCAN ) --- 83,91 ---- // Process incoming data ! void playerc_fiducial_putmsg(playerc_fiducial_t *device, player_msghdr_t *header, void* generic ) { ! if( header->type == PLAYER_MSGTYPE_DATA && header->subtype == PLAYER_FIDUCIAL_DATA_SCAN ) *************** *** 94,103 **** device->fiducials_count = data->fiducials_count; ! int i; for (i = 0; i < device->fiducials_count; i++) { player_fiducial_item_t *fiducial = data->fiducials + i; ! device->fiducials[i] = *fiducial; --- 94,103 ---- device->fiducials_count = data->fiducials_count; ! int i; for (i = 0; i < device->fiducials_count; i++) { player_fiducial_item_t *fiducial = data->fiducials + i; ! device->fiducials[i] = *fiducial; *************** *** 116,120 **** device->fiducials[i].urot[1] = fiducial->urot[1]; device->fiducials[i].urot[2] = fiducial->urot[2]; ! // get the polar coordinates too. handy! device->fiducials[i].range = sqrt(device->fiducials[i].pos[0] * device->fiducials[i].pos[0] + --- 116,120 ---- device->fiducials[i].urot[1] = fiducial->urot[1]; device->fiducials[i].urot[2] = fiducial->urot[2]; ! // get the polar coordinates too. handy! device->fiducials[i].range = sqrt(device->fiducials[i].pos[0] * device->fiducials[i].pos[0] + *************** *** 124,131 **** } } ! else ! PLAYERC_WARN2("skipping fiducial message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 124,131 ---- } } ! else ! PLAYERC_WARN2("skipping fiducial message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } *************** *** 136,140 **** { PLAYERC_WARN( "playerc_fiducial_putgeom is not yet implemented" ); ! /* if (len != sizeof(player_fiducial_geom_t)) */ /* { */ --- 136,140 ---- { PLAYERC_WARN( "playerc_fiducial_putgeom is not yet implemented" ); ! /* if (len != sizeof(player_fiducial_geom_t)) */ /* { */ *************** *** 161,165 **** // config.subtype = PLAYER_FIDUCIAL_GET_GEOM; ! len = playerc_client_request(device->info.client, &device->info, PLAYER_FIDUCIAL_REQ_GET_GEOM, --- 161,165 ---- // config.subtype = PLAYER_FIDUCIAL_GET_GEOM; ! len = playerc_client_request(device->info.client, &device->info, PLAYER_FIDUCIAL_REQ_GET_GEOM, *************** *** 167,171 **** if (len < 0) return -1; ! // ? //while(device->info.freshgeom == 0) --- 167,171 ---- if (len < 0) return -1; ! // ? //while(device->info.freshgeom == 0) *************** *** 181,185 **** device->fiducial_size[0] = config.fiducial_size.sl; device->fiducial_size[1] = config.fiducial_size.sw;*/ ! return 0; } --- 181,185 ---- device->fiducial_size[0] = config.fiducial_size.sl; device->fiducial_size[1] = config.fiducial_size.sw;*/ ! return 0; } Index: dev_pointcloud3d.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_pointcloud3d.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dev_pointcloud3d.c 6 Sep 2006 16:54:51 -0000 1.1 --- dev_pointcloud3d.c 14 Mar 2007 16:41:51 -0000 1.2 *************** *** 33,37 **** // Process incoming data ! void playerc_pointcloud3d_putmsg (playerc_pointcloud3d_t *device, player_msghdr_t *header, void *data); --- 33,37 ---- // Process incoming data ! void playerc_pointcloud3d_putmsg (playerc_pointcloud3d_t *device, player_msghdr_t *header, void *data); *************** *** 74,78 **** // Process incoming data ! void playerc_pointcloud3d_putmsg (playerc_pointcloud3d_t *device, player_msghdr_t *header, void *data) --- 74,78 ---- // Process incoming data ! void playerc_pointcloud3d_putmsg (playerc_pointcloud3d_t *device, player_msghdr_t *header, void *data) *************** *** 83,91 **** player_pointcloud3d_data_t* pc3_data = (player_pointcloud3d_data_t*)data; device->points_count = MIN (pc3_data->points_count, PLAYERC_POINTCLOUD3D_MAX_POINTS); ! memcpy (device->points, pc3_data->points, sizeof (player_pointcloud3d_element_t)*device->points_count); } else ! PLAYERC_WARN2("skipping pointcloud3d message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 83,91 ---- player_pointcloud3d_data_t* pc3_data = (player_pointcloud3d_data_t*)data; device->points_count = MIN (pc3_data->points_count, PLAYERC_POINTCLOUD3D_MAX_POINTS); ! memcpy (device->points, pc3_data->points, sizeof (player_pointcloud3d_element_t)*device->points_count); } else ! PLAYERC_WARN2("skipping pointcloud3d message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } Index: dev_opaque.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_opaque.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dev_opaque.c 18 Dec 2006 12:17:58 -0000 1.2 --- dev_opaque.c 14 Mar 2007 16:41:51 -0000 1.3 *************** *** 111,116 **** } else ! PLAYERC_WARN2("skipping opaque message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); return; } --- 111,116 ---- } else ! PLAYERC_WARN2("skipping opaque message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); return; } Index: dev_health.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_health.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dev_health.c 7 Aug 2006 14:17:59 -0000 1.1 --- dev_health.c 14 Mar 2007 16:41:51 -0000 1.2 *************** *** 1,3 **** ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 --- 1,3 ---- ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 *************** *** 35,39 **** // Process incoming data ! void playerc_health_putmsg (playerc_health_t *device, player_msghdr_t *header, player_health_data_t *data, size_t len); --- 35,39 ---- // Process incoming data ! void playerc_health_putmsg (playerc_health_t *device, player_msghdr_t *header, player_health_data_t *data, size_t len); *************** *** 43,47 **** { playerc_health_t *device; ! device = malloc(sizeof(playerc_health_t)); memset(device, 0, sizeof(playerc_health_t)); --- 43,47 ---- { playerc_health_t *device; ! device = malloc(sizeof(playerc_health_t)); memset(device, 0, sizeof(playerc_health_t)); *************** *** 75,86 **** // Process incoming data ! void playerc_health_putmsg (playerc_health_t *device, player_msghdr_t *header, player_health_data_t *data, size_t len) ! { ! if((header->type == PLAYER_MSGTYPE_DATA) && (header->subtype == PLAYER_HEALTH_DATA)) ! { device->cpu_usage.idle = data->cpu_usage.idle; device->cpu_usage.system = data->cpu_usage.system; --- 75,86 ---- // Process incoming data ! void playerc_health_putmsg (playerc_health_t *device, player_msghdr_t *header, player_health_data_t *data, size_t len) ! { ! if((header->type == PLAYER_MSGTYPE_DATA) && (header->subtype == PLAYER_HEALTH_DATA)) ! { device->cpu_usage.idle = data->cpu_usage.idle; device->cpu_usage.system = data->cpu_usage.system; *************** *** 94,98 **** } else ! PLAYERC_WARN2("skipping health message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 94,98 ---- } else ! PLAYERC_WARN2("skipping health message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } Index: dev_imu.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_imu.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dev_imu.c 19 Oct 2006 13:39:13 -0000 1.4 --- dev_imu.c 14 Mar 2007 16:41:51 -0000 1.5 *************** *** 1,3 **** ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 --- 1,3 ---- ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 *************** *** 35,39 **** // Process incoming data ! void playerc_imu_putmsg (playerc_imu_t *device, player_msghdr_t *header, void *data); --- 35,39 ---- // Process incoming data ! void playerc_imu_putmsg (playerc_imu_t *device, player_msghdr_t *header, void *data); *************** *** 74,83 **** // Process incoming data ! void playerc_imu_putmsg (playerc_imu_t *device, player_msghdr_t *header, void *data) { // int i, j; ! if (header->type == PLAYER_MSGTYPE_DATA) switch (header->subtype) { --- 74,83 ---- // Process incoming data ! void playerc_imu_putmsg (playerc_imu_t *device, player_msghdr_t *header, void *data) { // int i, j; ! if (header->type == PLAYER_MSGTYPE_DATA) switch (header->subtype) { *************** *** 129,134 **** } else ! PLAYERC_WARN2 ("skipping imu message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 129,134 ---- } else ! PLAYERC_WARN2 ("skipping imu message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } Index: playerc.h =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/playerc.h,v retrieving revision 1.219 retrieving revision 1.220 diff -C2 -d -r1.219 -r1.220 *** playerc.h 13 Feb 2007 21:58:29 -0000 1.219 --- playerc.h 14 Mar 2007 16:41:51 -0000 1.220 *************** *** 56,59 **** --- 56,60 ---- #include <libplayercore/playercommon.h> #include <libplayercore/error.h> + #include <libplayercore/interface_util.h> #include <libplayerxdr/playerxdr.h> *************** *** 1798,1802 **** @param intensity Intensity flag; set to 1 to enable reflection intensity data. ! @param scanning_frequency Scanning frequency in Hz. Valid values depend on the underlyling driver. --- 1799,1803 ---- @param intensity Intensity flag; set to 1 to enable reflection intensity data. ! @param scanning_frequency Scanning frequency in Hz. Valid values depend on the underlyling driver. Index: dev_actarray.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_actarray.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dev_actarray.c 7 Nov 2006 16:39:29 -0000 1.9 --- dev_actarray.c 14 Mar 2007 16:41:51 -0000 1.10 *************** *** 101,106 **** } else ! PLAYERC_WARN2("skipping actarray message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 101,106 ---- } else ! PLAYERC_WARN2("skipping actarray message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } Index: dev_position2d.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_position2d.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dev_position2d.c 19 May 2006 09:51:36 -0000 1.8 --- dev_position2d.c 14 Mar 2007 16:41:51 -0000 1.9 *************** *** 116,121 **** } else ! PLAYERC_WARN2("skipping position2d message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 116,121 ---- } else ! PLAYERC_WARN2("skipping position2d message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } Index: dev_limb.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_limb.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dev_limb.c 6 Dec 2006 14:39:17 -0000 1.4 --- dev_limb.c 14 Mar 2007 16:41:51 -0000 1.5 *************** *** 1,3 **** ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 --- 1,3 ---- ! /* * libplayerc : a Player client library * Copyright (C) Andrew Howard 2002-2003 *************** *** 21,25 **** * Player - One Hell of a Robot Server * Copyright (C) Andrew Howard 2003 ! * * * This library is free software; you can redistribute it and/or --- 21,25 ---- * Player - One Hell of a Robot Server * Copyright (C) Andrew Howard 2003 ! * * * This library is free software; you can redistribute it and/or *************** *** 102,107 **** } else ! PLAYERC_WARN2("skipping limb message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 102,107 ---- } else ! PLAYERC_WARN2("skipping limb message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } Index: dev_audio.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/dev_audio.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dev_audio.c 12 Feb 2007 01:29:42 -0000 1.4 --- dev_audio.c 14 Mar 2007 16:41:51 -0000 1.5 *************** *** 90,95 **** player_audio_wav_t * wdata = (player_audio_wav_t *) data; device->wav_data.data_count = wdata->data_count; ! memcpy(device->wav_data.data, wdata->data, wdata->data_count * sizeof(device->wav_data.data[0])); ! device->wav_data.format = wdata->format; } else if((header->type == PLAYER_MSGTYPE_DATA) && (header->subtype == PLAYER_AUDIO_SEQ_DATA)) --- 90,102 ---- player_audio_wav_t * wdata = (player_audio_wav_t *) data; device->wav_data.data_count = wdata->data_count; ! if (device->wav_data.data != NULL) ! free (device->wav_data.data); ! if ((device->wav_data.data = (uint8_t*) malloc (wdata->data_count)) == NULL) ! PLAYER_ERROR("Failed to allocate space to store wave data locally"); ! else ! { ! memcpy(device->wav_data.data, wdata->data, wdata->data_count * sizeof(device->wav_data.data[0])); ! device->wav_data.format = wdata->format; ! } } else if((header->type == PLAYER_MSGTYPE_DATA) && (header->subtype == PLAYER_AUDIO_SEQ_DATA)) *************** *** 114,119 **** } else ! PLAYERC_WARN2("skipping audio message with unknown type/subtype: %d/%d\n", ! header->type, header->subtype); } --- 121,126 ---- } else ! PLAYERC_WARN2("skipping audio message with unknown type/subtype: %s/%d\n", ! msgtype_to_str(header->type), header->subtype); } *************** *** 124,128 **** memset (&wave_data, 0, sizeof (player_audio_wav_t)); wave_data.data_count = data_count; ! memcpy (&wave_data.data, data, wave_data.data_count); wave_data.format = format; --- 131,136 ---- memset (&wave_data, 0, sizeof (player_audio_wav_t)); wave_data.data_count = data_count; ! // Use passed in array, as it will be copied by pack function - saves us having to malloc and free ourselves ! wave_data.data = data; wave_data.format = format; *************** *** 206,210 **** player_audio_sample_t req; req.sample.data_count = data_count; ! memcpy(req.sample.data, data, req.sample.data_count * sizeof(req.sample.data[0])); req.sample.format = format; req.index = index; --- 214,219 ---- player_audio_sample_t req; req.sample.data_count = data_count; ! // Use passed in array, as it will be copied by pack function - saves us having to malloc and free ourselves ! req.sample.data = data; req.sample.format = format; req.index = index; *************** *** 230,233 **** --- 239,249 ---- device->wav_data.data_count = req.sample.data_count; + if (device->wav_data.data != NULL) + free (device->wav_data.data); + if ((device->wav_data.data = (uint8_t*) malloc (req.sample.data_count)) == NULL) + { + PLAYER_ERROR("Failed to allocate space to store wave data locally"); + return -1; + } memcpy(device->wav_data.data, req.sample.data, req.sample.data_count * sizeof(device->wav_data.data[0])); device->wav_data.format = req.sample.format; Index: Makefile.am =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/Makefile.am,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** Makefile.am 11 Sep 2006 19:57:37 -0000 1.94 --- Makefile.am 14 Mar 2007 16:41:51 -0000 1.95 *************** *** 14,19 **** lib_LTLIBRARIES = libplayerc.la ! libplayerc_la_LDFLAGS = $(PLAYER_VERSION_INFO) -rpath $(libdir) $(top_builddir)/libplayerxdr/libplayerxdr.la ! libplayerc_la_DEPENDENCIES = $(top_builddir)/libplayerxdr/libplayerxdr.la libplayerc_la_SOURCES = playerc.h \ --- 14,19 ---- lib_LTLIBRARIES = libplayerc.la ! libplayerc_la_LDFLAGS = $(PLAYER_VERSION_INFO) -rpath $(libdir) $(top_builddir)/libplayerxdr/libplayerxdr.la $(top_builddir)/libplayercore/libplayerutils.la ! libplayerc_la_DEPENDENCIES = $(top_builddir)/libplayerxdr/libplayerxdr.la $(top_builddir)/libplayercore/libplayerutils.la libplayerc_la_SOURCES = playerc.h \ Index: client.c =================================================================== RCS file: /cvsroot/playerstage/code/player/client_libs/libplayerc/client.c,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** client.c 27 Feb 2007 18:09:20 -0000 1.75 --- client.c 14 Mar 2007 16:41:51 -0000 1.76 *************** *** 589,597 **** } default: ! PLAYERC_WARN1 ("unexpected message type [%d]", header.type); ! printf("address: %u:%u:%u:%u\nsize: %u", header.addr.host, header.addr.robot, ! header.addr.interf, header.addr.index, header.size); --- 589,597 ---- } default: ! PLAYERC_WARN1 ("unexpected message type [%s]", msgtype_to_str(header.type)); ! printf("address: %u:%u:%s:%u\nsize: %u", header.addr.host, header.addr.robot, ! interf_to_str(header.addr.interf), header.addr.index, header.size); *************** *** 717,721 **** } ! PLAYERC_ERR4("timed out waiting for server reply to request %d:%d:%d:%d", req_header.addr.interf, req_header.addr.index, req_header.type, req_header.subtype); return -1; } --- 717,721 ---- } ! PLAYERC_ERR4("timed out waiting for server reply to request %s:%d:%s:%d", interf_to_str(req_header.addr.interf), req_header.addr.index, msgtype_to_str(req_header.type), req_header.subtype); return -1; } *************** *** 997,1002 **** // TODO: Allow the user to register a callback to handle unsupported // messages ! PLAYERC_ERR3("skipping message from %u:%u with unsupported type %u", ! header->addr.interf, header->addr.index, header->subtype); return(-1); } --- 997,1002 ---- // TODO: Allow the user to register a callback to handle unsupported // messages ! PLAYERC_ERR4("skipping message from %s:%u with unsupported type %s:%u", ! interf_to_str(header->addr.interf), header->addr.index, msgtype_to_str(header->type), header->subtype); return(-1); } *************** *** 1006,1011 **** header->size, data, PLAYERXDR_DECODE)) < 0) { ! PLAYERC_ERR3("decoding failed on message from %u:%u with type %u", ! header->addr.interf, header->addr.index, header->subtype); return(-1); } --- 1006,1011 ---- header->size, data, PLAYERXDR_DECODE)) < 0) { ! PLAYERC_ERR4("decoding failed on message from %s:%u with type %s:%u", ! interf_to_str(header->addr.interf), header->addr.index, msgtype_to_str(header->type), header->subtype); return(-1); } *************** *** 1049,1054 **** // TODO: Allow the user to register a callback to handle unsupported // messages ! PLAYERC_ERR3("skipping message to %u:%u with unsupported type %u", ! header->addr.interf, header->addr.index, header->subtype); return(-1); } --- 1049,1054 ---- // TODO: Allow the user to register a callback to handle unsupported // messages ! PLAYERC_ERR4("skipping message to %s:%u with unsupported type %s:%u", ! interf_to_str(header->addr.interf), header->addr.index, msgtype_to_str(header->type), header->subtype); return(-1); } *************** *** 1059,1064 **** data, PLAYERXDR_ENCODE)) < 0) { ! PLAYERC_ERR4("encoding failed on message from %u:%u with type %u:%u", ! header->addr.interf, header->addr.index, header->type, header->subtype); return(-1); } --- 1059,1064 ---- data, PLAYERXDR_ENCODE)) < 0) { ! PLAYERC_ERR4("encoding failed on message from %s:%u with type %s:%u", ! interf_to_str(header->addr.interf), header->addr.index, msgtype_to_str(header->type), header->subtype); return(-1); } |