Skip to content

Commit

Permalink
the location data is working!
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpalumbo committed Jan 20, 2021
1 parent b2c473c commit b36090f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions allhands_fact_max.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,23 @@ if (mode === "server"){
// console.log(msg)
switch (msg.cmd){
// in case you want to receive other data and route it elsewhere
case 'locationReport':
let points = Object.keys(msg.data)
// Max.post(points)
for(i=0;i<points.length;i++){
let thisPoint = points[i]
let point = msg.data[thisPoint]
let newTTS = [thisPoint, point.ip, point.latitude, point.longitude, point.timezone, point.continent_code, point.country.en]
//let newAP = points[i]
localSend.send('/iplocation', newTTS, (err) => {
if (err) console.error(err);
});
// Max.post(newTTS)
}


break

case 'OSC':
// send formatted OSC message locally (i.e. a pd patch)
// console.log(msg.addressPattern.split('/')[1])
Expand Down
1 change: 1 addition & 0 deletions location.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ satelize.satelize({ip:'46.19.37.108'}, function(err, payload) {
// res.send(payload);
// res.json...
console.log(payload)
let locationMsg = [msg.name, payload.ip, payload.latitude, payload.longitude, payload.timezone, payload.continent_code, payload.country.en, payload.country_code]
});

0 comments on commit b36090f

Please sign in to comment.