mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 13:56:24 +02:00
add a PariableDevice struct that will hold device info in vector
This commit is contained in:
parent
01816ccda3
commit
87f48b5bc4
1 changed files with 26 additions and 0 deletions
|
@ -6,8 +6,34 @@
|
|||
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include <UDPSocket.h>
|
||||
|
||||
const int PAIRING_SERVER_LISTEN_PORT = 52934;
|
||||
const int MAX_PACKET_SIZE_BYTES = 1400;
|
||||
|
||||
struct PairableDevice {
|
||||
char identifier[64];
|
||||
char name[64];
|
||||
sockaddr localSocket;
|
||||
};
|
||||
|
||||
int main(int argc, const char* argv[]) {
|
||||
UDPSocket serverSocket(PAIRING_SERVER_LISTEN_PORT);
|
||||
|
||||
sockaddr deviceAddress;
|
||||
char deviceData[MAX_PACKET_SIZE_BYTES] = {};
|
||||
ssize_t receivedBytes = 0;
|
||||
|
||||
std::vector<PairableDevice> devices;
|
||||
|
||||
while (true) {
|
||||
if (serverSocket.receive(&deviceAddress, &deviceData, &receivedBytes)) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue