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.
Dependents: GPS_6Axis_DataLogger_SD_UDP
Fork of C027_Support by
Diff: MDM.h
- Revision:
- 19:2b5d097ca15d
- Parent:
- 18:e5697801df29
- Child:
- 21:c4d64830bf02
diff -r e5697801df29 -r 2b5d097ca15d MDM.h
--- a/MDM.h Fri Mar 14 13:07:48 2014 +0000
+++ b/MDM.h Mon Mar 24 07:38:05 2014 +0000
@@ -3,10 +3,15 @@
#include "mbed.h"
#include "Pipe.h"
#include "SerialPipe.h"
-#include "C027_PinNames.h"
-#define RX_SIZE 256
-#define TX_SIZE 128
+#ifdef TARGET_UBLOX_C027
+ // if we detect the C027 platform we will assign the
+ // default pinname and baudrate in the constructor
+ // this helper macro will be used.
+ #define _C027DEFAULT(name) = name
+#else
+ #define _C027DEFAULT(name)
+#endif
class MDMParser
{
@@ -31,11 +36,15 @@
class MDMSerial : public SerialPipe, public MDMParser
{
public:
- MDMSerial(PinName tx = MDMTXD, PinName rx = MDMRXD, int baudrate = MDMBAUD,
- int rxSize = RX_SIZE, int txSize = TX_SIZE);
- MDMSerial(PinName tx = MDMTXD, PinName rx = MDMRXD, int baudrate = MDMBAUD,
- PinName rts = MDMRTS, PinName cts = MDMCTS,
- int rxSize = RX_SIZE, int txSize = TX_SIZE);
+ MDMSerial(PinName tx _C027DEFAULT(MDMTXD),
+ PinName rx _C027DEFAULT(MDMRXD),
+ int baudrate _C027DEFAULT(MDMBAUD),
+#if DEVICE_SERIAL_FC
+ PinName rts _C027DEFAULT(MDMRTS),
+ PinName cts _C027DEFAULT(MDMCTS),
+#endif
+ int rxSize = 256 ,
+ int txSize = 256 );
virtual int getLine(char* buffer, int length);
virtual int getResp(char* buffer, int length);
protected:
