|
2 | 2 |
|
3 | 3 | ## Events
|
4 | 4 |
|
5 |
| -### Adding Resources |
| 5 | +Events are streamed from a websocket connection to `/streams/visualizer`. All events are JSON representations of the Go type `map[string]string`. |
| 6 | + |
| 7 | +### Adding Items |
| 8 | + |
| 9 | +The following events are recieved when a new item should be added to the visualization. |
| 10 | + |
| 11 | +##### NewDevice |
| 12 | + |
| 13 | +This event instructs views to add a new device to the visualization. |
6 | 14 |
|
7 | 15 | ```js
|
8 | 16 | {
|
9 |
| - "NewDevices": [ |
10 |
| - { |
11 |
| - "MAC": "11:22:33:44:55:66", |
12 |
| - "VendorByes": "", |
13 |
| - "IsAP": "false", |
14 |
| - } |
15 |
| - // ... |
16 |
| - ], |
17 |
| - "NewNetworks": [ |
18 |
| - { |
19 |
| - "": "" |
20 |
| - } |
21 |
| - // ... |
22 |
| - ] |
23 |
| - // ... |
| 17 | + "type": "NewDevice", |
| 18 | + "MAC": "11:22:33:44:55:66", |
| 19 | + "VendorByes": "", |
| 20 | + "IsAP": "false", |
24 | 21 | }
|
25 | 22 | ```
|
26 | 23 |
|
27 |
| -### Updating Resources |
| 24 | +##### NewAssociation |
| 25 | + |
| 26 | +This event instructs views to associate two devices on the graph. |
| 27 | + |
| 28 | +```js |
| 29 | +{ |
| 30 | + "type": "NewAssociation", |
| 31 | + "MAC1": "11:22:33:44:55:66", |
| 32 | + "MAC2": "11:22:33:44:55:66", |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +### Updating Items |
| 37 | + |
| 38 | +##### UpdateAssociation |
| 39 | + |
| 40 | +```js |
| 41 | +{ |
| 42 | + "type": "UpdateAssociation", |
| 43 | + "MAC1": "11:22:33:44:55:66", |
| 44 | + "MAC2": "11:22:33:44:55:66", |
| 45 | + "MAC1Tx": "16325" |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +### Drawing Events |
| 50 | + |
| 51 | +These events are one time animations that do not impact the state of the graph. |
| 52 | + |
| 53 | +##### AnimateNullProbeRequest |
| 54 | + |
| 55 | +This animation indicates a device has probed for any available network. |
| 56 | + |
| 57 | +```js |
| 58 | +{ |
| 59 | + "type": "AnimateNullProbeRequest", |
| 60 | + "MAC1": "11:22:33:44:55:66", |
| 61 | +} |
| 62 | +``` |
| 63 | + |
| 64 | +##### AnimateProbeRequest |
| 65 | + |
| 66 | +This animation indicates a device has probed for a specific SSID. |
| 67 | + |
| 68 | +```js |
| 69 | +{ |
| 70 | + "type": "AnimateProbeRequest", |
| 71 | + "MAC1": "11:22:33:44:55:66", |
| 72 | + "SSID": "wifi" |
| 73 | +} |
| 74 | +``` |
28 | 75 |
|
29 |
| -### Removing Resources |
| 76 | +### Removing Items |
0 commit comments