Use bit_at utility function
This commit is contained in:
+6
-7
@@ -8,8 +8,8 @@ import Base.show
|
|||||||
|
|
||||||
export RecordHeader, read_row
|
export RecordHeader, read_row
|
||||||
|
|
||||||
include("mesg_num.jl")
|
include("bytes.jl"); using.bytes
|
||||||
using .mesg_num
|
include("mesg_num.jl"); using .mesg_num
|
||||||
|
|
||||||
struct DefinitionMessage end
|
struct DefinitionMessage end
|
||||||
struct DataMessage end
|
struct DataMessage end
|
||||||
@@ -21,6 +21,7 @@ The byte that corresponds to the type of message that this record holds.
|
|||||||
"""
|
"""
|
||||||
struct RecordHeader
|
struct RecordHeader
|
||||||
definition_message::Bool
|
definition_message::Bool
|
||||||
|
timestamp_message::Bool
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -32,13 +33,11 @@ TODO: Endianness matters here. Need to resolve endianness with the architecture
|
|||||||
"""
|
"""
|
||||||
function read_row(f::IO)
|
function read_row(f::IO)
|
||||||
header_byte = read(f, 1; all=false)[1]
|
header_byte = read(f, 1; all=false)[1]
|
||||||
println(bitstring(header_byte))
|
|
||||||
|
|
||||||
# The message byte is 7
|
# The message byte is 7
|
||||||
RecordHeader(Bool(parse(Int64, bitstring(header_byte)[2])))
|
RecordHeader(
|
||||||
end
|
bit_at(header_byte, 2),
|
||||||
|
bit_at(header_byte, 1))
|
||||||
function read_header_byte(f::Core.IO)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function show(io::IO, header::RecordHeader)
|
function show(io::IO, header::RecordHeader)
|
||||||
|
|||||||
+2
-1
@@ -7,7 +7,8 @@
|
|||||||
module header
|
module header
|
||||||
|
|
||||||
export FITHeader, read_header
|
export FITHeader, read_header
|
||||||
include("bytes.jl")
|
|
||||||
|
include("bytes.jl"); using .bytes
|
||||||
|
|
||||||
const DATA_SIZE_LENGTH = 4
|
const DATA_SIZE_LENGTH = 4
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user