Typedef struct _EXT_FRAME_HEAD
{
Unsigned long nStartFlag;//extended frame head start identifier
Unsigned short nVer;//version
Unsigned short nLength;//extension length of frame head
EXT_FRAME_TYPE szFrameInfo;
Unsigned long nTimestamp;//in milliseconds timestamp
Unsigned long nEndFlag;//extended frame head start identifier
Bool CheckExtFlag ()
{
Return (HH_EXT_HEAD_FLAG==nStartFlag & amp; & HH_EXT_TAIL_FLAG==nEndFlag)? true:false;
}
} EXT_FRAME_HEAD;
Typedef struct _HV_FRAME_HEAD
{
Unsigned short zeroFlag;//0
Unsigned char oneFlag;//1
Unsigned char streamFlag;//data frame tagging FRAME_FLAG_VP FRAME_FLAG_VI, FRAME_FLAG_A
Unsigned long nByteNum;//data frame size
Unsigned long nTimestamp;//timestamp
} HV_FRAME_HEAD;
The above two structure
Turn the following sentences to Delphi, how do STH over and over again for a long time the compiler are not
EXT_FRAME_HEAD * pExtFrameHead=(EXT_FRAME_HEAD *) (pFrameHead + sizeof (char *) (HV_FRAME_HEAD));
This sentence meaning should be defined a EXT_FRAME_HEAD type of pointer variable, then the assignment, but how to turn in Delphi?
Type
EXT_FRAME_HEAD=record
NStartFlag: LongInt;//extended frame head start identifier
NVer: Word;//version
NLength: Word;//extension length of frame head
SzFrameInfo: EXT_FRAME_TYPE;
NTimestamp: LongInt;//in milliseconds timestamp
NEndFlag: LongInt;//extended frame head start identifier
//here can't translation, but has nothing to do with this, but know how to turn predecessors to give directions, thank you for
//public bool CheckExtFlag ()
//{
//return (HH_EXT_HEAD_FLAG==nStartFlag & amp; & HH_EXT_TAIL_FLAG==nEndFlag)? true:false;
//}
end;
PEXT_FRAME_HEAD=^ EXT_FRAME_HEAD;
Type
HV_FRAME_HEAD=record
ZeroFlag: Word;//0
OneFlag: Byte;//1
StreamFlag: Byte;//data frame tagging FRAME_FLAG_VP FRAME_FLAG_VI, FRAME_FLAG_A
NByteNum: LongInt;//data frame size
NTimestamp: LongInt;//timestamp
end;
PHV_FRAME_HEAD=^ HV_FRAME_HEAD;
Var
PFrameHead: pHV_FRAME_HEAD;
PExtFrameHead: pEXT_FRAME_HEAD;
And then...
CodePudding user response:
Structure transformed to detect bytes occupied agree with c + +, and then run the specific content.CodePudding user response:
Structure is defined in the packed record forward to its members on tight.CodePudding user response:
Bool CheckExtFlag (){
Return (HH_EXT_HEAD_FLAG==nStartFlag & amp; & HH_EXT_TAIL_FLAG==nEndFlag)? true:false;
}
The function CheckExtFlag () : a Boolean;
The begin
Result:=(HH_EXT_HEAD_FLAG=(nStartFlag and HH_EXT_TAIL_FLAG=nEndFlag));
end;
CodePudding user response:
The