TCP Server that can be used as a debug interface
Fork of TCPDebug by
Debug.h
00001 /* 00002 ** File name: Debug.h 00003 ** Descriptions: TCP Server that sends debug messages to a connected client 00004 ** 00005 **------------------------------------------------------------------------------------------------------ 00006 ** Created by: Ivan Shindev 00007 ** Created date: 06/11/2013 00008 ** Version: 1.0 00009 ** Descriptions: The original version 00010 ** 00011 **------------------------------------------------------------------------------------------------------ 00012 ** Modified by: 00013 ** Modified date: 00014 ** Version: 00015 ** Descriptions: 00016 ********************************************************************************************************/ 00017 /* How to use the library 00018 Include Debug.h in any file that sends debugging messages 00019 00020 Start the debugging server in the main 00021 initDebug(); //initialize Debug server 00022 startDebug(debug_port); //start the Debug server 00023 while(!isDebugConnected()) //do nothing until a debug client is connected (optional) 00024 { 00025 00026 } 00027 00028 Send a debugging message to the connected client using sendDebugMessage(char *message) 00029 Example: sendDebugMessage("Initialization failed"); 00030 00031 00032 */ 00033 #include "EthernetInterface.h" 00034 #include "mbed.h" 00035 00036 #ifndef __DEBUG_H 00037 #define __DEBUG_H 00038 00039 00040 /* connectDebug(void const *port) is the main Debug server Thread 00041 00042 */ 00043 void connectDebug(void const *port); 00044 00045 /* sendDebugMessage(char *message) sends a message to the connected client 00046 00047 */ 00048 void sendDebugMessage(char *message); 00049 00050 /* startDebug(int port) starts the debugging server in a new Thread 00051 00052 */ 00053 void startDebug(int port); 00054 00055 /* initDebug() initializes the _debug_connected variable 00056 00057 */ 00058 void initDebug(); 00059 00060 00061 int isDebugConnected(); 00062 #endif
Generated on Wed Jul 13 2022 07:17:16 by 1.7.2