MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / sendPacket

Function sendPacket

opt_utils/apps/ros2udp_converter_pose.cpp:175–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175void
176sendPacket(
177 const std::string& json_to_send)
178{
179 /// Copy string to message buffer:
180 udp_data.si_num_byte_ = json_to_send.length()+1;
181 char buf[udp_data.si_num_byte_];
182 //jb loop below should be memset(), not changing now
183 //
184 for (unsigned int i = 0; i < udp_data.si_num_byte_; i++)
185 {
186 buf[i] = 0;
187 }
188 sprintf(buf, "%s", json_to_send.c_str());
189 udp_data.pc_pck_ = buf; // buffer where the message is written
190
191 /// Send message:
192 udp_messaging.sendFromSocketUDP(&udp_data);
193}
194
195void
196synchronizedCallback(

Callers 1

synchronizedCallbackFunction · 0.85

Calls 1

sendFromSocketUDPMethod · 0.80

Tested by

no test coverage detected