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.
Diff: Node/Observer/BufferedOutput/BufferedOutput.h
- Revision:
- 0:99928431bb44
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Node/Observer/BufferedOutput/BufferedOutput.h Tue Jul 07 09:36:12 2015 +0000 @@ -0,0 +1,48 @@ + +#ifndef BUFFEREDOUTPUT_H +#define BUFFEREDOUTPUT_H + +// Dependancies +#include "mbed.h" +#include "debug.h" + +// Circular buffer for mavlink characters +const int framesBufferSize = 255; + +class BufferedOutput +{ + public: + + // Constructor + BufferedOutput( Serial& serial ) ; + + // Contains the MAVlink passthrough background tasks + void executeBackgroundTask() ; + + // Adding a frame to the output buffer + //void addFrame( char* frame, char length ) ; + + // Adding a character to the output buffer + void addChar( char c ) ; + + protected: + + // Serial object where outward frames are written + Serial& framesOut ; + + // Frames Send Callback + void framesOutCallback() ; + + // Buffer which hold mavlink characters received via the serial connection + char framesBuffer[ framesBufferSize + 1 ] ; + // Pointers to entry and exit points to the buffer + volatile char framesBufferIn ; + volatile char framesBufferOut ; + + // Indicates if a frame is currently being transfered over serial + bool frameTransferInProgress ; + +} ; + + +#endif \ No newline at end of file