Added FUSE support #55

Merged
Elara6331 merged 65 commits from yannickulrich/itd:fuse into master 2023-03-25 22:23:52 +00:00
Showing only changes of commit a27cc090dd - Show all commits

12
fuse.go
View File

@ -2,6 +2,7 @@ package main
import (
"go.arsenm.dev/infinitime"
"go.arsenm.dev/infinitime/blefs"
"go.arsenm.dev/logger/log"
"os"
"context"
@ -73,7 +74,7 @@ var properties = []ITProperty {
ITProperty{"version", 6, nil},
ITProperty{"address", 7, nil},
}
var myfs *FS = nil;
var myfs *blefs.FS = nil;
var inodemap map[string]uint64 = nil;
var _ = (fs.NodeReaddirer)((*ITNode)(nil))
@ -521,9 +522,14 @@ func startFuse(ctx context.Context, dev *infinitime.Device) error {
properties[4].f = mydev.VersionBytes;
properties[5].f = mydev.AddressBytes;
myfs = &FS{};
myfs, err = dev.FS()
if err != nil {
log.Warn("Error getting BLE filesystem").Err(err).Send()
return err
}
inodemap = make(map[string]uint64)
// Wait until unmount before exiting
server.Wait()
go server.Serve()
return nil
}