CommSettings.cpp
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 
24 // -- END LICENSE BLOCK ------------------------------------------------
25 
26 //----------------------------------------------------------------------
33 //----------------------------------------------------------------------
34 
36 
37 namespace sick {
38 namespace datastructure {
39 
41 
42 boost::asio::ip::address_v4 CommSettings::getHostIp() const
43 {
44  return m_host_ip;
45 }
46 
47 void CommSettings::setHostIp(const boost::asio::ip::address_v4& host_ip)
48 {
49  m_host_ip = host_ip;
50 }
51 
52 void CommSettings::setHostIp(const std::string& host_ip)
53 {
54  m_host_ip = boost::asio::ip::address_v4::from_string(host_ip);
55 }
56 
58 {
59  return m_host_udp_port;
60 }
61 
62 void CommSettings::setHostUdpPort(const uint16_t& host_udp_port)
63 {
64  m_host_udp_port = host_udp_port;
65 }
66 
67 uint8_t CommSettings::getChannel() const
68 {
69  return m_channel;
70 }
71 
72 void CommSettings::setChannel(const uint8_t& channel)
73 {
74  m_channel = channel;
75 }
76 
78 {
79  return m_enabled;
80 }
81 
82 void CommSettings::setEnabled(bool enabled)
83 {
84  m_enabled = enabled;
85 }
86 
88 {
89  return m_e_interface_type;
90 }
91 
93 {
95 }
96 
98 {
100 }
101 
102 void CommSettings::setPublishingFrequency(const uint16_t& publishing_frequency)
103 {
104  m_publishing_frequency = publishing_frequency;
105 }
106 
108 {
109  return m_start_angle;
110 }
111 
112 void CommSettings::setStartAngle(const uint32_t& start_angle)
113 {
114  m_start_angle = start_angle * 4194304.0; // TODO refactor in constant
115 }
116 
118 {
119  return m_end_angle;
120 }
121 
122 void CommSettings::setEndAngle(const uint32_t& end_angle)
123 {
124  m_end_angle = end_angle * 4194304.0;
125 }
126 
128 {
129  return m_features;
130 }
131 
132 void CommSettings::setFeatures(const uint16_t& features)
133 {
134  m_features = features;
135 }
136 
137 void CommSettings::setFeatures(bool general_system_state,
138  bool derived_settings,
139  bool measurement_data,
140  bool intrusion_data,
141  bool application_data)
142 {
143  m_features = 0;
144  m_features += (static_cast<int>(general_system_state) << 0);
145  m_features += (static_cast<int>(derived_settings) << 1);
146  m_features += (static_cast<int>(measurement_data) << 2);
147  m_features += (static_cast<int>(intrusion_data) << 3);
148  m_features += (static_cast<int>(application_data) << 4);
149 }
150 
151 boost::asio::ip::address_v4 CommSettings::getSensorIp() const
152 {
153  return m_sensor_ip;
154 }
155 
156 void CommSettings::setSensorIp(const boost::asio::ip::address_v4& sensor_ip)
157 {
158  m_sensor_ip = sensor_ip;
159 }
160 
161 void CommSettings::setSensorIp(const std::string& sensor_ip)
162 {
163  m_sensor_ip = boost::asio::ip::address_v4::from_string(sensor_ip);
164 }
165 
167 {
168  return m_sensor_tcp_port;
169 }
170 
171 void CommSettings::setSensorTcpPort(const uint16_t& sensor_tcp_port)
172 {
173  m_sensor_tcp_port = sensor_tcp_port;
174 }
175 
176 
177 } // namespace datastructure
178 } // namespace sick
boost::asio::ip::address_v4 getHostIp() const
Gets the IP-address of the host.
void setEInterfaceType(const uint8_t &e_interface_type)
Sets the eInterface type.
uint16_t getFeatures() const
Gets the enabled features.
void setFeatures(const uint16_t &features)
Set the enabled features.
void setSensorTcpPort(const uint16_t &sensor_tcp_port)
Sets the sensor tcp port.
uint16_t getPublishingFrequency() const
Gets the publishing frequency.
void setEnabled(bool enabled)
Sets if the channel is enabled.
void setEndAngle(const uint32_t &end_angle)
Sets the end angle of the scan.
uint8_t getEInterfaceType() const
Gets the eInterface type.
void setPublishingFrequency(const uint16_t &publishing_frequency)
Sets the publishing frequency.
uint32_t getStartAngle() const
Gets the start angle of the scan.
CommSettings()
Constructor of the communication settings.
void setSensorIp(const boost::asio::ip::address_v4 &sensor_ip)
Sets the sensor IP-address.
uint32_t getEndAngle() const
Gets the end angle of the scan.
bool getEnabled() const
Gets if the channel is enabled.
void setStartAngle(const uint32_t &start_angle)
Sets the start angle of the scan.
uint16_t getSensorTcpPort() const
Gets the sensor tcp port.
boost::asio::ip::address_v4 getSensorIp() const
Gets the sensor IP-address.
uint8_t getChannel() const
Gets the channel of the data.
void setHostUdpPort(const uint16_t &host_udp_port)
Sets the host udp port.
void setChannel(const uint8_t &channel)
Sets the channel of the data.
boost::asio::ip::address_v4 m_host_ip
Definition: CommSettings.h:228
boost::asio::ip::address_v4 m_sensor_ip
Definition: CommSettings.h:226
uint16_t getHostUdpPort() const
Gets the host udp port.
void setHostIp(const boost::asio::ip::address_v4 &host_ip)
Sets the IP-address of the host from an IP-address.


sick_safetyscanners
Author(s): Lennart Puck
autogenerated on Fri Apr 2 2021 02:45:41