File tree Expand file tree Collapse file tree 4 files changed +14
-4
lines changed Expand file tree Collapse file tree 4 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ Parameter | Function | Default
18
18
host | (Remote-) node we're connecting to. | 0.0.0.0
19
19
port | Iota-api port on the node. | 14265
20
20
id | Identifies the streamobject. | "SensorNode"
21
- location | Nodes location, eg. "Home" or " 52.26°N 13.42°E" [ ... ] . | "Home"
21
+ location | Nodes location, eg. 'lat': 52.26 'lng': 13.42. | {'lat': 40.65, 'lng': -73.91}
22
22
seed | Seed for creating transactions/MAM-messages. | [ generated]
23
23
rec | Receiving address (tanglestream only). | "GPB9PBNCJTPGF..."
24
24
tag | Tag for Transactions (tanglestream only). | "SENSORNODEROCKS"
Original file line number Diff line number Diff line change @@ -28,6 +28,16 @@ async function readSensor () {
28
28
return await json ;
29
29
}
30
30
31
+ /* coordinate generators (for testing) */
32
+
33
+ function lat ( ) {
34
+ return Math . round ( ( Math . random ( ) * 0.05 + 40.65 ) * 100 ) / 100 ;
35
+ }
36
+
37
+ function lng ( ) {
38
+ return Math . round ( ( Math . random ( ) * 0.05 + - 73.91 ) * 100 ) / 100 ;
39
+ }
40
+
31
41
//#############################################
32
42
//## SETUP STREAMS ##
33
43
//#############################################
@@ -37,7 +47,7 @@ streams.push(new MAM_STREAM ({
37
47
'host' : 'http://0.0.0.0' ,
38
48
'port' : 14265 ,
39
49
'id' : 'SensorNode (MAM)' ,
40
- 'location' : 'Home' ,
50
+ 'location' : { 'lat' : lat ( ) , 'lng' : lng ( ) }
41
51
} ) )
42
52
43
53
/* TANGLESTREAM */
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class STREAM {
18
18
} ) ;
19
19
20
20
this . id = _stream . id || 'SensorNode' ;
21
- this . location = _stream . location || 'Home' ;
21
+ this . location = _stream . location || { 'lat' : 40.65 , 'lng' : - 73.91 } ;
22
22
this . sources = [ ] ;
23
23
24
24
this . seed = _stream . seed || this . generateSeed ( ) ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class MAM_STREAM {
19
19
} ) ;
20
20
21
21
this . id = _stream . id || 'SensorNode' ;
22
- this . location = _stream . location || 'Home' ;
22
+ this . location = _stream . location || { 'lat' : 40.65 , 'lng' : - 73.91 } ;
23
23
this . sources = [ ] ;
24
24
25
25
this . seed = _stream . seed || this . generateSeed ( ) ;
You can’t perform that action at this time.
0 commit comments