本文整理匯總了C#中Microsoft.SPOT.Debugger.WireProtocol.Converter類的典型用法代碼示例。如果您正苦於以下問題:C# Converter類的具體用法?C# Converter怎麽用?C# Converter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Converter類屬於Microsoft.SPOT.Debugger.WireProtocol命名空間,在下文中一共展示了Converter類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PrepareForDeserialize
public void PrepareForDeserialize(int size, byte[] data, Converter converter)
{
module_serial_number = new byte[32];
system_serial_number = new byte[16];
}
示例2: OutgoingMessage
public OutgoingMessage( IController parent, Converter converter, uint cmd, uint flags, object payload )
{
InitializeForSend( parent, converter, cmd, flags, payload );
UpdateCRC( converter );
}
示例3: InitializeForSend
internal void InitializeForSend( IController parent, Converter converter, uint cmd, uint flags, object payload )
{
Packet header = parent.NewPacket();
header.m_cmd = cmd;
header.m_flags = flags;
m_parent = parent;
m_raw = new MessageRaw ();
m_base = new MessageBase();
m_base.m_header = header;
m_base.m_payload = payload;
if(payload != null)
{
m_raw.m_payload = converter.Serialize( payload );
m_base.m_header.m_size = (uint)m_raw.m_payload.Length;
m_base.m_header.m_crcData = CRC.ComputeCRC( m_raw.m_payload, 0 );
}
}
示例4: Reply
public bool Reply( Converter converter, uint flags, object payload )
{
OutgoingMessage msgReply = new OutgoingMessage( this, converter, flags, payload );
return msgReply.Send();
}
示例5: UpdateCRC
private void UpdateCRC( Converter converter )
{
Packet header = m_base.m_header;
//
// The CRC for the header is computed setting the CRC field to zero and then running the CRC algorithm.
//
header.m_crcHeader = 0;
header.m_crcHeader = CRC.ComputeCRC( converter.Serialize( header ), 0 );
m_raw.m_header = converter.Serialize( header );
}