Commit Graph

72 Commits (master)
 

Author SHA1 Message Date
Arsen6331 0c369dc5df Merge pull request 'replace pactl based volume control with mpris based volume control' (#6) from FloralExMachina/infinitime:master into master
Reviewed-on: Arsen6331/infinitime#6
4 months ago
razorkitty 5fb5cf4b92 removed pulseaudio-utils and libpulse dependencies 4 months ago
razorkitty 76809726d5 replace pactl based volume control with mpris based volume control
methods
4 months ago
Arsen Musayelyan 72b558707e Use NavFlag type in SetFlag() 5 months ago
Arsen Musayelyan 31f4c51a61 Improve navigation API 5 months ago
Arsen Musayelyan 8e5bbafba8 Fix typo 5 months ago
Arsen Musayelyan e6fb402c0c Remove check for unchanged values and refactor code 5 months ago
yannickulrich 1f5301f5de Added Navigation service (#5)
InfiniTime implements a [Navigation Service](https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/doc/NavigationService.md). This pull request will add it to the go library by defining a function
```go
func (i *Device) Navigation(flag string, narrative string, dist string, progress uint8) error {
  ...
}
```
From the InfiniTime manual
 * `flag`: the graphic instruction as provided by [Pure Maps](https://github.com/rinigus/pure-maps/tree/master/qml/icons/navigation). A list of valid instruction icons can be found [here](https://github.com/rinigus/pure-maps/tree/master/qml/icons/navigation)
 * `narrative`: the instruction in words, eg. "At the roundabout take the first exit".
 * `dist`: a short string describing the distance to the upcoming instruction such as "50 m".
 * `progress`: the percent complete in a `uint8`

Adding this to the `itd` daemon is straightforward
```patch
diff --git a/api/types.go b/api/types.go
index 281a85b..14c84de 100644
--- a/api/types.go
+++ b/api/types.go
@@ -22,6 +22,13 @@ type FwUpgradeData struct {
        Files []string
 }

+type NavigationData struct {
+       Flag         string
+       Narrative    string
+       Dist         string
+       Progress     uint8
+}
+
 type NotifyData struct {
        Title string
        Body  string
diff --git a/socket.go b/socket.go
index 6fcba5c..91b37c0 100644
--- a/socket.go
+++ b/socket.go
@@ -204,6 +204,10 @@ func (i *ITD) Address(_ *server.Context) string {
        return i.dev.Address()
 }

+func (i *ITD) Navigation(_ *server.Context, data api.NavigationData) error {
+       return i.dev.Navigation(data.Flag, data.Narrative, data.Dist, data.Progress)
+}
+
 func (i *ITD) Notify(_ *server.Context, data api.NotifyData) error {
        return i.dev.Notify(data.Title, data.Body)
 }
```

Co-authored-by: Yannick Ulrich <yannick.ulrich@durham.ac.uk>
Reviewed-on: Arsen6331/infinitime#5
Co-authored-by: yannickulrich <yannick.ulrich@protonmail.com>
Co-committed-by: yannickulrich <yannick.ulrich@protonmail.com>
5 months ago
Arsen Musayelyan 0ad671d3f5 Assume MTU if not available from BlueZ 5 months ago
Arsen Musayelyan 54fdd19bec Use timestamp with timezone offset to (finally) fix weather issue 5 months ago
Arsen Musayelyan a01f1b9d92 Close files properly when returning an error (Arsen6331/itd#29) 5 months ago
Arsen Musayelyan bb017b471e Stop DBus errors from causing panics by checking error type (Arsen6331/itd#29) 5 months ago
Arsen Musayelyan 01970b2bb7 Add debug logging to resource loading 5 months ago
Arsen Musayelyan b476853dc0 Fix RemoveAll() and MkdirAll() functions 5 months ago
Arsen Musayelyan 3e9957d419 Implement resource loading feature 7 months ago
Arsen Musayelyan b5d345cdec Remove debug code 7 months ago
Arsen Musayelyan 0eead333b7 Add RemoveAll() and MkdirAll() to the filesystem implementation 7 months ago
Arsen Musayelyan e4c12d32a1 Add Stat() to filesystem implementation 7 months ago
Arsen Musayelyan 5af53d1dc6 Fix bug where the filesystem implementation misreports the amount of bytes written, causing functions such as io.Copy() to return an error 7 months ago
Arsen Musayelyan d199fba93c Update go-bluetooth library for 5.65 support 7 months ago
Arsen Musayelyan 9ed74726c4 Add contexts and improve error handling 10 months ago
Arsen Musayelyan 1533865e4c Fix error handling in (*FS).Remove() 11 months ago
Arsen Musayelyan 65fa04d360 Use adapter ID in btmgmt as well 11 months ago
Arsen Musayelyan 5e5eef15dc Ask for adapter ID in Init() 11 months ago
Arsen Musayelyan 6c3f1b14c9 Clarify DFU debug logs 11 months ago
Arsen Musayelyan 2def4b13ac Add debug logging 11 months ago
Arsen Musayelyan 2f51bde597 Use log level provided in options 11 months ago
Arsen Musayelyan bebd1017c5 Ensure that done signals for Watch functions are handled properly and restart notifications if they stop unexpectedly 11 months ago
Arsen Musayelyan b7a50271be Log when too many disconnects occur rather than removing the device (Arsen6331/itd#10) 11 months ago
Arsen Musayelyan 7026da3f6f Handle case where artists value is a single string rather than a slice. Fixes Arsen6331/itd#9. 1 year ago
Arsen Musayelyan e82981e3fc Rewrite connect/reconnect code 1 year ago
Arsen Musayelyan 738e140bfb Create custom BlueZ agent 1 year ago
Arsen Musayelyan 9250d26fdc Restrict to one open file of each type at a time 1 year ago
Arsen Musayelyan 382b1d9556 Add file transfer progress 1 year ago
Arsen Musayelyan a2ff29ce84 Add weather service 1 year ago
Arsen Musayelyan 522c10a9c0 Set connected property to true in all connecting functions 1 year ago
Arsen Musayelyan bd057815cf Fix checkStatus call in (*Device).FS() 1 year ago
Arsen Musayelyan 58d5036f20 Allow multiple call notification responses and improve error handling 1 year ago
Arsen Musayelyan 9966880bc8 Only allow OnChange() to be called once 1 year ago
Arsen Musayelyan e12ccb2ff5 Fix README errors 1 year ago
Arsen Musayelyan 4b8b2a3b22 Remove playerctl from dependencies and add pactl providers 1 year ago
Arsen Musayelyan e9a611aec8 Buffer message channel for music 1 year ago
Arsen Musayelyan d9823bf0c8 Switch player to MPRIS interface 1 year ago
Arsen Musayelyan ec1548ec0f Remove BLE docs as they have been merged into InfiniTime 1 year ago
Arsen Musayelyan e9a92bac46 Implement BLE filesystem (experimental and will change in the future) 1 year ago
Arsen Musayelyan ec43bad466 Update go-bluetooth to fix BlueZ 5.62 compatibility 1 year ago
Arsen Musayelyan 504a64da93 Upgrade go-bluetooth version 1 year ago
Arsen Musayelyan 7fb1fcce68 Create Init() rather than using init() 1 year ago
Arsen Musayelyan 75942bdb0c Add whitelist to pair() and make case insensitive 1 year ago
Arsen Musayelyan 53aa6f8a0c Add cancel functions to battery level and heart rate 1 year ago