diff --git a/src/body.jl b/src/body.jl index 684446e..41d20d3 100644 --- a/src/body.jl +++ b/src/body.jl @@ -8,8 +8,8 @@ import Base.show export RecordHeader, read_row -include("mesg_num.jl") -using .mesg_num +include("bytes.jl"); using.bytes +include("mesg_num.jl"); using .mesg_num struct DefinitionMessage end struct DataMessage end @@ -21,6 +21,7 @@ The byte that corresponds to the type of message that this record holds. """ struct RecordHeader definition_message::Bool + timestamp_message::Bool end @@ -32,13 +33,11 @@ TODO: Endianness matters here. Need to resolve endianness with the architecture """ function read_row(f::IO) header_byte = read(f, 1; all=false)[1] - println(bitstring(header_byte)) # The message byte is 7 - RecordHeader(Bool(parse(Int64, bitstring(header_byte)[2]))) -end - -function read_header_byte(f::Core.IO) + RecordHeader( + bit_at(header_byte, 2), + bit_at(header_byte, 1)) end function show(io::IO, header::RecordHeader) diff --git a/src/header.jl b/src/header.jl index a3bf477..217ca60 100644 --- a/src/header.jl +++ b/src/header.jl @@ -7,7 +7,8 @@ module header export FITHeader, read_header -include("bytes.jl") + +include("bytes.jl"); using .bytes const DATA_SIZE_LENGTH = 4