Microchip Technology Humidity Sensor PICtail Specifikace Strana 66

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 149
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 65
58
During processing of this file, HTTP encounters the „%04‟ string. After parsing it,
HTTP makes a callback. HTTPGetVar(4, HTTP_START_OF_VAR, &value). In
Figure 20, the main user application implements HTTPGetVar function as
follows:
WORD HTTPGetVar(BYTE var, WORD ref, BYTE *val)
{
// Identify variable.
// Is it RB5 ?
if ( var == 4 )
{
// We will simply return „1‟ if RB5 is high,
// or „0‟ if low.
if ( PORTBbits.RB5 )
*val = „1‟;
else
*val = „0;
// Tell HTTP that this is last byte of
// variable value.
return HTTP_END_OF_VAR;
}
else
// Check for other variables...
...
}
Figure 20 HTTPGetVar Function
2.8 MPFS
The Microchip HTTP server uses a simple file system (MPFS) to store
Webpages. The image of the file system can be stored in on-chip program
memory, or on an external serial EEPROM. Below is Figure 21 which describes
how the MPFS stores multiple files:
Zobrazit stránku 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 ... 148 149

Komentáře k této Příručce

Žádné komentáře