mirror of
https://github.com/OpenSolo/OpenSolo.git
synced 2025-04-30 14:44:31 +02:00
22 lines
512 B
C++
22 lines
512 B
C++
|
|
#include "packetTypes.h"
|
|
#include "SetTelemUnits.h"
|
|
|
|
// UDP port on local machine where downstream SetTelemUnits should be sent
|
|
unsigned SetTelemUnits::udpPort = 0;
|
|
|
|
SetTelemUnits::SetTelemUnits(int port) : PacketHandler("", port, 0x02, PKT_ID_SET_TELEM_UNITS)
|
|
{
|
|
SetTelemUnits::udpPort = port;
|
|
}
|
|
|
|
void SetTelemUnits::set(string &setting)
|
|
{
|
|
char buf = 1; // default is metric
|
|
|
|
if (setting == "imperial")
|
|
buf = 0;
|
|
|
|
sendto(_sock_fd, &buf, 1, 0, (struct sockaddr *)&_sock, sizeof(_sock));
|
|
}
|