Closed sje30 closed 4 months ago
Thanks Steven. As you noted this was also reported in #38 with another file from a Coros watch. It seems the 'start' event i.e. when you press start on the watch, has a data field that doesn't actually contain any values. It claims to be a UINT32
but also states it's of size 1 bytes. The package was hitting that inconsistency and didn't know what to do, hence the missing res
object. It will now read the single byte and that seems sufficient to proceed with the rest of the file.
Since these two characteristics are inconsistent it's not clear what to do with the data, so for now I've included an NA
value in this place as you can see below.
library(FITfileR)
## download and extract the example file
destfile = tempfile(fileext = ".zip")
url = "https://github.com/grimbough/FITfileR/files/15139616/coros.zip"
dl = download.file(url = url, destfile = destfile)
example_file = unzip(destfile, exdir = tempdir())
## read and extract the events
fitFile <- readFitFile(example_file[1])
events(fitFile)
#> $event_1
#> # A tibble: 3 × 4
#> timestamp event event_type event_group
#> <dttm> <chr> <chr> <int>
#> 1 2024-04-27 08:07:54 timer start 0
#> 2 2024-04-27 08:32:51 timer stop_all 0
#> 3 2024-04-27 08:32:53 timer stop_all 0
#>
#> $event_2
#> # A tibble: 1 × 5
#> timestamp event event_type event_group data
#> <dttm> <chr> <chr> <int> <lgl>
#> 1 2024-04-27 08:32:53 timer start 0 NA
hi again Mike!
trying this with another device (this time my watch, a Coros pace 3).
the file is attached in a zip again. It opens okay in https://www.fitfileviewer.com
coros.zip