Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

NetManager Class Reference

Collaboration diagram for NetManager:
[legend]
List of all members.

Detailed Description

class responsible for interfacing with the incomming and outgoing data sockets

Definition at line 19 of file netManager.h.

Public Types

enum  sock_port {
  df_in_port = 1000,
  df_out_port = 1001
}
 enumeration for the ports used by the netmanager More...


Public Member Functions

int connect ()
 will attempt to make a default connection to the via board

int connect (struct sockaddr_in)
 will attempt to make a connection based on the user input

int disconnect ()
 attempts to close the network connection with the via board

int writePacket (Packet *packet)
 gets a packet ready to send over the network

int login ()
 the method which will prompt the user to login

int waitForReply (int ID, Packet *packet)
 will wait a max of two seconds for a reply from the server on success will populate the packet

int createID ()
 create an id for a packet


Static Public Member Functions

NetManagertheInstance ()
 returns the one and only instance of ViaNetManager


Protected Member Functions

 NetManager ()
 constructor for the ViaNetManager class

 ~NetManager ()
 destructor for the ViaNetManager class


Private Attributes

ScreenManagerscreenManager
 reference to the screenManager

SysLogsystemLogger
 reference to the syslog

InNetSockinNetSock
 refernce to the InNetSock

OutNetSockoutNetSock
 reference to the OutNetSock

sockaddr_in defaultOutNet
 information for making a default out connection to the the robot

sockaddr_in defaultInNet
 information for making a default in connection to the robot

sockaddr_in usrNet
 information provided by the user to make a non default connection

int curID
 the current id


Static Private Attributes

char * df_addr
 the default ip address for connecting to the robot

NetManagernm
 the instance of netmanager


Member Enumeration Documentation

enum NetManager::sock_port
 

enumeration for the ports used by the netmanager

Enumeration values:
df_in_port  incomming data port
df_out_port  outgoing data port

Definition at line 25 of file netManager.h.


Member Function Documentation

int NetManager::connect struct  sockaddr_in  ) 
 

will attempt to make a connection based on the user input

Return values:
1 on success -1 on error

int NetManager::connect  ) 
 

will attempt to make a default connection to the via board

Return values:
1 on sucess -1 on error

int NetManager::createID  ) 
 

create an id for a packet

Return values:
the id created

int NetManager::disconnect  ) 
 

attempts to close the network connection with the via board

Return values:
1 on success -1 on error

int NetManager::login  ) 
 

the method which will prompt the user to login

Return values:
1 on success -1 error

NetManager* NetManager::theInstance  )  [static]
 

returns the one and only instance of ViaNetManager

Return values:
the singleton instance of ViaNetManager

int NetManager::waitForReply int  ID,
Packet packet
 

will wait a max of two seconds for a reply from the server on success will populate the packet

Parameters:
ID of packet to look for
packet to populate
Return values:
1 on success -1 on error

int NetManager::writePacket Packet packet  ) 
 

gets a packet ready to send over the network

Parameters:
packet 
Return values:
packetID on success -1 error


The documentation for this class was generated from the following file:
Generated on Sat Mar 26 00:07:05 2005 for CS498EmbeddedSystemsProgramming by doxygen 1.3.6