Vorlage für Projekt
Dependencies: EthernetInterface mbed-rtos
Fork of Telemetrie_eth_h2m by
Telemetry.h@0:c0179f2ad295, 2015-05-02 (annotated)
- Committer:
- HMFK03LST1
- Date:
- Sat May 02 11:02:37 2015 +0000
- Revision:
- 0:c0179f2ad295
- Child:
- 1:2df3958877f2
1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
HMFK03LST1 | 0:c0179f2ad295 | 1 | /*------------------------------------------------*/ |
HMFK03LST1 | 0:c0179f2ad295 | 2 | /*Define LED: */ |
HMFK03LST1 | 0:c0179f2ad295 | 3 | /* LEDSerial = LED1 */ |
HMFK03LST1 | 0:c0179f2ad295 | 4 | /* LEDEthernet = LED2 */ |
HMFK03LST1 | 0:c0179f2ad295 | 5 | /* LEDSOCKET = LED3 */ |
HMFK03LST1 | 0:c0179f2ad295 | 6 | /* LEDWAITFORANSWER = LED4 */ |
HMFK03LST1 | 0:c0179f2ad295 | 7 | /* */ |
HMFK03LST1 | 0:c0179f2ad295 | 8 | /*Define DEBUG: */ |
HMFK03LST1 | 0:c0179f2ad295 | 9 | /* Ausgabe über Serielle Schnittstelle */ |
HMFK03LST1 | 0:c0179f2ad295 | 10 | /* (USBRX/USBTX) */ |
HMFK03LST1 | 0:c0179f2ad295 | 11 | /* */ |
HMFK03LST1 | 0:c0179f2ad295 | 12 | /*Autor: Sebastian Hauzenberger */ |
HMFK03LST1 | 0:c0179f2ad295 | 13 | /*------------------------------------------------*/ |
HMFK03LST1 | 0:c0179f2ad295 | 14 | |
HMFK03LST1 | 0:c0179f2ad295 | 15 | #ifndef TELEMETRY |
HMFK03LST1 | 0:c0179f2ad295 | 16 | #define TELEMETRY |
HMFK03LST1 | 0:c0179f2ad295 | 17 | |
HMFK03LST1 | 0:c0179f2ad295 | 18 | //#define LED |
HMFK03LST1 | 0:c0179f2ad295 | 19 | #define DEBUG |
HMFK03LST1 | 0:c0179f2ad295 | 20 | |
HMFK03LST1 | 0:c0179f2ad295 | 21 | #include "mbed.h" |
HMFK03LST1 | 0:c0179f2ad295 | 22 | #include "EthernetInterface.h" |
HMFK03LST1 | 0:c0179f2ad295 | 23 | #include <string> |
HMFK03LST1 | 0:c0179f2ad295 | 24 | #include <sstream> |
HMFK03LST1 | 0:c0179f2ad295 | 25 | |
HMFK03LST1 | 0:c0179f2ad295 | 26 | class Telemetry |
HMFK03LST1 | 0:c0179f2ad295 | 27 | { |
HMFK03LST1 | 0:c0179f2ad295 | 28 | public: |
HMFK03LST1 | 0:c0179f2ad295 | 29 | Telemetry(); |
HMFK03LST1 | 0:c0179f2ad295 | 30 | #ifdef DEBUG |
HMFK03LST1 | 0:c0179f2ad295 | 31 | void InitUSBSerialConnection(); |
HMFK03LST1 | 0:c0179f2ad295 | 32 | #endif |
HMFK03LST1 | 0:c0179f2ad295 | 33 | |
HMFK03LST1 | 0:c0179f2ad295 | 34 | bool InitEthernetConnection(); |
HMFK03LST1 | 0:c0179f2ad295 | 35 | bool InitEthernetConnection(const char* IPAdress, const char* SubNetMask, const char* GateWay); |
HMFK03LST1 | 0:c0179f2ad295 | 36 | void CloseEthernetConnection(); |
HMFK03LST1 | 0:c0179f2ad295 | 37 | |
HMFK03LST1 | 0:c0179f2ad295 | 38 | void ConnectSocket_tcp(char* Host); |
HMFK03LST1 | 0:c0179f2ad295 | 39 | void ConnectSocket_udp(); |
HMFK03LST1 | 0:c0179f2ad295 | 40 | void CloseSocket(); |
HMFK03LST1 | 0:c0179f2ad295 | 41 | |
HMFK03LST1 | 0:c0179f2ad295 | 42 | void TransmitDataoverUDP(char *Host, int Port, string Daten); |
HMFK03LST1 | 0:c0179f2ad295 | 43 | void TransmitDataoverTCP(char *Host, string Daten, string Username, string Passwort); |
HMFK03LST1 | 0:c0179f2ad295 | 44 | void ReadAnswerandTransmitoverSerial(); |
HMFK03LST1 | 0:c0179f2ad295 | 45 | string ReadAnswer(); |
HMFK03LST1 | 0:c0179f2ad295 | 46 | }; |
HMFK03LST1 | 0:c0179f2ad295 | 47 | |
HMFK03LST1 | 0:c0179f2ad295 | 48 | #endif |