3. Interfaced FS
This commit is contained in:
parent
ffe9d43cf8
commit
a27cc090dd
12
fuse.go
12
fuse.go
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"go.arsenm.dev/infinitime"
|
"go.arsenm.dev/infinitime"
|
||||||
|
"go.arsenm.dev/infinitime/blefs"
|
||||||
"go.arsenm.dev/logger/log"
|
"go.arsenm.dev/logger/log"
|
||||||
"os"
|
"os"
|
||||||
"context"
|
"context"
|
||||||
@ -73,7 +74,7 @@ var properties = []ITProperty {
|
|||||||
ITProperty{"version", 6, nil},
|
ITProperty{"version", 6, nil},
|
||||||
ITProperty{"address", 7, nil},
|
ITProperty{"address", 7, nil},
|
||||||
}
|
}
|
||||||
var myfs *FS = nil;
|
var myfs *blefs.FS = nil;
|
||||||
var inodemap map[string]uint64 = nil;
|
var inodemap map[string]uint64 = nil;
|
||||||
|
|
||||||
var _ = (fs.NodeReaddirer)((*ITNode)(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[4].f = mydev.VersionBytes;
|
||||||
properties[5].f = mydev.AddressBytes;
|
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)
|
inodemap = make(map[string]uint64)
|
||||||
|
|
||||||
// Wait until unmount before exiting
|
// Wait until unmount before exiting
|
||||||
server.Wait()
|
go server.Serve()
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user