You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letpositionUserName="keith";// If you get a position from mqtt topic position/$user then update the UI with that position
23
+
letpositionUserName=null;// If you get a position from mqtt topic position/$user then update the UI with that position
24
24
letuserLastPositions={};// dictionary of most recent posObj keyed by user name
25
25
// make this null if you want to use your local position measurementes
26
26
// TODO: Make this configurable in the UI
@@ -61,6 +61,8 @@ function mqtt_login() {
61
61
// Make a unique-ish, random client ID
62
62
constrandint=Math.floor(Math.random()*1024*1024);
63
63
// Client ID must be unique otherwise it disconnects the other client.
64
+
// Ah wait, but "It is only used to identify the client to the broker when the connection is established in order to determine if stored messages and persistent subscriptions should be honoured.
65
+
// Hmm, not sure if we want unique ones or not.
64
66
constclientId=`${username}-${randint}`;
65
67
66
68
// Create a client instance
@@ -112,12 +114,31 @@ function updateTelemetry(data) {
112
114
functionupdateUserPosition(sendingUser,posobj){
113
115
// called a position received from a sendingUser
114
116
// may or may not be a new user
115
-
116
-
userLastPositions[sendingUser]=posobj;
117
-
console.log("Got position from ",sendingUser,posobj,Object.keys(userLastPositions));
118
117
119
-
// TODO: Update UI so our user can choose which person to display positionUserNames - could even use distances
0 commit comments