Operating System

Dependencies:   UnitTest mDNS wolfcrypt wolfSSL

This is an operating system for K64F. It includes ssh server, POST, a web-server and mDNS.

Revision:
1:4059ac7ebc65
Parent:
0:97ba3e2cd071
Child:
2:453e73d66757
--- a/main.cpp	Thu Jun 13 13:08:37 2019 +0000
+++ b/main.cpp	Thu Jun 13 13:54:10 2019 +0000
@@ -15,18 +15,10 @@
 DigitalOut red(LED_RED);
 DigitalOut blue(LED_BLUE);
 DigitalOut green(LED_GREEN);
-
-/*class TransmissionControlProtocolHandler
-        {
-        public:
-            TransmissionControlProtocolHandler();
-            ~TransmissionControlProtocolHandler();
-            virtual bool HandleTransmissionControlProtocolMessage(TCPSocket* socket, char* data, uint16_t size);
-        };
         
-class PrintfTCPHandler : public TransmissionControlProtocolHandler
+class PrintfTCPHandler
 {
-public:*/
+public:
     bool HandleTransmissionControlProtocolMessage(TCPSocket* socket, char* data, uint16_t size)
     {
         if(size > 9
@@ -48,7 +40,7 @@
 
         return true;
     }
-//};
+};
 
 int main() {
     red = 1;
@@ -156,7 +148,7 @@
 
     printf("\n\n\n\n");
 
-    //PrintfTCPHandler tcphandler;
+    PrintfTCPHandler tcphandler;
     TCPServer server;
     UDPSocket sockUDP(&interface);                 //creat Ethernet socket
     SocketAddress sockAddr(SERVER_IP, PORT);
@@ -184,6 +176,13 @@
     //UserDatagramProtocolSocket* udpsocket = udp.Listen(1234);
     //udp.Bind(udpsocket, &udphandler);
     
+    /*unsigned int addressId = 1;
+    unsigned int address = flash_size() - SECTOR_SIZE; //Write in last sector                                     
+    erase_sector(address);                
+    program_flash(address, (char*)&addressId, 4);      //an integers has four bytes each.
+    
+    unsigned int *data   = (unsigned int*)address;     //Read*/
+                    
     while (true){
           //printf("\nCLIENT - Sending '%i' to server %s\r\n", screen[0], SERVER_IP);       //print message to send
           sockUDP.sendto(SERVER_IP, PORT, screen, sizeof(screen));
@@ -197,7 +196,7 @@
       printf("\r\n");
 #endif
 
-          HandleTransmissionControlProtocolMessage(&client, (char*)buffer, len);
+          tcphandler.HandleTransmissionControlProtocolMessage(&client, (char*)buffer, len);
           wait(0.03333333);
        }
 }
\ No newline at end of file