@@ -71,8 +71,8 @@ MQTT_Client.ino
7171// (ditto)
7272// Initially we subscribe to the key distribution topic and the continental correction topic (if available)
7373// If enabled, we also subscribe to the AssistNow MGA topic
74- // If localised distribution is enabled and we have a 3D fix, we subscribe to the dict topic
75- // When the dict is received, we subscribe to the nearest localised topic and unsubscribe from the continental topic
74+ // If localized distribution is enabled and we have a 3D fix, we subscribe to the dict topic
75+ // When the dict is received, we subscribe to the nearest localized topic and unsubscribe from the continental topic
7676// When the AssistNow MGA data arrives, we unsubscribe and subscribe to AssistNow updates
7777
7878#ifdef COMPILE_MQTT_CLIENT
@@ -124,8 +124,8 @@ const char localizedPrefix[] = "pp/ip/L"; // The localized distribution topic pr
124124std::vector<String> mqttSubscribeTopics; // List of MQTT topics to be subscribed to
125125std::vector<String> mqttClientSubscribedTopics; // List of topics currently subscribed to
126126
127- String localisedDistributionDictTopic = " " ;
128- String localisedDistributionTileTopic = " " ;
127+ String localizedDistributionDictTopic = " " ;
128+ String localizedDistributionTileTopic = " " ;
129129
130130static MqttClient *mqttClient;
131131
@@ -289,7 +289,7 @@ void mqttClientPrintStatus()
289289// Called when a subscribed message arrives
290290void mqttClientReceiveMessage (int messageSize)
291291{
292- // The Level 3 localised distribution dictionary topic can be up to 25KB
292+ // The Level 3 localized distribution dictionary topic can be up to 25KB
293293 // The full AssistNow (MGA) topic can be ~11KB
294294 const uint16_t mqttLimit = 26000 ;
295295 static uint8_t *mqttData = nullptr ;
@@ -327,9 +327,9 @@ void mqttClientReceiveMessage(int messageSize)
327327
328328 if (mqttCount > 0 )
329329 {
330- // Check for localisedDistributionDictTopic
331- if ((localisedDistributionDictTopic .length () > 0 )
332- && (strcmp (topic, localisedDistributionDictTopic .c_str ()) == 0 ))
330+ // Check for localizedDistributionDictTopic
331+ if ((localizedDistributionDictTopic .length () > 0 )
332+ && (strcmp (topic, localizedDistributionDictTopic .c_str ()) == 0 ))
333333 {
334334 // We should be using a JSON library to read the nodes. But JSON is
335335 // heavy on RAM and the dict could be 25KB for Level 3.
@@ -381,9 +381,9 @@ void mqttClientReceiveMessage(int messageSize)
381381 minDist = distScaled;
382382 tile[12 ] = 0 ; // Convert the second quote to NULL for snprintf
383383 char tileTopic[50 ];
384- snprintf (tileTopic, sizeof (tileTopic), " %s" , localisedDistributionDictTopic .c_str ());
384+ snprintf (tileTopic, sizeof (tileTopic), " %s" , localizedDistributionDictTopic .c_str ());
385385 snprintf (&tileTopic[strlen (localizedPrefix) + 13 ], sizeof (tileTopic) - (strlen (localizedPrefix) + 13 ), " %s" , tile + 1 ); // Start after the first quote
386- localisedDistributionTileTopic = tileTopic;
386+ localizedDistributionTileTopic = tileTopic;
387387 }
388388 }
389389 tile = strtok_r (nullptr , " ," , &preservedTile);
@@ -474,9 +474,9 @@ void mqttClientReceiveMessage(int messageSize)
474474 ((strlen (settings.regionalCorrectionTopics [settings.geographicRegion ]) > 0 )
475475 && (strcmp (topic, settings.regionalCorrectionTopics [settings.geographicRegion ]) == 0 ))
476476 ||
477- // Or from the localised distribution tile topic
478- ((localisedDistributionTileTopic .length () > 0 )
479- && (strcmp (topic, localisedDistributionTileTopic .c_str ()) == 0 ))
477+ // Or from the localized distribution tile topic
478+ ((localizedDistributionTileTopic .length () > 0 )
479+ && (strcmp (topic, localizedDistributionTileTopic .c_str ()) == 0 ))
480480 )
481481 {
482482 // SPARTN
@@ -830,8 +830,8 @@ void mqttClientUpdate()
830830
831831 mqttSubscribeTopics.clear (); // Clear the list of MQTT topics to be subscribed to
832832 mqttClientSubscribedTopics.clear (); // Clear the list of topics currently subscribed to
833- localisedDistributionDictTopic = " " ;
834- localisedDistributionTileTopic = " " ;
833+ localizedDistributionDictTopic = " " ;
834+ localizedDistributionTileTopic = " " ;
835835
836836 // Subscribe to AssistNow MGA if enabled
837837 if (settings.useAssistNow )
@@ -936,21 +936,21 @@ void mqttClientUpdate()
936936 if (breakOut)
937937 break ; // Break out of this state
938938
939- // Check if localised distribution is enabled
940- if ((strlen (settings.regionalCorrectionTopics [settings.geographicRegion ]) > 0 ) && (settings.useLocalisedDistribution ))
939+ // Check if localized distribution is enabled
940+ if ((strlen (settings.regionalCorrectionTopics [settings.geographicRegion ]) > 0 ) && (settings.useLocalizedDistribution ))
941941 {
942942 uint8_t fixType = gnssGetFixType ();
943943 double latitude = gnssGetLatitude (); // degrees
944944 double longitude = gnssGetLongitude (); // degrees
945945 if (fixType >= 3 ) // If we have a 3D fix
946946 {
947947 // If both the dict and tile topics are empty, prepare to subscribe to the dict topic
948- if ((localisedDistributionDictTopic .length () == 0 ) && (localisedDistributionTileTopic .length () == 0 ))
948+ if ((localizedDistributionDictTopic .length () == 0 ) && (localizedDistributionTileTopic .length () == 0 ))
949949 {
950950 float tileDelta = 2.5 ; // 2.5 degrees (10 degrees and 5 degrees are also possible)
951- if ((settings.localisedDistributionTileLevel == 0 ) || (settings.localisedDistributionTileLevel == 3 ))
951+ if ((settings.localizedDistributionTileLevel == 0 ) || (settings.localizedDistributionTileLevel == 3 ))
952952 tileDelta = 10.0 ;
953- if ((settings.localisedDistributionTileLevel == 1 ) || (settings.localisedDistributionTileLevel == 4 ))
953+ if ((settings.localizedDistributionTileLevel == 1 ) || (settings.localizedDistributionTileLevel == 4 ))
954954 tileDelta = 5.0 ;
955955
956956 float lat = latitude; // Degrees
@@ -965,34 +965,34 @@ void mqttClientUpdate()
965965
966966 char dictTopic[50 ];
967967 snprintf (dictTopic, sizeof (dictTopic), " %s%c%c%04d%c%05d/dict" ,
968- localizedPrefix, char (0x30 + settings.localisedDistributionTileLevel ),
968+ localizedPrefix, char (0x30 + settings.localizedDistributionTileLevel ),
969969 (lat_i < 0 ) ? ' S' : ' N' , abs (lat_i),
970970 (lon_i < 0 ) ? ' W' : ' E' , abs (lon_i));
971971
972972
973- localisedDistributionDictTopic = dictTopic;
974- mqttSubscribeTopics.push_back (localisedDistributionDictTopic );
973+ localizedDistributionDictTopic = dictTopic;
974+ mqttSubscribeTopics.push_back (localizedDistributionDictTopic );
975975
976976 breakOut = true ;
977977 }
978978
979- // localisedDistributionTileTopic is populated by mqttClientReceiveMessage
980- // If both the dict and tile topics are populated, prepare to subscribe to the localised tile topic
981- // Empty localisedDistributionDictTopic afterwardds to prevent this state being repeated
982- if ((localisedDistributionDictTopic .length () > 0 ) && (localisedDistributionTileTopic .length () > 0 ))
979+ // localizedDistributionTileTopic is populated by mqttClientReceiveMessage
980+ // If both the dict and tile topics are populated, prepare to subscribe to the localized tile topic
981+ // Empty localizedDistributionDictTopic afterwardds to prevent this state being repeated
982+ if ((localizedDistributionDictTopic .length () > 0 ) && (localizedDistributionTileTopic .length () > 0 ))
983983 {
984- // Subscribe to the localisedDistributionTileTopic
985- mqttSubscribeTopics.push_back (localisedDistributionTileTopic );
986- // Unsubscribe from the localisedDistributionDictTopic
987- std::vector<String>::iterator pos = std::find (mqttSubscribeTopics.begin (), mqttSubscribeTopics.end (), localisedDistributionDictTopic );
984+ // Subscribe to the localizedDistributionTileTopic
985+ mqttSubscribeTopics.push_back (localizedDistributionTileTopic );
986+ // Unsubscribe from the localizedDistributionDictTopic
987+ std::vector<String>::iterator pos = std::find (mqttSubscribeTopics.begin (), mqttSubscribeTopics.end (), localizedDistributionDictTopic );
988988 if (pos != mqttSubscribeTopics.end ())
989989 mqttSubscribeTopics.erase (pos);
990990 // Unsubscribe from the continental corrections
991991 pos = std::find (mqttSubscribeTopics.begin (), mqttSubscribeTopics.end (), String (settings.regionalCorrectionTopics [settings.geographicRegion ]));
992992 if (pos != mqttSubscribeTopics.end ())
993993 mqttSubscribeTopics.erase (pos);
994994
995- localisedDistributionDictTopic = " " ; // Empty localisedDistributionDictTopic to prevent this state being repeated
995+ localizedDistributionDictTopic = " " ; // Empty localizedDistributionDictTopic to prevent this state being repeated
996996 breakOut = true ;
997997 }
998998
0 commit comments