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.
Fork of autonomous Robot Android by
PacketBuffer.h
00001 00002 00003 /** @file PacketBuffer.h 00004 * @brief Packet Buffer 00005 */ 00006 00007 #ifndef PacketBuffer_H 00008 #define PacketBuffer_H 00009 00010 #include "mbed.h" 00011 00012 typedef struct 00013 { 00014 char *buf; 00015 int size; 00016 } PacketBufInf; 00017 00018 class PacketBuffer { 00019 public: 00020 /** init Stack class 00021 * @param num buffering packet num 00022 * @param packet_size size of packet(max size) 00023 */ 00024 PacketBuffer(int num,int packet_size); 00025 ~PacketBuffer(); 00026 00027 /** put to Packet buffer 00028 * @param packet packet data 00029 * @param len packet length 00030 * @return put length 00031 */ 00032 int PutPacket(char *packet, int len); 00033 00034 /** get from ring buffer 00035 * @param packet packet data 00036 * @return get length 00037 */ 00038 int GetPacket(char *packet); 00039 00040 void clear(); 00041 int available(); 00042 int use(); 00043 00044 private: 00045 PacketBufInf *p_buf; 00046 int max_num,max_size; 00047 int addr_w, addr_r; 00048 }; 00049 #endif
Generated on Tue Jul 12 2022 14:15:58 by
 1.7.2
 1.7.2 
    