/*
    Robot server - 2005 Jason Hunt
    
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

    Contact: huntjas2@msu.edu
*/


#ifndef NETWORK_H
#define NETWORK_H

#define PORT 1200
#define REC_BUFFER  1024

// Client to server control commands
#define CONTROL_KEEP_ALIVE      0x00
#define CONTROL_SHUTDOWN        0x02
#define CONTROL_VERSION         0x10
#define CONTROL_STRING          0x20
#define CONTROL_UPDATE          0x30
#define CONTROL_FIREON          0x40
#define CONTROL_FIREOFF         0x41


#define CONTROL_TILT_UP		0x60
#define CONTROL_TILT_DOWN	0x61
#define CONTROL_PAN_LEFT	0x62
#define CONTROL_PAN_RIGHT	0x63
#define CONTROL_STOP		0x64
#define CONTROL_FIRE		0x65














                                          

//void return_controller_data(int sd);
//int get_data(int sd, char *data);
//void send_string(int sd, char *str);
//void send_version(int sd);
int setup_network();
//int wait_for_client(int &client_sd);
void *control_network(void *threadid);

extern unsigned char c_data[4];
extern int program_done;
extern int update_count;
extern int fire;
#endif


