/***************************************************************************
 *                           CommunicationAvatarVOR.h                      *
 *                           -------------------                           *
 * copyright            : (C) 2015 by Niceto Luque and Francisco Naveros   *
 * email                : nluque@ugr.es and fnaveros@ugr.es                *
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 3 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef COMMUNICATIONAVATARVOR_H_
#define COMMUNICATIONAVATARVOR_H_

/*!
 * \file CommunicationAvatarVOR.h
 *
 * \author Niceto Luque
 * \author Francisco Naveros
 * \date April 2016
 *
 * This file declares a class which implements a communication mechanism between EDLUT and a humanoid avatar for a VOR experiment.
 */

#include "string"

class CdSocket;
struct log;

using namespace std;

class CommunicationAvatarVOR{
	public:

		  /*!
		 *
		* Socket for TCP IP communications.
		*
		 */
		CdSocket * socket;

		volatile bool endConnection;

		float inputBuffer[256];
		float outputBuffer[256];

		struct log * var_log;

   		/*!
   		 * \brief Default constructor.
   		 * 
   		 * It creates and initializes a new spike object.
   		 */
		CommunicationAvatarVOR(struct log * var_log);

   		/*!
   		 * \brief Class destructor.
   		 * 
   		 * It destroies an object of this class.
   		 */
		~CommunicationAvatarVOR();

		void Send(int N_values, float * input_signal, float * cerebelar_signal);

		void Receive();

		void Communication(string Avatar_IP);

		void StopConnection();

};



#endif /* COMMUNICATIONAVATARVOR_H_ */
