Serialization PC compatibility

The NETMF Serialization support is made to be lean and it is not compatible with the PC. I remember ages ago that someone wrote PC code that understands NETMF’s serialized object and did de-serialize them on the PC.

Any veteran remembers this and who wrote that code?

as far i know someon with Sky… name is who did something like it but did is he or someone another one i didn’t know

old link
http://old.ghielectronics.com/docs/23/serialization

or do you mean for this article …
http://www.iamraf.net/Articles/Creating-a-GUI-Application-with-the-NET-Micro-Framework

ARTICLE COPIED TEXT:
Downloading the Data download SAMPLE
The .NET Micro Framework allows us to easily serialize the SwimTimingCollection via the Serializable attribute. My helper class TimeSpanFormatter and the reference to the owning collection should not be serialized; this is accomplished by marking them with NonSerialized attributes.


   [Serializable]
   public class SwimTiming : IComparable
   {
       int _Number;
      DateTime _TimeStart;
      TimeSpan _Elapsed;
   
       [NonSerialized]
       SwimTimingCollection _List;
    
       ...
   }
    
   [Serializable]
   public class SwimTimingCollection : ArrayList
   {
       int Counter = 0;
    
       [NonSerialized]
       TimeSpanFormatter _TimeSpanFormatter;
    
       ...
   }

Transferring data is accomplished by the Upload method. For our needs, the serial port is fast enough, since the timing table is fairly small. However, it is possible to use another port if better performance is needed.

    private void Upload()
    {
        SerialPort.Configuration config = new SerialPort.Configuration(
            SerialPort.Serial.COM1, SerialPort.BaudRate.Baud19200, false);
        SerialPort port = new SerialPort(config);
        byte[] Blob = Reflection.Serialize(_SwimTimings,
         typeof(SwimTimingCollection));
       port.Write(Blob, 0, Blob.Length);
        port.Dispose();
 }

On the PC end, we will need to decode the .NET Micro Framework’s binary serialization format, which is designed to keep the data as small as possible. It would be not much more work to generate XML instead, if desired, by concatenating strings and generating a byte array (using the UTF8Encoding class) to be passed on to the SerialPort.Write() method.

Skyworks? Yeah maybe it was him. I wonder where he is at today!

1 Like

You sure it wasn’t Skewworks? This sounds like something he would do.

1 Like

yes i think that name is Skeworks …

http://www.skewworks.com/

and something from him

.net microframework Operating System

1 Like

As far as I remember, it deals with BinarySerialization to provide compliance with PC.

I wrote things about that in the book "Expert .NET MicroFramework (APRESS / Janes Kuhner).

IT is in chapter 9 of the CDROM that is joined to this book I guess !

You can see that revelant chapter here :

https://books.google.fr/books?id=ufSfS2F24VsC&pg=PA237&dq=NETMF+to+PC+Serialization&hl=fr&sa=X&ved=0ahUKEwj1xdqO9fPnAhWFM-wKHb0VAugQ6AEIKTAA#v=onepage&q=NETMF%20to%20PC%20Serialization&f=false

4 Likes

You wrote that code? Very nice

Oups !

I read :wink:

1 Like

I can suggest https://github.com/4egod/MicroExtensions which I use at my projects. It contains some usefull extensions for PC, NETMF and TinyCLR targets. It includes serialization/deserialization too.