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.
Node/Observer/BufferedOutput/BufferedOutput.h
- Committer:
- millanea
- Date:
- 2015-07-07
- Revision:
- 0:99928431bb44
File content as of revision 0:99928431bb44:
#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