public byte[] composereceivemsg(Bitbuffer buf) { List <byte> bytes = new List <byte>(); int bits = buf.length; bytes.Add((byte)(0x00 + bits - 1)); bytes.AddRange(buf.ToByteArray()); return(bytes.ToArray()); }
public void sendbits(Bitbuffer buf) { #if true senddata(buf.ToByteArray(), buf.length); #else for (int i = 0; i < buf.length; i++) { C_LOW(); if (buf[i] > 0) { D_HIGH(); } else { D_LOW(); } flush(); C_HIGH(); flush(); } #endif }