/* - BnkGet */ #define BNKGET(a,b) { int size; BnkfGetM(a,sizeof(b),&size,&(b)); } class DePacketizeBnkIn { byte PTR _packet; int _packet_len; int _datatype; double _sbtime; PUBLIC void bnkget() { BNKGET( "SLRB:PACKET:PTR", _packet); BNKGET( "SLRB:PACKET:SIZE", _packet_len); //BNKGET( "SLRB:PACKET_APID", bi.apid); BNKGET( "SLRB:PACKET_SBTIME", _sbtime); } PUBLIC byte const PTR getPacket() const { return _packet; } // PUBLIC int packet_len() const { return _packet_len; } PUBLIC int getApid() const { return ( fromUByte(_packet[0]&0x07) <<8 ) + ( fromUByte(_packet[1]&0xff) <<0 ); } PUBLIC int getTi() const { return ( fromUByte(_packet[6]&0xff) <<24 ) + ( fromUByte(_packet[7]&0xff) <<16 ) + ( fromUByte(_packet[8]&0xff) << 8 ) + ( fromUByte(_packet[9]&0xff) << 0 ); } PUBLIC int getSeqnFlag() const { return ( fromUByte(_packet[2]&0xC0) >>6 ); } PUBLIC int getSeqnCount() const { return ( fromUByte(_packet[2]&0x3f) <<8 ) + ( fromUByte(_packet[3]&0xff) <<0 ); } PUBLIC int getDatatype() const { return ( fromUByte(_packet[18]&0xff) <<0 ); } PUBLIC int getPacketLength() const { return _packet_len; } PUBLIC double getSbTime() const { return _sbtime; } };