Under Review
over 1 year ago

WERETECH-13396

Position.enableLocations documentation has a bug in code example (causes device to crash)

(See: https://forums.garmin.com/developer/connect-iq/f/discussion/319709/enable-location-bug-after-24-10-update)

The documentation at the following URL has a bug which causes a crash:

[https://developer.garmin.com/connect-iq/api-docs/Toybox/Position.html#enableLocationEvents-instance_function]

Original code:

if (Position has :CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5) {
    options[:configuration] = :CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5;

Correct code:

if (Position has :CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5) {
    options[:configuration] = Position.CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5;


Parents
  • To be clear:

    - :CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5 is a symbol (invalid value for options[:configuration])

    - Position.CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5 is an integer value (valid value for options[:configuration])

Comment
  • To be clear:

    - :CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5 is a symbol (invalid value for options[:configuration])

    - Position.CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5 is an integer value (valid value for options[:configuration])

Children
No Data