Implementing function to read FIT file header

main
Jacob Windle 2023-04-06 12:01:16 -04:00
parent 849c078232
commit a3ec238b38
4 changed files with 22 additions and 1 deletions

View File

@ -1,5 +1,9 @@
module FIT
# Write your package code here.
export greet_package
export read_header
include("functions.jl")
include("header.jl")
end

3
src/functions.jl Normal file
View File

@ -0,0 +1,3 @@
function greet_package()
print("Hello package")
end

13
src/header.jl Normal file
View File

@ -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

View File

@ -3,4 +3,5 @@ using Test
@testset "FIT.jl" begin
# Write your tests here.
@test FIT.greet_package() == "Hello package"
end