This is Ethernet Telescope.

Dependencies:   CameraC328 WIZnetInterface_Ricky mbed-src

Fork of Camera_PCStreaming_WIZwiki-W7500 by Ricky Kwon

Revision:
1:7bccc7b293ab
Parent:
0:b2764ee848ec
--- a/main.cpp	Tue Nov 24 04:00:27 2015 +0000
+++ b/main.cpp	Tue Mar 01 10:52:16 2016 +0000
@@ -3,7 +3,7 @@
 #include "CameraC328.h"
 
 /* CAMERA */
-#define USE_JPEG_HIGH_RESOLUTION    2//1=80x64 <--- not working -_-;;, 2=160x128, 3=320x240, 4=640x480
+#define USE_JPEG_HIGH_RESOLUTION    3//1=80x64 <--- not working -_-;;, 2=160x128, 3=320x240, 4=640x480
 #define START                       "start"
 #define END                         "end"
 CameraC328 camera(PA_13, PA_14, CameraC328::Baud115200);
@@ -14,10 +14,11 @@
 int dest_port = 1212;
 
 uint8_t mac_addr[6] = {0x00, 0x08, 0xdc, 0x12, 0x34, 0x45};
-const char ip_addr[] = "192.168.0.200"; 
+const char ip_addr[] = "192.168.0.123"; 
 const char mask_addr[] = "255.255.255.0"; 
 const char gateway_addr[] = "192.168.0.1"; 
 
+
 EthernetInterface eth;
 TCPSocketConnection Streaming;
 
@@ -32,10 +33,16 @@
 
 int main() {
 
-    printf("Hello WIZwiki-W7500 Camera PCStreaming World!\r\n"); 
+    printf("WIZKon Telescope\r\n"); 
       
     eth.init(mac_addr, ip_addr, mask_addr, gateway_addr); //Use Static
     eth.connect();
+    while(1) 
+    { //Wait link up
+        if(eth.link() == true)
+            break;
+    }
+    printf("My IP Address is %s\n\r", eth.getIPAddress());
     sync();
     init();
     while (Streaming.connect(dest_ip, dest_port) < 0) {
@@ -51,16 +58,6 @@
         Streaming.send(START, sizeof(START)-1);
         test_jpeg_snapshot_picture();
         Streaming.send(END, sizeof(END)-1); 
-        
-        
-        /*    
-        if (!strncmp(buf, "123", 3)){
-        }
-        else if(!strncmp(buf, "220", 3)){
-        }
-        else if(!strncmp(buf, "789", 3)){
-        }
-        */
     }
 }