本文整理汇总了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 );
}