Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
agl-service-navigationv2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Alois Eckl
agl-service-navigationv2
Commits
a746f48a
Commit
a746f48a
authored
4 years ago
by
Sebastian Alois Eckl
Browse files
Options
Downloads
Patches
Plain Diff
added comments and changed name to navigatio-v2
parent
c9990fde
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
binding/navigation-api.c
+34
-1
34 additions, 1 deletion
binding/navigation-api.c
conf.d/cmake/config.cmake
+3
-3
3 additions, 3 deletions
conf.d/cmake/config.cmake
with
37 additions
and
4 deletions
binding/navigation-api.c
+
34
−
1
View file @
a746f48a
...
...
@@ -46,6 +46,9 @@ struct navigation_state *navigation_get_userdata(void)
return
afb_api_get_userdata
(
g_api
);
}
/*
* get event for subscription depending on value
*/
static
afb_event_t
get_event_from_value
(
struct
navigation_state
*
ns
,
const
char
*
value
)
{
...
...
@@ -64,6 +67,9 @@ static afb_event_t get_event_from_value(struct navigation_state *ns,
return
NULL
;
}
/*
* get storage depending on Value
*/
static
json_object
**
get_storage_from_value
(
struct
navigation_state
*
ns
,
const
char
*
value
)
{
...
...
@@ -82,6 +88,9 @@ static json_object **get_storage_from_value(struct navigation_state *ns,
return
NULL
;
}
/*
* subscribe/unsubscribe to an event depnding on it's name
*/
static
void
navigation_subscribe_unsubscribe
(
afb_req_t
request
,
gboolean
unsub
)
{
...
...
@@ -133,6 +142,9 @@ static void navigation_subscribe_unsubscribe(afb_req_t request,
value
);
}
/*
* subscribe & unsubscribe handlers for corresponding verbs
*/
static
void
subscribe
(
afb_req_t
request
)
{
navigation_subscribe_unsubscribe
(
request
,
FALSE
);
...
...
@@ -143,6 +155,9 @@ static void unsubscribe(afb_req_t request)
navigation_subscribe_unsubscribe
(
request
,
TRUE
);
}
/*
* broadcast brodcast information depending on name
*/
static
void
broadcast
(
json_object
*
jresp
,
const
char
*
name
,
gboolean
cache
)
{
struct
navigation_state
*
ns
=
navigation_get_userdata
();
...
...
@@ -179,6 +194,9 @@ static void broadcast(json_object *jresp, const char *name, gboolean cache)
afb_event_push
(
event
,
tmp
);
}
/*
* broadcast_status verb handler
*/
static
void
broadcast_status
(
afb_req_t
request
)
{
json_object
*
jresp
=
afb_req_json
(
request
);
...
...
@@ -191,6 +209,9 @@ static void broadcast_status(afb_req_t request)
// here.
}
/*
* broadcast_position verb handler
*/
static
void
broadcast_position
(
afb_req_t
request
)
{
const
char
*
position
=
afb_req_value
(
request
,
"position"
);
...
...
@@ -210,6 +231,9 @@ static void broadcast_position(afb_req_t request)
// here.
}
/*
* broadcast_waypoints verb handler
*/
static
void
broadcast_waypoints
(
afb_req_t
request
)
{
json_object
*
jresp
=
afb_req_json
(
request
);
...
...
@@ -222,6 +246,9 @@ static void broadcast_waypoints(afb_req_t request)
// here.
}
/*
* broadcast_destiantion verb handler
*/
static
void
broadcast_destination
(
afb_req_t
request
)
{
json_object
*
jresp
=
afb_req_json
(
request
);
...
...
@@ -301,6 +328,9 @@ static void onevent(afb_api_t api, const char *event, struct json_object *object
}
}
/*
* Init for the AGL binding
*/
static
int
init
(
afb_api_t
api
)
{
struct
navigation_state
*
ns
;
...
...
@@ -355,6 +385,9 @@ static int init(afb_api_t api)
return
0
;
}
/*
* verbs of the agl-service-navigation
*/
static
const
afb_verb_t
binding_verbs
[]
=
{
{
.
verb
=
"subscribe"
,
...
...
@@ -388,7 +421,7 @@ static const afb_verb_t binding_verbs[] = {
* description of the binding for afb-daemon
*/
const
afb_binding_t
afbBindingV3
=
{
.
api
=
"navigation"
,
.
api
=
"navigation
-v2
"
,
.
verbs
=
binding_verbs
,
.
onevent
=
onevent
,
.
init
=
init
,
...
...
This diff is collapsed.
Click to expand it.
conf.d/cmake/config.cmake
+
3
−
3
View file @
a746f48a
...
...
@@ -18,7 +18,7 @@
# Project Info
# ------------------
set
(
PROJECT_NAME agl-service-navigation
)
set
(
PROJECT_NAME agl-service-navigation
-v2
)
set
(
PROJECT_VERSION
"1.0"
)
set
(
PROJECT_PRETTY_NAME
"Navigation service for AGL"
)
set
(
PROJECT_DESCRIPTION
"Navigation reporting proxy for consumers"
)
...
...
@@ -28,7 +28,7 @@ set(PROJECT_AUTHOR "Matt Ranostay - Edited by Sebastian Eckl")
set
(
PROJECT_AUTHOR_MAIL
"matt.ranostay@konsulko.com"
)
set
(
PROJECT_LICENSE
"APL2.0"
)
set
(
PROJECT_LANGUAGES,
"C"
)
set
(
API_NAME
"navigation"
)
set
(
API_NAME
"navigation
-v2
"
)
# Where the project configuration files are stored
set
(
PROJECT_CMAKE_CONF_DIR
"conf.d"
)
...
...
@@ -119,7 +119,7 @@ set(WIDGET_TYPE application/vnd.agl.service)
# This is the file that will be executed, loaded,
# at launch time by the application framework.
#
set
(
WIDGET_ENTRY_POINT lib/libafm-navigation-binding.so
)
set
(
WIDGET_ENTRY_POINT lib/libafm-navigation-
v2-
binding.so
)
# Print a helper message when every thing is finished
# ----------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment