api.h

Go to the documentation of this file.
00001 
00014 #define TAM_STRING 30
00015 #define TAM_STRING_LONG 100
00016 #define MAX_COMMAND_SIZE 150
00017 #define MAX_RESP_SIZE 200
00018 
00019 #define MAX_TAM_SIZE_STRING 2000
00020 
00021 
00022 typedef unsigned char   U08_t;
00023 typedef unsigned long   U32_t;
00024 typedef unsigned long long U64_t;
00025 
00033 #define CLI_PROMPT "\nTCCOS> "
00034 
00035 /* MAC address configuration. */
00036 #define uipMAC_ADDR0    0x0
00037 #define uipMAC_ADDR1    0xbd
00038 #define uipMAC_ADDR2    0x33
00039 #define uipMAC_ADDR3    0x02
00040 #define uipMAC_ADDR4    0x64
00041 #define uipMAC_ADDR5    0x24
00042 
00043 /* IP address configuration. */
00044 int uipIP_ADDR0;
00045 int uipIP_ADDR1;
00046 int uipIP_ADDR2;
00047 int uipIP_ADDR3;
00048 
00049 unsigned short uip_GAT0;
00050 unsigned short uip_GAT1;
00051 unsigned short uip_GAT2;
00052 unsigned short uip_GAT3;
00053 
00054 unsigned short uip_Mask0;
00055 unsigned short uip_Mask1;
00056 unsigned short uip_Mask2;
00057 unsigned short uip_Mask3;
00058 
00059 
00066 typedef enum {
00067         RET_OK =0,      
00068         RET_ERROR       
00069 } break_t;
00070 
00077 typedef enum {
00078         GET_CMD=0, 
00079         SET_CMD, 
00080         HELP_CMD, 
00081         CHAT_CMD, 
00082         FTP_CMD 
00083 } type_t;
00084 
00085 int vectorAddrIPv4[4];
00086 
00093 typedef struct{
00094         type_t tipo; 
00095         char cmd_name[TAM_STRING]; 
00096         char value[TAM_STRING_LONG]; 
00097         char resp[MAX_RESP_SIZE];
00098 }str_t;
00099 
00105 typedef struct{
00106         break_t (*pFunc) (str_t * tp);  
00107         char*   string;         
00108         char* help; 
00109 }cli_str;
00110 
00111 break_t do_get_temperature(str_t* tp);
00112 break_t do_IP(str_t* tp);
00113 break_t do_gateway(str_t* tp);
00114 break_t do_mask(str_t* tp);
00115 break_t do_MAC(str_t* tp);
00116 break_t do_init(str_t* tp);
00117 break_t do_lcd(str_t* tp);
00118 break_t do_chat(str_t* tp);
00119 break_t do_configIp(str_t* tp);
00120 break_t do_ftp(str_t* tp);