Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
pt:software:homelab:library:module:ethernet [2015/12/09 17:10] – Criação deste novo documento. articapt:software:homelab:library:module:ethernet [2020/07/20 09:00] (current) – external edit 127.0.0.1
Line 7: Line 7:
 ===== Constantes ===== ===== Constantes =====
  
-    * **//static uint8_t mymac[6] = {0x54,0x55,0x58,0x10,0x00,0x24}//** - controller MAC address (you can choose a random address, but it is important to be unique in the network). +    * **//static uint8_t mymac[6] = {0x54,0x55,0x58,0x10,0x00,0x24}//** - controlador do MAC address (pode ser escolhida um MAC address aleatóriomas é importante que seja único na rede). 
-    * **//static uint8_t myip[4] = {192,168,1,100}//** - IP address corresponding to LAN, you must choose different last digit, if it is already present in the network+    * **//static uint8_t myip[4] = {192,168,1,100}//** - endereço IP address na LAN, o último dígito tem de ser diferente se já existe na rede
-    * **//static uint8_t buf[BUFFER_SIZE+1]//** - size of data buffer (usually 600+1 B).+    * **//static uint8_t buf[BUFFER_SIZE+1]//** - tamanho do buffer de dados (tipicamente 600+1 B).
  
  
-===== Functions =====+===== Funções =====
  
   * **//void ethernet_standby(void)//** \\   * **//void ethernet_standby(void)//** \\
-    Brings Ethernet controller into sleep mode (low energy consumption).+    Põe o controlador Ethernet em modo sleep (baixo consumo energético).
  
   * **//void ethernet_init(uint8_t *mac, uint8_t *ip)//** \\   * **//void ethernet_init(uint8_t *mac, uint8_t *ip)//** \\
-    Ethernet controller initial setup with MAC and IP addresses+    Configuração inicial do controlador Ethernet com endereços IP e MAC
-    Parameters+    Parâmetros
-    * //*mac// - MAC address array. +    * //*mac// - array de endereço MAC
-    * //*ip// - IP address array.+    * //*ip// - array de endereço de IP.
  
   * **//uint16_t ethernet_get_packet (uint16_t maxlen, uint8_t* packet)//** \\   * **//uint16_t ethernet_get_packet (uint16_t maxlen, uint8_t* packet)//** \\
-    Polls network until it receives packet addressed to it and containing data+    Pesquisa a rede até receber um pacote a ele endereçado e com dados
-    Parameters+    Parâmetros
-    * //maxlen// - maximum allowed data buffer size+    * //maxlen// - tamanho máximo permitido do buffer de dados
-    * //*buffer// - array where to save received data for further operations+    * //*buffer// - array para gravação dos dados recebidos para operações posteriores
-    * If the packet has arrivedreturns the length of the received packet in bytes and in opposite case returns 0.+    * Se um pacote chegoudevolve o tamanho do mesmo em bytes, caso contrário devolve 0.
  
   * **//uint16_t ethernet_analyse_packet(uint8_t *buf,uint16_t plen)//** \\   * **//uint16_t ethernet_analyse_packet(uint8_t *buf,uint16_t plen)//** \\
-    Analyzes if received packet contains info about URL. Will respond to ping if needed+    Verifica se o pacote recebido contém informação sobre o URL. Responde a ping se for necessário
-    Parameters+    Parâmetros
-    * //*buf// - data array to analyze+    * //*buf// - array de dados a verificar
-    * //plen// - length of received packet in bytes. +    * //plen// - comprimento do pacote recebido em bytes. 
-    * Tagastab URL-i esimese tähemärgi aadressiKui URL on tühisiis tagastab 0+    * Devolve o endereço do primeiro caracter no URL. Se o URL for vaziodevolve 0
-    * Returns the address of the first char in URL. If URL is empty, it will return 0.+
  
   * **//uint16_t ethernet_load_data (uint8_t *buf,uint16_t pos, const prog_char *progmem_s)   * **//uint16_t ethernet_load_data (uint8_t *buf,uint16_t pos, const prog_char *progmem_s)
 //** \\ //** \\
-    Loads HTML-code for displaying webpage from controller program memory into TCP send buffer+    Carrega código HTML de uma página web da memória do controlador para o buffer de envio do TCP. 
-    Parameters+    Parâmetros
-    * //*buf// - data arrya to send using TCP. +    * //*buf// - array de dados para envio usando TCP. 
-    * //pos// - data end address in buffer which must be maintained if data is loaded in queue. The first address is 0. +    * //pos// - endereço do fim dos dados no buffer que tem de ser mantido caso os dados sejam carregados numa queue. O primeiro endereço é 0. 
-    * //*progmem_s// - string name that is saved into program memory and from where data is loaded into send array+    * //*progmem_s//nome de string que é gravado na memória do programa e de onde os dados são carregados para o buffer de envio
-    * Retruns end address of data array which can be input as a parameter for loading next HTML-code.+    * Devolve o endereço do fim do array de dados que pode ser usado como parâmetro de entrada para carregar o próximo código HTML.
  
   * **//void ethernet_print_webpage (uint8_t *buf,uint16_t dlen)//** \\   * **//void ethernet_print_webpage (uint8_t *buf,uint16_t dlen)//** \\
-    Dislays webpage according to preloaded HTML-code+    Mostra uma página web de acordo com o código HTML pré-carregado
-    Parameters+    Parâmetros
-    * //*buf// - Data array where HTLM is preloaded+    * //*buf// - Array de dados onde o HTML foi carregado
-    * //dplen// - End address of data in buffer to be displayed as HTML-code.+    * //dplen// - Endereço do fim dos dados no buffer a ser mostrado como código HTML.
  
  
-~~PB~~+<pagebreak>
  
-===== Example =====+===== Exemplo =====
  
 <code c> <code c>
pt/software/homelab/library/module/ethernet.1449681000.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0