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.
Dependencies: DHT DS_1337 SDFileSystem USBDevice mbed
UsbComms Class Reference
The UsbComms class handles input and output for the serial port connected to a PC The main run() function cycles through checking for input and copying to a buffer to be handled, and checking the output buffer to see if there is anything to be sent out. More...
#include <UsbComms.h>
Inherits AbstractHandler.
Public Types | |
| enum | request_t { usbreq_PrintToTerminal, usbreq_PrintToTerminalTimestamp } |
Public Member Functions | |
| void | run () |
| run is inherited by each Handler class. It is called from the main while loop in main.cpp. It runs through the state machine, specific to each Handler class. | |
| void | setRequest (int request, void *data=0) |
| setRequest sets a request that the handler will complete when it is able to | |
Protected Attributes | |
| MyTimers * | m_timer |
| Handler classes use timers to pause in the state machine, and continue after delay has finished. | |
Detailed Description
The UsbComms class handles input and output for the serial port connected to a PC The main run() function cycles through checking for input and copying to a buffer to be handled, and checking the output buffer to see if there is anything to be sent out.
Data can be queued for output by copying it to the circular buffer
Definition at line 18 of file UsbComms.h.
Member Enumeration Documentation
| enum request_t |
- Enumerator:
usbreq_PrintToTerminal Print to terminal normally.
usbreq_PrintToTerminalTimestamp Print to terminal, including the timestamp.
Definition at line 28 of file UsbComms.h.
Member Function Documentation
| void run | ( | ) | [virtual] |
run is inherited by each Handler class. It is called from the main while loop in main.cpp. It runs through the state machine, specific to each Handler class.
Implements AbstractHandler.
Definition at line 29 of file UsbComms.cpp.
| void setRequest | ( | int | request, |
| void * | data = 0 |
||
| ) | [virtual] |
setRequest sets a request that the handler will complete when it is able to
- Parameters:
-
request unique to the reimplemented class (an enum) that will be completed in the state machine message an optional array of information relevant to the request
Implements AbstractHandler.
Definition at line 64 of file UsbComms.cpp.
Field Documentation
Handler classes use timers to pause in the state machine, and continue after delay has finished.
Definition at line 31 of file AbstractHandler.h.
Generated on Tue Jul 12 2022 23:07:44 by
1.7.2