Commit ccbe832c authored by garciay's avatar garciay
Browse files

STF538: Finalize GN, DENM & CAM TP implementation

parent 037b112e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@ public:
  static const std::string& mac_bc;                //! Broadcast MAC address parameter name
  static const std::string& eth_type;              //! Ethernet type parameter name
  static const std::string& beaconing;             //! Beaconing mode parameter name
  static const std::string& station_type;
  static const std::string& country;
  static const std::string& type_of_address;
  static const std::string& ssp;                   //! SSP parameter name
  static const std::string& its_aid;               //! ITS-AID parameter name
  static const std::string& gn_payload;            //! GeoNetworking Payload parameter name
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@ const std::string& Params::mac_dst = std::string("mac_dst");
const std::string& Params::mac_bc = std::string("mac_bc");
const std::string& Params::eth_type = std::string("eth_type");
const std::string& Params::beaconing = std::string("beaconing");
const std::string& Params::station_type = std::string("station_type");
const std::string& Params::country = std::string("country");
const std::string& Params::type_of_address = std::string("type_of_address");
const std::string& Params::its_aid = std::string("its_aid");
const std::string& Params::ssp = std::string("ssp");
const std::string& Params::gn_payload = std::string("gn_payload");
+21 −5
Original line number Diff line number Diff line
@@ -53,6 +53,22 @@ GeoNetworkingLayer::GeoNetworkingLayer(const std::string & p_type, const std::st
  if (it != _params.cend()) {
    angle = converter::get_instance().string_to_int(it->second);
  }
  INTEGER station_type = 5; // passangerCar
  it = _params.find(Params::station_type);
  if (it != _params.cend()) {
    station_type = converter::get_instance().string_to_int(it->second);
  }
  INTEGER country = 0;
  it = _params.find(Params::country);
  if (it != _params.cend()) {
    country = converter::get_instance().string_to_int(it->second);
  }
  INTEGER type_of_address = 1; // Manual
  it = _params.find(Params::type_of_address);
  if (it != _params.cend()) {
    type_of_address = converter::get_instance().string_to_int(it->second);
  }
  
  it = _params.find(Params::device_mode);
  if (it != _params.cend()) {
    _device_mode = (1 == converter::get_instance().string_to_int(it->second));
@@ -108,7 +124,7 @@ GeoNetworkingLayer::GeoNetworkingLayer(const std::string & p_type, const std::st
  Params::const_iterator i = _params.find(Params::beaconing);
  if ((i != _params.cend()) && (i->second.compare("1") == 0)) { // Immediate beaconing was requested
    // Prepare beaconing operation
    fill_beacon(latitude, longitude, ll_address);
    fill_beacon(latitude, longitude, ll_address, station_type, country, type_of_address);
    start_beaconing();
  }

@@ -492,7 +508,7 @@ const LongPosVector* GeoNetworkingLayer::get_lpv(const GN__Address& p_gn_address
  return lpv;
} // End of get_lpv

void GeoNetworkingLayer::fill_beacon(INTEGER& p_latitude, INTEGER& p_longitude, OCTETSTRING& p_ll_address)
void GeoNetworkingLayer::fill_beacon(const INTEGER& p_latitude, const INTEGER& p_longitude, const OCTETSTRING& p_ll_address, const INTEGER p_station_type, const INTEGER p_country, const INTEGER type_of_address)
{
  _beacon = new GeoNetworkingPdu();
  HeaderTST h;
@@ -504,9 +520,9 @@ void GeoNetworkingLayer::fill_beacon(INTEGER& p_latitude, INTEGER& p_longitude,
  eh.beaconHeader() = BeaconHeader(
                                   LongPosVector(
                                                 GN__Address(
                                                             TypeOfAddress(TypeOfAddress::e__manual), // TODO Use Params
                                                             StationType(StationType::e__roadSideUnit), // TODO Use Params
                                                             33,
                                                             TypeOfAddress((TypeOfAddress)type_of_address),
                                                             StationType((StationType)p_station_type),
                                                             p_country,
                                                             p_ll_address
                                                             ),
                                                 0,
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ class GeoNetworkingLayer : public TLayer<LibItsGeoNetworking__TestSystem::GeoNet
   * \param[in] p_longitude
   * \param[in] p_address
   */ 
  void fill_beacon(INTEGER& p_latitude, INTEGER& p_longitude, OCTETSTRING& p_ll_address);
  void fill_beacon(const INTEGER& p_latitude, const INTEGER& p_longitude, const OCTETSTRING& p_ll_address, const INTEGER p_station_type = 5, const INTEGER p_country = 0, const INTEGER type_of_address = 1);
  /*!
   * \brief Initialize a GeoNetworking packet to send GeoNetworking Facility messages
   *        This object shall be updated before to be sent