|
|
|
@ -219,6 +219,7 @@ void Wiz810MjDevice::setMac(byte b0, byte b1, byte b2, byte b3, byte b4, byte b5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Make this 'NetworkServerConnection'? Or just 'ServerConnection'?
|
|
|
|
|
// TODO: Pull one-line methods into class definition to allow inlining?
|
|
|
|
|
class NetworkConnection { // Essentially a Socket wrapper
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
@ -226,6 +227,8 @@ class NetworkConnection { // Essentially a Socket wrapper
|
|
|
|
|
|
|
|
|
|
void listen(); // TODO: Return a useful value?
|
|
|
|
|
|
|
|
|
|
int isConnected();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
SOCKET _socket;
|
|
|
|
|
};
|
|
|
|
@ -244,6 +247,15 @@ void NetworkConnection::listen() { // TODO: Make private or protected?
|
|
|
|
|
::listen(_socket); // TODO: Use C++ namespaces for the driver functions?
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int NetworkConnection::isConnected() {
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
// TODO: If we want the 'Network*' classes to be generic we
|
|
|
|
|
// would need to handle this differently:
|
|
|
|
|
return (getSn_SR(_socket) == SOCK_ESTABLISHED);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ----------------------- */
|
|
|
|
|
|
|
|
|
|
/* -- NetworkInterface -- */
|
|
|
|
|