added read/write for g_serial support