/****************************************************************************
	Aplikace pro zjisteni siti kolem zarizeni a vyber site podle preferenci 
	uzivatele

*****************************************************************************/
#ifndef NETWORK_NAMES_H
#define NETWORK_NAMES_H

/****************************************************************************
	Definice geometrickych rozmeru aplikace

*****************************************************************************/
#define NETWORK_NAMES_YA 29
#define NETWORK_NAMES_XA 120
#define NETWORK_NAMES_XC 360
#define NETWORK_NAMES_YC 265

#define NETWORK_NAMES_BUTTONS_LEFT 10
#define NETWORK_NAMES_BUTTONS_TOP 25
#define NETWORK_NAMES_BUTTONS_WIDTH 220
#define NETWORK_NAMES_BUTTONS_HEIGHT 27
#define NETWORK_NAMES_BUTTONS_DISTANCE 8

#define NETWORK_NAMES_BUTTONS_SHORT_WIDTH 106

/****************************************************************************
	Definice stavu aplikace

*****************************************************************************/
typedef enum NETWORK_NAMES_STATE
{
	NETWORK_NAMES_NOT_INITIALIZED = M_TASK_NOT_INITIALIZED,
	NETWORK_NAMES_INITIALIZE,
	NETWORK_NAMES_RESTART = M_TASK_RESTART,
	NETWORK_NAMES_DRAW,
	NETWORK_NAMES_ACTIVE = M_TASK_RUNNING,
	NETWORK_NAMES_WAITING = M_TASK_WAITING,
	NETWORK_NAMES_DIALOG_WAITING = M_TASK_DIALOG_WAITING,
	NETWORK_NAMES_SWITCH,
	NETWORK_NAMES_READY = M_TASK_READY,
	NETWORK_NAMES_STOP,
	NETWORK_NAMES_ERROR = M_TASK_FAILED,
}NETWORK_NAMES_STATE;

/****************************************************************************
	Definice objektu aplikace

*****************************************************************************/
typedef enum NETWORK_NAMES_OBJECT
{
	NETWORK_NAMES_MAIN_SHAPE,
	NETWORK_NAME_BUTTON_1,
	NETWORK_NAME_BUTTON_2,
	NETWORK_NAME_BUTTON_3,
	NETWORK_NAME_BUTTON_4,
	NETWORK_NAME_BUTTON_5,
	NETWORK_NAME_BUTTON_OWN,
	NETWORK_NAME_BUTTON_BACK,
	NETWORK_NAMES_OBJECT_COUNT
}NETWORK_NAMES_OBJECT;


/****************************************************************************
	Typy sifer

*****************************************************************************/
typedef enum CIPHER_TYPE
{
	CIP_NONE,
	CIP_WEP,
	CIP_WEP2,
	CIP_WPA,
	CIP_WPA2,
}CIPHER_TYPE;

/****************************************************************************
	Typ SSID

*****************************************************************************/
typedef enum SSID_TYPE
{
	SSID_AP,
	SSID_ADHOC
}SSID_TYPE;


#define NETWORK_NAME_LENGTH 20		//Delka nazvu site

/****************************************************************************
	Struktura popisujici sit v okoli

*****************************************************************************/
typedef struct NETWORK_STRUCT
{
	unsigned char ssid[NETWORK_NAME_LENGTH];		//Nazev site
	CIPHER_TYPE cipType;							//Sifrovani
	SSID_TYPE ssidType;								//Typ site
	unsigned char mac[17];							//MAC adresa
	char strength;									//Sila signalu
	char channel;									//Kanal
	ANSWER isValid;									//Platnost konfigurace
}NETWORK_STRUCT;

/****************************************************************************
	Stavy pro rizeni komunikace s WiFi

*****************************************************************************/
typedef enum NETWORK_NAMES_ACQUIRE
{
	NN_CLEAR,
	NN_COMMUNICATING,
	NN_REQUESTED,
	NN_COMPLETED,
	NN_ERROR,
}NETWORK_NAMES_ACQUIRE;

/****************************************************************************
	Popis rozlozeni informaci ve stringu z WiFi

*****************************************************************************/
typedef enum NETWORK_STRING
{
	NS_NAME,
	NS_TYPE,
	NS_MAC,
	NS_CIP,
	NS_CHAN,
	NS_STR,
}NETWORK_STRING;

RESULT NNMsgBox(MESSAGE * msg);
void AppNetworkNames(void);

extern NETWORK_STRUCT myDetectedNetworks[];

#endif