00001 00002 /* 00003 *************************************************************************** 00004 * Copyright 2007,2008 Impinj, Inc. 00005 * 00006 * Licensed under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 * 00018 *************************************************************************** 00019 */ 00020 00021 00022 00023 00024 struct LLRP_SFrameExtract; 00025 struct LLRP_SFrameDecoder; 00026 struct LLRP_SFrameDecoderStream; 00027 struct LLRP_SFrameEncoder; 00028 struct LLRP_SFrameEncoderStream; 00029 00030 typedef struct LLRP_SFrameExtract LLRP_tSFrameExtract; 00031 typedef struct LLRP_SFrameDecoder LLRP_tSFrameDecoder; 00032 typedef struct LLRP_SFrameDecoderStream LLRP_tSFrameDecoderStream; 00033 typedef struct LLRP_SFrameEncoder LLRP_tSFrameEncoder; 00034 typedef struct LLRP_SFrameEncoderStream LLRP_tSFrameEncoderStream; 00035 00036 00037 struct LLRP_SFrameExtract 00038 { 00039 enum { 00040 LLRP_FRAME_UNKNOWN, 00041 LLRP_FRAME_READY, 00042 LLRP_FRAME_ERROR, 00043 LLRP_FRAME_NEED_MORE 00044 } eStatus; 00045 00046 llrp_u32_t MessageLength; 00047 llrp_u16_t MessageType; 00048 llrp_u8_t ProtocolVersion; 00049 llrp_u32_t MessageID; 00050 00051 unsigned int nBytesNeeded; 00052 }; 00053 00054 struct LLRP_SFrameDecoder 00055 { 00056 LLRP_tSDecoder decoderHdr; 00057 00058 unsigned char * pBuffer; 00059 unsigned int nBuffer; 00060 00061 unsigned int iNext; 00062 unsigned int BitFieldBuffer; 00063 unsigned int nBitFieldResid; 00064 }; 00065 00066 extern LLRP_tSFrameExtract 00067 LLRP_FrameExtract ( 00068 const unsigned char * pBuffer, 00069 unsigned int nBuffer); 00070 00071 struct LLRP_SFrameDecoderStream 00072 { 00073 LLRP_tSDecoderStream decoderStreamHdr; 00074 00075 LLRP_tSFrameDecoder * pDecoder; 00076 LLRP_tSFrameDecoderStream * pEnclosingDecoderStream; 00077 const LLRP_tSTypeDescriptor *pRefType; 00078 unsigned int iBegin; 00079 unsigned int iLimit; 00080 }; 00081 00082 extern LLRP_tSFrameDecoder * 00083 LLRP_FrameDecoder_construct ( 00084 const LLRP_tSTypeRegistry * pTypeRegistry, 00085 unsigned char * pBuffer, 00086 unsigned int nBuffer); 00087 00088 00089 struct LLRP_SFrameEncoder 00090 { 00091 LLRP_tSEncoder encoderHdr; 00092 00093 unsigned char * pBuffer; 00094 unsigned int nBuffer; 00095 00096 unsigned int iNext; 00097 unsigned int BitFieldBuffer; 00098 unsigned int nBitFieldResid; 00099 }; 00100 00101 struct LLRP_SFrameEncoderStream 00102 { 00103 LLRP_tSEncoderStream encoderStreamHdr; 00104 00105 LLRP_tSFrameEncoder * pEncoder; 00106 LLRP_tSFrameEncoderStream * pEnclosingEncoderStream; 00107 const LLRP_tSTypeDescriptor *pRefType; 00108 unsigned int iBegin; 00109 }; 00110 00111 extern LLRP_tSFrameEncoder * 00112 LLRP_FrameEncoder_construct ( 00113 unsigned char * pBuffer, 00114 unsigned int nBuffer);