コード例 #1
0
ファイル: RnetMessage.cs プロジェクト: wasabii/rnet
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="targetDeviceId"></param>
 /// <param name="sourceDeviceId"></param>
 /// <param name="messageType"></param>
 protected RnetMessage(RnetDeviceId targetDeviceId, RnetDeviceId sourceDeviceId, RnetMessageType messageType)
     : this()
 {
     MessageTimestamp = DateTime.UtcNow;
     TargetDeviceId = targetDeviceId;
     SourceDeviceId = sourceDeviceId;
     MessageType = messageType;
 }
コード例 #2
0
ファイル: RnetStreamWriter.cs プロジェクト: wasabii/rnet
        /// <summary>
        /// Begins a new message.
        /// </summary>
        internal void BeginMessage(RnetDeviceId targetDeviceId, RnetDeviceId sourceDeviceId, RnetMessageType messageType)
        {
            if (len != -1 || sum != -1)
                throw new InvalidOperationException("A message is already in progress.");

            stm = new MemoryStream();
            len = 0;
            sum = 0;

            WriteStart();
            targetDeviceId.Write(this);
            sourceDeviceId.Write(this);
            WriteByte((byte)messageType);
        }
コード例 #3
0
ファイル: RnetUnknownMessage.cs プロジェクト: wasabii/rnet
 /// <summary>
 /// Reads an event message from the reader.
 /// </summary>
 /// <param name="reader"></param>
 /// <param name="targetDeviceId"></param>
 /// <param name="sourceDeviceId"></param>
 /// <returns></returns>
 internal static RnetUnknownMessage Read(RnetMessageBodyReader reader, RnetDeviceId targetDeviceId, RnetDeviceId sourceDeviceId, RnetMessageType messageType)
 {
     return new RnetUnknownMessage(
         targetDeviceId, sourceDeviceId,
         messageType);
 }
コード例 #4
0
ファイル: RnetUnknownMessage.cs プロジェクト: wasabii/rnet
        /// <summary>
        /// Initializes a new instance.
        /// </summary>
        /// <param name="targetDeviceId"></param>
        /// <param name="sourceDeviceId"></param>
        /// <param name="messageType"></param>
        public RnetUnknownMessage(RnetDeviceId targetDeviceId, RnetDeviceId sourceDeviceId, RnetMessageType messageType)
            : base(targetDeviceId, sourceDeviceId, messageType)
        {

        }