diff --git a/build.rs b/build.rs index 39e2b47..78a951d 100644 --- a/build.rs +++ b/build.rs @@ -205,12 +205,13 @@ fn write_sim_data() { let segments = [(StreamType::IMU, motion_output), (StreamType::GPS, gps_output), (StreamType::Annotations, annotation_output)]; // Write out the stream index header - rmp::encode::write_array_len(&mut unified_fd, segments.len() as u32).unwrap(); + StreamIndex { count: segments.len() }.write_rmp(&mut unified_fd).unwrap(); // Then the streams for (stream_type, stream_path) in segments { let mut fd = File::open(stream_path).unwrap(); - rmp::encode::write_ext_meta(&mut unified_fd, fd.metadata().unwrap().len() as u32, stream_type.into()).unwrap(); + // FIXME: Replace this with the actual rmp types in simdata + StreamHeader { id: stream_type, size: fd.metadata().unwrap().len() as usize }.write_rmp(&mut unified_fd).unwrap(); let mut buf = Vec::new(); fd.read_to_end(&mut buf).unwrap(); unified_fd.write_all(buf.as_slice()).unwrap();