add a PariableDevice struct that will hold device info in vector

This commit is contained in:
Stephen Birarda 2013-05-01 15:40:31 -07:00
parent 01816ccda3
commit 87f48b5bc4

View file

@ -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)) {
}
}
}