- Timestamp:
- 12/10/07 05:29:28 (13 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde
r102 r103 224 224 225 225 public: 226 NetworkConnection(uint 8_t port); // TODO: Add UDP, TCP choice?226 NetworkConnection(uint16_t port); // TODO: Add UDP, TCP choice? 227 227 228 228 void listen(); // TODO: Return a useful value? … … 234 234 }; 235 235 236 NetworkConnection::NetworkConnection(uint 8_t port) {236 NetworkConnection::NetworkConnection(uint16_t port) { 237 237 /* 238 238 … … 266 266 NetworkInterface(Wiz810MjDevice& networkDevice); 267 267 268 NetworkConnection listen(uint 8_t port);268 NetworkConnection listen(uint16_t port); 269 269 270 270 Wiz810MjDevice& device; // TODO: Make this a generic "network device" interface … … 293 293 }; 294 294 295 NetworkConnection NetworkInterface::listen(uint 8_t port) {295 NetworkConnection NetworkInterface::listen(uint16_t port) { 296 296 /* 297 297 298 299 NOTE: For reasons I don't understand, this FAILS TO WORK if port >255. 300 The port that gets opened is ~(port mod 255) but if you limit 301 port to be uint8_t for example you don't get an error until 302 the port number is bigger than 'long'. 303 304 TODO: Track and fix this for port numbers > 255. 305 306 298 307 299 308 Returns a NetworkConnection listening on the specified TCP port. … … 342 351 343 352 Serial.println("Setup exit..."); 344 353 354 /**/ 355 Serial.println("Test sockets..."); 356 357 NetworkConnection conn = Network.listen(7); 358 359 Serial.println("Waiting for connection..."); 360 361 while (!conn.isConnected()) { 362 //Serial.print(!conn.isConnected()); 363 delay(500); 364 } 365 366 Serial.println("Connected..."); 367 368 369 Serial.println("End test and dummy loop"); 370 while (1) {} 371 /**/ 345 372 } 346 373