diff options
Diffstat (limited to 'proto-udp/ftnoir_protocol_ftn.cpp')
-rw-r--r-- | proto-udp/ftnoir_protocol_ftn.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/proto-udp/ftnoir_protocol_ftn.cpp b/proto-udp/ftnoir_protocol_ftn.cpp index 4d57140f..000a0a79 100644 --- a/proto-udp/ftnoir_protocol_ftn.cpp +++ b/proto-udp/ftnoir_protocol_ftn.cpp @@ -18,16 +18,21 @@ udp::udp() QObject::connect(s.b.get(), &bundle_::changed, this, &udp::set_dest_address, - Qt::QueuedConnection); + Qt::DirectConnection); } -void udp::pose(const double *headpose) { +void udp::pose(const double *headpose) +{ + QMutexLocker l(&lock); + outSocket.writeDatagram((const char *) headpose, sizeof(double[6]), dest_ip, dest_port); } void udp::set_dest_address() { - dest_port = s.port; + QMutexLocker l(&lock); + + dest_port = (unsigned short)s.port; dest_ip = QHostAddress((s.ip1.to<unsigned>() & 0xff) << 24 | (s.ip2.to<unsigned>() & 0xff) << 16 | (s.ip3.to<unsigned>() & 0xff) << 8 | |