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

Enable automatic time/timezone update from cellular network time #4

Merged
merged 2 commits into from Jan 22, 2013

Conversation

pgerdt
Copy link

@pgerdt pgerdt commented Jan 16, 2013

Add oFono-based cellular network information classes, which provide the functionality that the closed source Harmattan CellularQt used to provide.

These classes do not contain any code from CellularQt, only the interface has been partially replicated based on docs from http://harmattan-dev.nokia.com/docs/platform-api-reference/xml/daily-docs/libcellular-qt/

Note that not using ofono-qt is intentional, even if the code would be a little shorter with the library. Not using ofono-qt leaves the option to moc DBus interfaces in unit tests (to be added in a separate commit), and gives more control of error logging.

A network time plugin needs to be added to oFono to make the code in this pull request to work, the corresponding changes to oFono are reviewed in: http://review.merproject.org/#change,1057

@pgerdt
Copy link
Author

pgerdt commented Jan 21, 2013

Updated pull request, changes:

  • Rebased on top of latest master
  • Renamed build flag F_CSD to OFONO based on saukko's comments (see [1], comment lost because of force push)
  • Splitted HEADER and SOURCE file lists as recommended by saukko (see [2]).

[1] saukko commented on e41ba5b src/server/cellular.cpp:L126: F_CSD should be OFONO or so as CSD refers to prorietary nokia. Or should we just remove those all? Didn't check the functionality if we need to be able to build without ofono support or can it just handle itself ok if ofono is not found.

[2] saukko commented on e41ba5b src/server/server.pro:L23: split existing line also ;)

@pgerdt
Copy link
Author

pgerdt commented Jan 21, 2013

New files need copyright headers.

Petri M. Gerdt added 2 commits January 22, 2013 11:04
The classes provide the functionality that the closed source
Harmattan CellularQt used to provide.

These classes do not contain any code from CellularQt, only the
interface has been partially replicated based on docs from
http://harmattan-dev.nokia.com/docs/platform-api-reference/xml/daily-docs/libcellular-qt/
Replace Harmattan CellularQt CSD interface classes with
oFono-based classes that share the CellularQt interface.
@pgerdt
Copy link
Author

pgerdt commented Jan 22, 2013

Updated pull request, changes:

  • Added ofonoconstants.h/cpp to store oFono DBus constants based on saukko's suggestion [1]. Adding a new class instead of defines in existing ones has the added benefit of better testability: it is possible provide an alternative ofonoconstnats.cpp to in unit tests to define a moc oFono service. (Yep, defines could have been added to a file, too, but some suggest to avoid "evil" defines [2]).
  • Rewrote several functions to use early returns based on discussion on irc #nemomobile channel: prefer "if (!x) return; un indented codeblock" instead of "if (x) { indent block of code }"
  • Added copyright headers to all files, the template was copied from existing timed files.

[1] saukko commented on 5a6cf73 src/server/modemwatcher.cpp:L11 a day ago: "org.ofono" <- maybe defines for these constant strings?
[2] http://www.parashift.com/c++-faq-lite/const-vs-define.html

pgerdt pushed a commit that referenced this pull request Jan 22, 2013
Enable automatic time/timezone update from cellular network time
@pgerdt pgerdt merged commit d2fac24 into nemomobile:master Jan 22, 2013
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.

None yet

1 participant