Skip to content

Commit

Permalink
Cover cases of dealing with unknown Ember+ elements
Browse files Browse the repository at this point in the history
References #8
  • Loading branch information
andreashuber-lawo committed Jan 8, 2016
1 parent 3c32ae3 commit 80ec798
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Lawo.EmberPlusSharp/Model/Root.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ private static object BitConvert(StreamDescription descriptor, byte[] rawArray)
return (long)BitConverter.ToUInt32(array, offset);
case StreamFormat.UInt64BigEndian:
case StreamFormat.UInt64LittleEndian:
return (long)BitConverter.ToUInt64(array, offset);
return unchecked((long)BitConverter.ToUInt64(array, offset));
case StreamFormat.SByte:
return (long)unchecked((sbyte)array[offset]);
case StreamFormat.Int16BigEndian:
Expand Down
19 changes: 16 additions & 3 deletions Lawo.EmberPlusSharpTest/Model/Test/EmberDataPayloads/MainLog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@
</Root>
</Payload>
</Event>
<Event type="Message" timeUtc="17:42:02.52" direction="Send" number="1">
<Event type="Message" timeUtc="17:42:02.66" direction="Send" number="1">
<Slot>00</Slot>
<Command>EmberData 01 0A 02</Command>
<Payload>
<Root type="A-42">
<C-99 type="A-137">
<C-0 type="Integer">0</C-0>
</C-99>
</Root>
</Payload>
</Event>
<Event type="Message" timeUtc="17:42:02.52" direction="Send" number="2">
<Slot>00</Slot>
<Command>EmberData 01 0A 02</Command>
<Payload>
Expand Down Expand Up @@ -373,7 +384,7 @@ Three</enumeration>
</Root>
</Payload>
</Event>
<Event type="Message" timeUtc="17:42:02.64" direction="Send" number="2">
<Event type="Message" timeUtc="17:42:02.64" direction="Send" number="3">
<Slot>00</Slot>
<Command>EmberData 01 0A 02</Command>
<Payload>
Expand Down Expand Up @@ -437,14 +448,16 @@ Three</enumeration>
</Root>
</Payload>
</Event>
<Event type="Message" timeUtc="17:42:02.66" direction="Send" number="3">
<Event type="Message" timeUtc="17:42:02.66" direction="Send" number="4">
<Slot>00</Slot>
<Command>EmberData 01 0A 02</Command>
<Payload>
<Root type="StreamCollection">
<C-42 type="A-17"/>
<StreamEntry type="StreamEntry">
<streamIdentifier type="Integer">0</streamIdentifier>
<streamValue type="Boolean">true</streamValue>
<C-27 type="UTF8String"></C-27>
</StreamEntry>
<StreamEntry type="StreamEntry">
<streamIdentifier type="Integer">1</streamIdentifier>
Expand Down

0 comments on commit 80ec798

Please sign in to comment.