This is a console for interacting with Vodafone dongles.

Dependencies:   mbed-rtos VodafoneUSBModem mbed

This is a bridge between a serial driven console and a serial driven cellular modem or modem interface. This was written to complement our collaboration with mbed: See https://mbed.org/users/mbed_official/code/VodafoneUSBModem/ for further information.

For example, one can use GNU screen or PuTTY (two popular consoles) to interact with a Vodafone K3770 USB dongle. In the image below I used the UNIX version of PuTTY:

/media/uploads/ashleymills/atcons.png

Support is provided for line-based consoles, which send one line at a time, and for character based consoles.

For character based consoles, the following line-editing features are provided:

  • In-line editing (deletion, left/right arrow keys, insertion)
  • Command history (via up/down arrow keys)

Line buffer length, and command history depth, are compile-time options.

--

How to use:

Compile and save to mbed.

Connect PuTTY or GNU screen to serial port.

If you use GNU screen you probably already know what you are doing.

If you use PuTTY, you need to set the options to specify the serial device and, set the baud rate, and set the "Connection Type" to "Serial":

/media/uploads/ashleymills/putty0.png

You need to set the keyboard to send Control-H for backspace, and use "Linux" function keys and keypad:

/media/uploads/ashleymills/putty1.png

Committer:
ashleymills
Date:
Tue Sep 18 09:24:41 2012 +0000
Revision:
4:6971bded3ebd
Parent:
3:6b3ca3af97cf
Child:
10:b2c5a4b21bd8
Added support for line-based consoles.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ashleymills 1:719c0f047c34 1 #pragma once
ashleymills 1:719c0f047c34 2 #include "Console.h"
ashleymills 2:8cc63f7a24cf 3 #include "VodafoneUSBModem.h"
ashleymills 1:719c0f047c34 4
ashleymills 4:6971bded3ebd 5 class ATConsole : public Console, public IATCommandsProcessor, protected IATEventsHandler {
ashleymills 1:719c0f047c34 6 public:
ashleymills 4:6971bded3ebd 7
ashleymills 4:6971bded3ebd 8 /** Constructor
ashleymills 4:6971bded3ebd 9 @param terminal Console interface to the driving computer.
ashleymills 4:6971bded3ebd 10 @param lineLength The maximum length of line supported (character console only).
ashleymills 4:6971bded3ebd 11 @param numLines Number of lines of history to keep (character console only).
ashleymills 4:6971bded3ebd 12 @param characterBased true if the driving console is character based, false if line based.
ashleymills 4:6971bded3ebd 13 @param atInterface A Pointer to the ATInterface of the modem.
ashleymills 4:6971bded3ebd 14 @return An ATConsole
ashleymills 4:6971bded3ebd 15 */
ashleymills 4:6971bded3ebd 16 ATConsole(
ashleymills 4:6971bded3ebd 17 Serial *terminal,
ashleymills 4:6971bded3ebd 18 int lineLength,
ashleymills 4:6971bded3ebd 19 int numLines,
ashleymills 4:6971bded3ebd 20 bool characterBased,
ashleymills 4:6971bded3ebd 21 ATCommandsInterface* atInterface
ashleymills 4:6971bded3ebd 22 );
ashleymills 1:719c0f047c34 23 ~ATConsole();
ashleymills 2:8cc63f7a24cf 24 virtual void update();
ashleymills 1:719c0f047c34 25
ashleymills 2:8cc63f7a24cf 26 private:
ashleymills 1:719c0f047c34 27 ATCommandsInterface *_atInterface;
ashleymills 1:719c0f047c34 28 ATCommandsInterface::ATResult _cmdResult;
ashleymills 2:8cc63f7a24cf 29 virtual void processCommand();
ashleymills 1:719c0f047c34 30 virtual int onNewATResponseLine(ATCommandsInterface* pInst, const char* line);
ashleymills 1:719c0f047c34 31 virtual int onNewEntryPrompt(ATCommandsInterface* pInst);
ashleymills 4:6971bded3ebd 32 bool _gettingSMSData;
ashleymills 4:6971bded3ebd 33 char _smsMessage[256];
ashleymills 4:6971bded3ebd 34
ashleymills 4:6971bded3ebd 35 protected:
ashleymills 2:8cc63f7a24cf 36 virtual void onEvent(const char* atCode, const char* evt);
ashleymills 2:8cc63f7a24cf 37 virtual void onDispatchStart();
ashleymills 2:8cc63f7a24cf 38 virtual void onDispatchStop();
ashleymills 2:8cc63f7a24cf 39 virtual bool isATCodeHandled(const char* atCode);
ashleymills 4:6971bded3ebd 40
ashleymills 0:6c831cc49d22 41 };