bjeanes/go-lifx — pull request #13 by bjeanes (2014-07-29 16:28:38+00:00)
Title: Snoop filter by type

This PR really includes two changes:

* Printing out the IP address of the messages:

```
FROM: 192.168.11.33:56700
SIZE: 88
DATA: 000 58 00 00 54 00 00 00 00 d0 73 d5 00 0c af 00 00 |X..T.....s......|
010 4c 49 46 58 56 32 00 00 00 00 00 00 00 00 00 00 |LIFXV2..........|
020 6b 00 00 00 0a 16 32 33 ff ff ac 0d 00 00 ff ff |k.....23........|
030 f0 9f 94 ad 00 00 00 00 00 00 00 00 00 00 00 00 |................|
040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
050 01 00 00 00 00 00 00 00 |........|
MSG: &{Version:1024 Target:[208 115 213 0 12 175 0 0] Site:[76 73 70 88 86 50] AtTime:0 Addressable:true Tagged:false Acknowledge:false}
*payloads.LightState &{Color:{Hue:5642 Saturation:13106 Brightness:65535 Kelvin:3500} Dim:0 Power:65535 Label:🔭 Tags:1}
```

* Optionally, filtering by payload type:

``` sh-session
$ lifx-snoop pan # where "pan" is the case-insensitive filter on payload name
FROM: 192.168.11.52:56700
SIZE: 36
DATA: 000 24 00 00 34 00 00 00 00 00 00 00 00 00 00 00 00 |$..4............|
010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
020 02 00 00 00 |....|
MSG: &{Version:1024 Target:[0 0 0 0 0 0 0 0] Site:[0 0 0 0 0 0] AtTime:0 Addressable:true Tagged:true Acknowledge:false}
*payloads.DeviceGetPanGateway &{}

FROM: 192.168.11.33:56700
SIZE: 41
DATA: 000 29 00 00 54 00 00 00 00 d0 73 d5 00 03 c4 00 00 |)..T.....s......|
010 4c 49 46 58 56 32 00 00 00 00 00 00 00 00 00 00 |LIFXV2..........|
020 03 00 00 00 01 7c dd 00 00 |.....|...|
MSG: &{Version:1024 Target:[208 115 213 0 3 196 0 0] Site:[76 73 70 88 86 50] AtTime:0 Addressable:true Tagged:false Acknowledge:false}
*payloads.DeviceStatePanGateway &{Service:1 Port:56700}
```