Vorlage für Projekt

Dependencies:   EthernetInterface mbed-rtos

Fork of Telemetrie_eth_h2m by Hochschule München

Revision:
7:a269ac8c3259
Parent:
6:abadad863420
Child:
8:2cd23c180dfe
diff -r abadad863420 -r a269ac8c3259 Telemetry.h
--- a/Telemetry.h	Sun Nov 22 21:31:55 2015 +0000
+++ b/Telemetry.h	Mon Nov 30 14:27:16 2015 +0000
@@ -60,8 +60,8 @@
  * struct_test  test;
  *
  * uint8_t* struct_id[] {
- *                         &test     //ID0
- *                        };
+ *                       &test     //ID0
+ *                      };
  *                        
  * main
  * {
@@ -90,7 +90,7 @@
  *
  *    wait(1);
  *   }        
- *}          
+ * }          
  * 
  * @endcode
  */ 
@@ -101,8 +101,11 @@
 {
     public:
         //! Create Ethernet Interface
-        Telemetry();
-
+        Telemetry(PinName orange, PinName green);
+        
+        DigitalOut orange;
+        DigitalOut green;
+        
         //! IP Address of mbed Interface
         char* ip_self;
 
@@ -112,8 +115,11 @@
         //! IP Addess and Port of control Server
         Endpoint controller;
 
-        //! IP Addess and Port of incoming MSG
-        Endpoint input_Host;
+        //! IP Addess and Port of MSG on Server Port
+        Endpoint input_Server;
+        
+        //! IP Addess and Port of MSG on Client Port
+        Endpoint input_Client;
 
         
         #ifdef DEBUG
@@ -132,44 +138,55 @@
 
         
         //! Connect Port TCP 
-        void ConnectSocket_tcp(Endpoint Host);
+        void ConnectSocket_TCP(Endpoint Host);
         
-        //! Connect Port UDP receive 
-        void ConnectSocket_udp_rec(int Port);
+        //! Connect Port for UDP Client  
+        void ConnectSocket_UDP_Client();
         
-        //! Connect Port UDP send
-        void ConnectSocket_udp_send();
+        //! Connect Port for UDP Server
+        void ConnectSocket_UDP_Server(int Port);
 
         
         //! Close Port TCP
-        void CloseSocket_tcp();
+        void CloseSocket_TCP();
         
-        //! Close Port UDP receive
-        void CloseSocket_udp_rec();
+        //! Close Port UDP Client
+        void CloseSocket_UDP_Client();
         
         //! Close Port UDP send
-        void CloseSocket_udp_send();
+        void CloseSocket_UDP_Server();
 
         
         //! Struct Check Sum calc
         uint8_t do_cs(uint8_t *buffer); 
+    
         
-        //! Read UDP Packet 
-        int  Rec_Data_UDP(char *buffer, int size);
+        //! Read UDP Packet on Client Port
+        int  Rec_Data_UDP_Client(char *buffer, int size);
+
+        //! Read UDP Packet on Server Port
+        int  Rec_Data_UDP_Server(char *buffer, int size);
         
-        //! Check UDP Packet of containing Struct 
-        bool Rec_Struct_UDP(uint8_t *buffer);
+        //! Check Packet of containing Struct 
+        bool Rec_Struct(uint8_t *buffer);
         
         //! Read TCP Packet
         int  Rec_Data_TCP(char *buffer, int size);
 
         
-        //! Send UDP Packet
-        void Send_Data_UDP(Endpoint Server, char* Daten, int size);
+        //! Send UDP Packet as Client
+        void Send_Data_UDP_Client(Endpoint Server, char* Daten, int size);
+
+        //! Send UDP Packet as Server
+        void Send_Data_UDP_Server(Endpoint Client, char* Daten, int size);
+                
+        //! Send Struct as UDP Client
+        void Send_Struct_UDP_Client(Endpoint Server, uint8_t* Daten);
         
-        //! Send Struct as UDP Packet
-        void Send_Struct_UDP(Endpoint Server, uint8_t* Daten);
-        
+        //! Send Struct as UDP Server
+        void Send_Struct_UDP_Server(Endpoint Client, uint8_t* Daten);       
+       
+       
         //! Send TCP Packet
         void Send_Data_TCP(char* Host, char* Daten);