keil_examples/EMAC/easyweb.c
// searches the TX-buffer for special strings and replaces them
// with dynamic values (AD-converter results)
searches the TX-buffer for special strings and replaces them
with dynamic values (AD-converter results)
searches the TX - buffer for special strings and replaces them with dynamic values ( AD - converter results )
void InsertDynamicValues(void)
{
  unsigned char *Key;
           char NewKey[5];
  unsigned int i;
  if (TCPTxDataCount < 4) return;                     
  Key = TCP_TX_BUF;
  for (i = 0; i < (TCPTxDataCount - 3); i++)
  {
    if (*Key == 'A')
     if (*(Key + 1) == 'D')
       if (*(Key + 3) == '%')
         switch (*(Key + 2))
         {
           case '7' :                                 
           {
             sprintf(NewKey, "%3u", GetAD7Val());     
             memcpy(Key, NewKey, 3);                  
             break;
           }
           case 'A' :                                 
           {
             sprintf(NewKey, "%3u", GetTempVal());    
             memcpy(Key, NewKey, 3);                  
             break;
           }
         }
    Key++;
  }
}
void InsertDynamicValues ( void ) { unsigned char * Key ; char NewKey [ 5 ] ; unsigned int i ; if ( TCPTxDataCount < 4 ) return ; Key = TCP_TX_BUF ; for ( i = 0 ; i < ( TCPTxDataCount - 3 ) ; i ++ ) { if ( * Key == ' ' ) if ( * ( Key + 1 ) == ' ' ) if ( * ( Key + 3 ) == ' ' ) switch ( * ( Key + 2 ) ) { case ' ' : { sprintf ( NewKey , " " , GetAD7Val ( ) ) ; memcpy ( Key , NewKey , 3 ) ; break ; } case ' ' : { sprintf ( NewKey , " " , GetTempVal ( ) ) ; memcpy ( Key , NewKey , 3 ) ; break ; } } Key ++ ; } }
searches the TX-buffer for special strings and replaces them
with dynamic values (AD-converter results)
searches the TX - buffer for special strings and replaces them with dynamic values ( AD - converter results )
// there can't be any special string // "AD7%"? // insert AD converter value // channel 7 (P6.7) // "ADA%"? // insert AD converter value // channel 10 (temp.-diode)