Skip to content

Empty assistance data from gnss_assistance_get_status #72

Description

@jbodegraven

in __handle_lp_gnss_assistance the test

_UNICODE_0 = const(0)

if part_no == 0:
	if part[0] == _UNICODE_0:
		gnss_details = cmd.rsp.gnss_assistance.almanac

Never works because '0' is 48. gnss_details never gets assigned and the objects stay empty.

I've rewritten it like so:

if part_no == 0:
	type_code = int(part)
	if type_code == WalterModemGNSSAssistanceType.ALMANAC:
		gnss_details = cmd.rsp.gnss_assistance.almanac
	elif type_code == WalterModemGNSSAssistanceType.REALTIME_EPHEMERIS:
		gnss_details = cmd.rsp.gnss_assistance.realtime_ephemeris
	elif type_code == WalterModemGNSSAssistanceType.PREDICTED_EPHEMERIS:
		gnss_details = cmd.rsp.gnss_assistance.predicted_ephemeris

Now it works and cmd.rsp.gnss_assistance is properly populated

Also cleaned out the _UNICODE_0 = const(0), etc, because they're no longer used, they are wrong and using the existing enum is a cleaner way of doing it imo.

Do you agree? would you like me to submit a pull request (never done that) ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions