Implementing function to read FIT file header
This commit is contained in:
+5
-1
@@ -1,5 +1,9 @@
|
|||||||
module FIT
|
module FIT
|
||||||
|
|
||||||
# Write your package code here.
|
export greet_package
|
||||||
|
export read_header
|
||||||
|
include("functions.jl")
|
||||||
|
include("header.jl")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
function greet_package()
|
||||||
|
print("Hello package")
|
||||||
|
end
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
struct FITHeader
|
||||||
|
sz::UInt8
|
||||||
|
end
|
||||||
|
|
||||||
|
"""
|
||||||
|
read_header(fit_file::IOStream)
|
||||||
|
|
||||||
|
Read the header of the given fit file, and return a FITHeader struct
|
||||||
|
"""
|
||||||
|
function read_header(fit_file::IOStream)::FITHeader
|
||||||
|
sz = read(fit_file, 1; all=false)
|
||||||
|
FITHeader(sz[1])
|
||||||
|
end
|
||||||
@@ -3,4 +3,5 @@ using Test
|
|||||||
|
|
||||||
@testset "FIT.jl" begin
|
@testset "FIT.jl" begin
|
||||||
# Write your tests here.
|
# Write your tests here.
|
||||||
|
@test FIT.greet_package() == "Hello package"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user