This is Webservice SDK for mbed. LPCXpresso1769/LPC1768/FRDM-K64F/LPC4088

Dependents:   MbedFileServer_1768MiniDK2 RedWireBridge IssueDebug_gcc MiMicRemoteMCU-for-Mbed ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers NyLPC_cHttpStream.h Source File

NyLPC_cHttpStream.h

00001 /*********************************************************************************
00002  * PROJECT: MiMic
00003  * --------------------------------------------------------------------------------
00004  *
00005  * This file is part of MiMic
00006  * Copyright (C)2011 Ryo Iizuka
00007  *
00008  * MiMic is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License as published
00010  * by the Free Software Foundation, either version 3 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public License
00019  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020  *
00021  * For further information please contact.
00022  *  http://nyatla.jp/
00023  *  <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
00024  *
00025  *********************************************************************************/
00026 #ifndef NyLPC_TcHttpStream_h
00027 #define NyLPC_TcHttpStream_h
00028 
00029 #include "NyLPC_config.h"
00030 #include "NyLPC_iHttpPtrStream.h"
00031 
00032 
00033 
00034 #if NyLPC_CONFIG_cHttpStream_DEBUG == 1
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif /* __cplusplus */
00038 
00039 typedef int NyLPC_TiMiMicIpTcpSocket_t;
00040 void NyLPC_iTcpSocket_initialized(void* inst,const char* rb,int l);
00041 void* NyLPC_iTcpSocket_allocSendBuf(void* inst,NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_len,NyLPC_TUInt32 i_to);
00042 NyLPC_TBool NyLPC_iTcpSocket_psend(void* inst,void* i_buf,NyLPC_TUInt16 i_len,NyLPC_TUInt32 i_to);
00043 NyLPC_TInt32 NyLPC_iTcpSocket_precv(void* i_inst,const void** o_buf_ptr,NyLPC_TUInt32 i_wait_msec);
00044 void NyLPC_iTcpSocket_pseek(void* i_inst,NyLPC_TUInt16 i_seek);
00045 
00046 #ifdef __cplusplus
00047 }
00048 #endif /* __cplusplus */
00049 
00050 #else
00051 #include "../netif/NyLPC_iTcpSocket.h"
00052 #endif
00053 
00054 #ifdef __cplusplus
00055 extern "C" {
00056 #endif /* __cplusplus */
00057 
00058 /**
00059  * HttpStreamを供給するためのクラスです。このクラスは、NyLPC_TiHttpPtrStream_TInterfaceインタフェイスを実装します。
00060  */
00061 typedef struct NyLPC_TcHttpStream NyLPC_TcHttpStream_t;
00062 
00063 
00064 
00065 struct NyLPC_TcHttpStream
00066 {
00067     NyLPC_TiHttpPtrStream_t super;
00068     NyLPC_TiTcpSocket_t* _ref_sock;
00069     NyLPC_TUInt8* txb;//送信バッファ
00070     NyLPC_TUInt16 txb_size;//送信バッファサイズ
00071     NyLPC_TUInt16 tx_len;  //送信サイズ
00072     NyLPC_TiHttpPtrStream_ET re_type;
00073     NyLPC_TiHttpPtrStream_ET we_type;
00074 };
00075 
00076 
00077 
00078 /**
00079  * 接続済のソケットをストリームに抽象化します。
00080  * このインスタンスは、NyLPC_TiHttpPtrStream_TInterfaceインタフェイスを提供します。
00081  * @
00082  */
00083 NyLPC_TBool NyLPC_cHttpStream_initialize(NyLPC_TcHttpStream_t* i_inst,NyLPC_TiTcpSocket_t* i_ref_sock);
00084 
00085 void NyLPC_cHttpStream_finalize(NyLPC_TcHttpStream_t* i_inst);
00086 
00087 #ifdef __cplusplus
00088 }
00089 #endif /* __cplusplus */
00090 
00091 #endif