Commit bdab0f01 authored by berge's avatar berge
Browse files

Multiple signess fixes + changeCurvature (contribution from Mats Claesson @Kapsch)

parent ea762535
Loading
Loading
Loading
Loading
+34 −15
Original line number Original line Diff line number Diff line
@@ -161,6 +161,7 @@
#define L_ALACARTELENGTH                1
#define L_ALACARTELENGTH                1
#define L_CAMEVENTLENGTH                2
#define L_CAMEVENTLENGTH                2
#define L_DENMEVENTLENGTH               2
#define L_DENMEVENTLENGTH               2
#define L_SETPTACTIVATIONTYPE           1
#define L_SETPTACTIVATIONLENGTH         1
#define L_SETPTACTIVATIONLENGTH         1
#define L_SHAPE                         1
#define L_SHAPE                         1
#define L_LIFETIME	                    2
#define L_LIFETIME	                    2
@@ -257,6 +258,7 @@ static int hf_set_embarkation_status = -1;


/* UT Set Pt Activation */
/* UT Set Pt Activation */
static int hf_set_pt_activation = -1;
static int hf_set_pt_activation = -1;
static int hf_set_pt_activation_type = -1;
static int hf_set_pt_activation_length = -1;
static int hf_set_pt_activation_length = -1;
static int hf_set_pt_activation_payload = -1;
static int hf_set_pt_activation_payload = -1;


@@ -340,6 +342,7 @@ static int hf_mapspat_trigger_event_result_code = -1;
static int hf_mapspat_trigger_event_result_msgc = -1;
static int hf_mapspat_trigger_event_result_msgc = -1;


/* CAM Parameters */
/* CAM Parameters */
static int hf_curvature = -1;
static int hf_delta_latitude = -1;
static int hf_delta_latitude = -1;
static int hf_delta_longitude = -1;
static int hf_delta_longitude = -1;
static int hf_delta_elevation = -1;
static int hf_delta_elevation = -1;
@@ -632,13 +635,13 @@ static int dissect_itsut_change_curvature(tvbuff_t *tvb, proto_tree *header_tree
  ti = proto_tree_add_item(header_tree, hf_change_curvature, tvb, offset, L_ITSUT_CHANGECURVATURE, FALSE);
  ti = proto_tree_add_item(header_tree, hf_change_curvature, tvb, offset, L_ITSUT_CHANGECURVATURE, FALSE);
  tree = proto_item_add_subtree(ti, ett_itsut_command);
  tree = proto_item_add_subtree(ti, ett_itsut_command);


  /* UtChangeSpeed */
  /* UtChangeCurvature */
  proto_tree_add_item(tree, hf_command, tvb, offset, L_ITSUT_COMMAND, FALSE);
  proto_tree_add_item(tree, hf_command, tvb, offset, L_ITSUT_COMMAND, FALSE);
  offset += L_ITSUT_COMMAND;
  offset += L_ITSUT_COMMAND;


  /* UtChangeSpeed tree */
  /* UtChangeCurvature tree */
  /* SpeedVariation */
  /* Curvature */
  proto_tree_add_item(tree, hf_speed_variation, tvb, offset, L_CURVATURE, FALSE);
  proto_tree_add_item(tree, hf_curvature, tvb, offset, L_CURVATURE, FALSE);
  offset += L_CURVATURE;
  offset += L_CURVATURE;


  return offset;
  return offset;
@@ -941,6 +944,10 @@ static int dissect_itsut_set_pt_activation(tvbuff_t *tvb, proto_tree *header_tre
  offset += L_ITSUT_COMMAND;
  offset += L_ITSUT_COMMAND;


  /* SetPtActivation tree */
  /* SetPtActivation tree */
  /* Type */
  proto_tree_add_item(tree, hf_set_pt_activation_type, tvb, offset, L_SETPTACTIVATIONTYPE, FALSE);
  offset += L_SETPTACTIVATIONTYPE;

  /* Length */
  /* Length */
  length = tvb_get_guint8(tvb, offset);
  length = tvb_get_guint8(tvb, offset);
  proto_tree_add_item(tree, hf_set_pt_activation_length, tvb, offset, L_SETPTACTIVATIONLENGTH, FALSE);
  proto_tree_add_item(tree, hf_set_pt_activation_length, tvb, offset, L_SETPTACTIVATIONLENGTH, FALSE);
@@ -1836,6 +1843,7 @@ static int dissect_itsut_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
        case (guint8)ITSUT_CAMEVENTINDICATION:
        case (guint8)ITSUT_CAMEVENTINDICATION:
            offset = dissect_itsut_cam_event_indication(tvb, itsut_tree, offset);
            offset = dissect_itsut_cam_event_indication(tvb, itsut_tree, offset);
            break;
            break;
        case (guint8)ITSUT_SETDANGEROUSGOODS:
            offset = dissect_itsut_set_dangerous_goods(tvb, itsut_tree, offset);
            offset = dissect_itsut_set_dangerous_goods(tvb, itsut_tree, offset);
            break;
            break;
        case (guint8)ITSUT_SETDANGEROUSGOODSEXT:
        case (guint8)ITSUT_SETDANGEROUSGOODSEXT:
@@ -1945,6 +1953,11 @@ proto_register_itsut(void)
      {"UtChangePseudonymResult", "itsut.change_pseudonym.result", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
      {"UtChangePseudonymResult", "itsut.change_pseudonym.result", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
    },
    },


    /* UT Change Curvature */
    { &hf_change_curvature ,
      {"UtChangeCurvature", "itsut.change_curvature", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}
    },

    /* UT Change Speed */
    /* UT Change Speed */
    { &hf_change_speed,
    { &hf_change_speed,
      {"UtChangeSpeed", "itsut.change_speed", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}
      {"UtChangeSpeed", "itsut.change_speed", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}
@@ -2080,11 +2093,14 @@ proto_register_itsut(void)
    { &hf_set_pt_activation,
    { &hf_set_pt_activation,
      {"SetPtActivation", "itsut.set_pt_activation", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}
      {"SetPtActivation", "itsut.set_pt_activation", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL}
    },
    },
    { &hf_set_pt_activation_type,
      {"Type", "itsut.set_pt_activation_type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
    },
    { &hf_set_pt_activation_length,
    { &hf_set_pt_activation_length,
      {"Length", "itsut.set_pt_activation", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL}
      {"Length", "itsut.set_pt_activation_length", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL}
    },
    },
    { &hf_set_pt_activation_payload,
    { &hf_set_pt_activation_payload,
      {"Payload", "itsut.set_pt_activation", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL}
      {"Payload", "itsut.set_pt_activation_payload", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL}
    },
    },
    
    
    /* UT CAM Trigger */
    /* UT CAM Trigger */
@@ -2228,16 +2244,19 @@ proto_register_itsut(void)
    
    
    /* Parameters */
    /* Parameters */
    { &hf_delta_latitude,
    { &hf_delta_latitude,
      {"Delta Latitude", "itsut.change_position.delta_latitude", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
      {"Delta Latitude", "itsut.change_position.delta_latitude", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
    },
    },
    { &hf_delta_longitude,
    { &hf_delta_longitude,
      {"Delta Longitude", "itsut.change_position.delta_longitude", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
      {"Delta Longitude", "itsut.change_position.delta_longitude", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
    },
    },
    { &hf_delta_elevation,
    { &hf_delta_elevation,
      {"Delta Elevation", "itsut.change_position.delta_elevation", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
      {"Delta Elevation", "itsut.change_position.delta_elevation", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
    },
    { &hf_curvature,
      {"Curvature", "itsut.curvature", FT_INT16, BASE_DEC, NULL, 0x00, NULL, HFILL}
    },
    },
    { &hf_speed_variation,
    { &hf_speed_variation,
      {"SpeedVariation", "itsut.speed_variation", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL}
      {"SpeedVariation", "itsut.speed_variation", FT_INT16, BASE_DEC, NULL, 0x00, NULL, HFILL}
    },
    },
    { &hf_heading_direction,
    { &hf_heading_direction,
      {"Direction", "itsut.change_heading.direction", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
      {"Direction", "itsut.change_heading.direction", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
@@ -2246,7 +2265,7 @@ proto_register_itsut(void)
      {"Direction", "itsut.set_drive_direction.direction", FT_UINT8, BASE_DEC, VALS(itsut_drive_direction_names), 0x0, NULL, HFILL}
      {"Direction", "itsut.set_drive_direction.direction", FT_UINT8, BASE_DEC, VALS(itsut_drive_direction_names), 0x0, NULL, HFILL}
    },
    },
    { &hf_yawrate,
    { &hf_yawrate,
      {"Yawrate", "itsut.change_yawrate.yawrate", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
      {"Yawrate", "itsut.change_yawrate.yawrate", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
    },
    },
    { &hf_station_type,
    { &hf_station_type,
      {"StationType", "itsut.set_station_type.station_type", FT_UINT8, BASE_DEC, VALS(itsut_station_type_names), 0x0, NULL, HFILL}
      {"StationType", "itsut.set_station_type.station_type", FT_UINT8, BASE_DEC, VALS(itsut_station_type_names), 0x0, NULL, HFILL}
@@ -2270,7 +2289,7 @@ proto_register_itsut(void)
      {"SequenceNumber", "itsut.denm.sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
      {"SequenceNumber", "itsut.denm.sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
    },
    },
    { &hf_detection_time,
    { &hf_detection_time,
      {"DetctionTime", "itsut.denm.detection_time", FT_INT64, BASE_DEC, NULL, 0x00, NULL, HFILL}
      {"DetctionTime", "itsut.denm.detection_time", FT_UINT64, BASE_DEC, NULL, 0x00, NULL, HFILL}
    },
    },
    { &hf_validity_duration,
    { &hf_validity_duration,
      {"ValidityDuration", "itsut.denm.validity_duration", FT_UINT24, BASE_DEC, NULL, 0x00, NULL, HFILL}
      {"ValidityDuration", "itsut.denm.validity_duration", FT_UINT24, BASE_DEC, NULL, 0x00, NULL, HFILL}
@@ -2321,10 +2340,10 @@ proto_register_itsut(void)
      {"Reserved", "itsut.gn.geoxxxcast.reservedgeobroadcast", FT_UINT24, BASE_DEC, NULL, 0x00, NULL, HFILL}
      {"Reserved", "itsut.gn.geoxxxcast.reservedgeobroadcast", FT_UINT24, BASE_DEC, NULL, 0x00, NULL, HFILL}
    },
    },
    { &hf_latitude,
    { &hf_latitude,
      {"Latitude", "itsut.gn.geoxxxcast.latitude", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL}
      {"Latitude", "itsut.gn.geoxxxcast.latitude", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL}
    },
    },
    { &hf_longitude,
    { &hf_longitude,
      {"Longitude", "itsut.gn.geoxxxcast.longitude", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL}
      {"Longitude", "itsut.gn.geoxxxcast.longitude", FT_INT32, BASE_DEC, NULL, 0x00, NULL, HFILL}
    },
    },
    { &hf_distancea,
    { &hf_distancea,
      {"DistanceA", "itsut.gn.geoxxxcast.distanceA", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL}
      {"DistanceA", "itsut.gn.geoxxxcast.distanceA", FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL}