Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MTS-Socket by
Diff: Transport.h
- Revision:
- 1:096f484f3ae6
- Parent:
- 0:eef30dbe1130
- Child:
- 2:ebc6129de4e8
diff -r eef30dbe1130 -r 096f484f3ae6 Transport.h
--- a/Transport.h Thu May 15 22:02:08 2014 +0000
+++ b/Transport.h Mon May 19 12:36:11 2014 -0500
@@ -1,4 +1,36 @@
#ifndef TRANSPORT_H
#define TRANSPORT_H
-#endif
\ No newline at end of file
+#include "mbed.h"
+#include "IPStack.h"
+
+/** This class has been added to the standard mbed Socket library enabling people
+* to use the Socket library interfaces for different transports. Use this class prior
+* to instantiating any of the other classes in this folder to determine the underlying
+* transport that will be used by them. It is important to know that the transport classes
+* themsleves which derive from IPStack.h, must be properly initialized and connected before any
+* of the Socket package classes can be used.
+*/
+class Transport
+{
+public:
+ /** This method allows you to set the transport to be used when creatin other
+ * objects from the Socket folder like TCPSocketConnection and UDPSocket.
+ *
+ * @param type the type of underlying transport to be used as an IPStack object.
+ */
+ static void setTransport(IPStack* type);
+
+ /** This method is used within the Socket class to get the appropraite transport
+ * as an IPStack object. In general you do not need to call this directly, but
+ * simply use the other classes in this folder.
+ *
+ * @returns a pointer to an object that implements IPStack.
+ */
+ static IPStack* getInstance();
+
+private:
+ static IPStack* transport; //Member variable that holds an custom transport type.
+};
+
+#endif /* TRANSPORT_H */
