Changeset 115

Show
Ignore:
Timestamp:
12/11/07 05:10:43 (12 months ago)
Author:
follower
Message:

Add single byte 'print' function to send data. The name is to match the 'Serial.print' function. TODO: Print strings etc? Change demo to echo data received to sender.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde

    r114 r115  
    229229    int available(); 
    230230    int read(); 
     231    void print(uint8_t); 
    231232    void NetworkConnection::close(); 
    232233 
     
    311312 return (getSn_SR(_socket) == SOCK_ESTABLISHED); 
    312313 
     314 
     315void NetworkConnection::print(uint8_t b) { 
     316  /* 
     317 
     318   */   
     319  if (isConnected()) { 
     320    send(_socket, &b, 1); 
     321  } else { 
     322    // Just drop it if we're not connected. 
     323  } 
     324} 
    313325 
    314326void NetworkConnection::close() { 
     
    443455  while (conn.isConnected()) { 
    444456     if (conn.available()) { 
    445        Serial.print(conn.read(), BYTE); 
     457       // Serial.print(conn.read(), BYTE); 
     458       conn.print(conn.read()); 
    446459     }  
    447460  }