Skip to content

Commit

Permalink
defaults.pref
Browse files Browse the repository at this point in the history
  • Loading branch information
kdudkov committed Mar 19, 2023
1 parent 1737c3f commit ac3e68b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.idea/
dist/
data/
*.log
*.tmp
*.out
Expand Down
17 changes: 13 additions & 4 deletions cmd/goatak_server/marti_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import (
"github.com/kdudkov/goatak/model"
)

// /Marti/api/device/profile/connection?syncSecago=1644830591&clientUid=ANDROID-xxx
//

func getMartiApi(app *App, addr string) *air.Air {
api := air.New()
api.Address = addr
Expand All @@ -26,6 +23,7 @@ func getMartiApi(app *App, addr string) *air.Air {
api.GET("/Marti/api/sync/metadata/:hash/tool", getMetadataGetHandler(app))
api.PUT("/Marti/api/sync/metadata/:hash/tool", getMetadataPutHandler(app))

api.GET("/Marti/api/device/profile/connection", getProfileConnectionHandler(app))
api.GET("/Marti/sync/content", getMetadataGetHandler(app))
api.GET("/Marti/sync/search", getSearchHandler(app))
api.GET("/Marti/sync/missionquery", getMissionQueryHandler(app))
Expand Down Expand Up @@ -247,6 +245,16 @@ func getSearchHandler(app *App) func(req *air.Request, res *air.Response) error
}
}

func getProfileConnectionHandler(app *App) func(req *air.Request, res *air.Response) error {
return func(req *air.Request, res *air.Response) error {
app.Logger.Infof("%s %s", req.Method, req.Path)
//uid := getStringParamIgnoreCaps(req, "clientUid")

res.Status = http.StatusNoContent
return nil
}
}

func getStringParam(req *air.Request, name string) string {
p := req.Param(name)
if p == nil {
Expand All @@ -270,8 +278,9 @@ func getIntParam(req *air.Request, name string, def int) int {
}

func getStringParamIgnoreCaps(req *air.Request, name string) string {
nn := strings.ToLower(name)
for _, p := range req.Params() {
if strings.ToLower(p.Name) == strings.ToLower(name) {
if strings.ToLower(p.Name) == nn {
return p.Value().String()
}
}
Expand Down
14 changes: 14 additions & 0 deletions data/defaults.pref
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version='1.0' standalone='yes'?>
<preferences>
<preference version="1" name="com.atakmap.app.civ_preferences">
<entry key="speed_unit_pref" class="class java.lang.String">1</entry>
<entry key="alt_unit_pref" class="class java.lang.String">1</entry>
<entry key="saHasPhoneNumber" class="class java.lang.Boolean">false</entry>
<entry key="locationUnitType" class="class java.lang.String">a-f-G-U-C</entry>
<entry key="alt_display_pref" class="class java.lang.String">MSL</entry>
<entry key="coord_display_pref" class="class java.lang.String">DM</entry>
<entry key="rab_north_ref_pref" class="class java.lang.String">1</entry>
<entry key="rab_brg_units" class="class java.lang.String">0</entry>
<entry key="rab_nrg_units" class="class java.lang.String">1</entry>
</preference>
</preferences>

0 comments on commit ac3e68b

Please sign in to comment.