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.
PacketBuffer.h
- Committer:
- jksoft
- Date:
- 2011-08-17
- Revision:
- 0:0e4cbd5ddf25
File content as of revision 0:0e4cbd5ddf25:
/** @file PacketBuffer.h
* @brief Packet Buffer
*/
#ifndef PacketBuffer_H
#define PacketBuffer_H
#include "mbed.h"
typedef struct
{
char *buf;
int size;
} PacketBufInf;
class PacketBuffer {
public:
/** init Stack class
* @param num buffering packet num
* @param packet_size size of packet(max size)
*/
PacketBuffer(int num,int packet_size);
~PacketBuffer();
/** put to Packet buffer
* @param packet packet data
* @param len packet length
* @return put length
*/
int PutPacket(char *packet, int len);
/** get from ring buffer
* @param packet packet data
* @return get length
*/
int GetPacket(char *packet);
void clear();
int available();
int use();
private:
PacketBufInf *p_buf;
int max_num,max_size;
int addr_w, addr_r;
};
#endif