Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

location: cellular: initial support with example application #717

Closed
wants to merge 4 commits into from

Conversation

mniestroj
Copy link
Collaborator

No description provided.

Copy link

github-actions bot commented Jan 2, 2025

Visit the preview URL for this PR (updated for commit 81a7cc0):

https://golioth-firmware-sdk-doxygen-dev--pr717-location-cellu-sknxiq39.web.app

(expires Sat, 18 Jan 2025 06:19:33 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a9993e61697a3983f3479e468bcb0b616f9a0578

Copy link

github-actions bot commented Jan 2, 2025

Code Coverage

Code Coverage

Package Line Rate Branch Rate Health
include.golioth 75% 50%
port.linux 62% 34%
port.utils 58% 46%
port.zephyr 58% 25%
src 68% 30%
Summary 67% (2719 / 4072) 30% (1125 / 3714)

Copy link

codecov bot commented Jan 2, 2025

Codecov Report

Attention: Patch coverage is 0% with 37 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/location_cellular.c 0.00% 37 Missing ⚠️
Files with missing lines Coverage Δ
src/location_cellular.c 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

@mniestroj mniestroj force-pushed the location-cellular branch 3 times, most recently from ac49c15 to 0cebadd Compare January 2, 2025 15:23
@mniestroj mniestroj force-pushed the location-wifi branch 5 times, most recently from ccc2394 to 1f49b15 Compare January 9, 2025 13:26
@mniestroj mniestroj force-pushed the location-cellular branch 3 times, most recently from 19415cc to e7e4da3 Compare January 9, 2025 15:54
Base automatically changed from location-wifi to main January 11, 2025 06:11
@mniestroj mniestroj requested review from sam-golioth and szczys and removed request for sam-golioth January 11, 2025 06:16
Introduce support for Golioth cellular location service.

Signed-off-by: Marcin Niestroj <[email protected]>
Add a sample with cellular network cell towers collected over the city
trip. This is a playback with configurable speed (1x by default) to quickly
see results over time during testing (e.g. on a Grafana map plugin).

Signed-off-by: Marcin Niestroj <[email protected]>
Add nRF91 specific cellular tower information fetching and use when
requesting location data.

Use current cell only for now, as that is the only information provided
with the tested modem and SIM card. Leave logs for neighbour cells enabled,
so that extending this sample in the future is easy.

Signed-off-by: Marcin Niestroj <[email protected]>
if (cell->strength)
{
ok = zcbor_tstr_put_lit(req->zse, "strength") && zcbor_int32_put(req->zse, cell->strength);
;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been addressed in #729.

ok = zcbor_map_end_encode(req->zse, 1);
if (!ok)
{
LOG_ERR("Failed to %s %s encoding", "end", "map");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the idea here to cut down on the flash size taken up by format strings?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is right. Such pattern is used sometimes in Zephyr as well, mostly around networking subsystem code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. I don't think I'd seen that before. Clever!

Comment on lines +36 to +37
ok = zcbor_map_start_encode(req->zse, 1) && zcbor_tstr_put_lit(req->zse, "cell")
&& zcbor_list_start_encode(req->zse, 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way we're starting and ending these lists, we can do either wifi or cellular, but not both. I think there are usecases for combining them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been addressed in #729.

@sam-golioth
Copy link
Contributor

I bet you already knew I was going to say this, but we need to add tests for the sample as well :)

@mniestroj
Copy link
Collaborator Author

Closing in favor of #729

@mniestroj mniestroj closed this Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants