add message encode to serial write
format
Successfully implemented RLE