Mr-Markus / ZigbeeNet

A .NET Standard library for working with ZigBee
Eclipse Public License 1.0
131 stars 47 forks source link

Refactored IeeeAddress #59

Closed TheBlubb14 closed 5 years ago

TheBlubb14 commented 5 years ago

Hello first of all many thanks for this great library. I refactored the IeeAddress because my Ikea Tradfri lamp together with my CC2531 and enabled NetworkSerializer threw an exception.

Instead of the bit shifting in the SetAddress the method BitConverter.GetBytes contained in the .Net framework is used now. Which should make the code easier to read.

I also fixed an OverflowException when converting the string in the constructor to the byte[]. The problem occurred when I serialized my Tradfri lamp using the JsonNetworkSerializer and rebooted the network.

TheBlubb14 commented 5 years ago

I completely missed the tests, sorry. I my lamp has 15046349333641525676 as IeeeAddress. But this address cannot be converted as hexadecimal to UInt64 because it is too big. What's the best way to fix the problem?

TheBlubb14 commented 5 years ago

Okay, now everything should work as expected. :)