{"action":"created","issue":{"url":"https://api.github.com/repos/dronekit/dronekit-python/issues/585","repository_url":"https://api.github.com/repos/dronekit/dronekit-python","labels_url":"https://api.github.com/repos/dronekit/dronekit-python/issues/585/labels{/name}","comments_url":"https://api.github.com/repos/dronekit/dronekit-python/issues/585/comments","events_url":"https://api.github.com/repos/dronekit/dronekit-python/issues/585/events","html_url":"https://github.com/dronekit/dronekit-python/pull/585","id":135935631,"number":585,"title":"Support filtering incoming messages based on target_id","user":{"login":"peterbarker","id":7077857,"avatar_url":"https://avatars.githubusercontent.com/u/7077857?v=3","gravatar_id":"","url":"https://api.github.com/users/peterbarker","html_url":"https://github.com/peterbarker","followers_url":"https://api.github.com/users/peterbarker/followers","following_url":"https://api.github.com/users/peterbarker/following{/other_user}","gists_url":"https://api.github.com/users/peterbarker/gists{/gist_id}","starred_url":"https://api.github.com/users/peterbarker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterbarker/subscriptions","organizations_url":"https://api.github.com/users/peterbarker/orgs","repos_url":"https://api.github.com/users/peterbarker/repos","events_url":"https://api.github.com/users/peterbarker/events{/privacy}","received_events_url":"https://api.github.com/users/peterbarker/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dronekit/dronekit-python/labels/blocked","name":"blocked","color":"a319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-24T02:46:25Z","updated_at":"2016-02-24T05:21:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dronekit/dronekit-python/pulls/585","html_url":"https://github.com/dronekit/dronekit-python/pull/585","diff_url":"https://github.com/dronekit/dronekit-python/pull/585.diff","patch_url":"https://github.com/dronekit/dronekit-python/pull/585.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/dronekit/dronekit-python/issues/comments/188076899","html_url":"https://github.com/dronekit/dronekit-python/pull/585#issuecomment-188076899","issue_url":"https://api.github.com/repos/dronekit/dronekit-python/issues/585","id":188076899,"user":{"login":"hamishwillee","id":5368500,"avatar_url":"https://avatars.githubusercontent.com/u/5368500?v=3","gravatar_id":"","url":"https://api.github.com/users/hamishwillee","html_url":"https://github.com/hamishwillee","followers_url":"https://api.github.com/users/hamishwillee/followers","following_url":"https://api.github.com/users/hamishwillee/following{/other_user}","gists_url":"https://api.github.com/users/hamishwillee/gists{/gist_id}","starred_url":"https://api.github.com/users/hamishwillee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hamishwillee/subscriptions","organizations_url":"https://api.github.com/users/hamishwillee/orgs","repos_url":"https://api.github.com/users/hamishwillee/repos","events_url":"https://api.github.com/users/hamishwillee/events{/privacy}","received_events_url":"https://api.github.com/users/hamishwillee/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T05:21:55Z","updated_at":"2016-02-24T05:21:55Z","body":"1. Tests need to pass :-)\r\n2. I'm not sure filtering on ``None`` quite makes sense here - when would it ever be useful for a vehicle not to filter anything? \r\n3. If target system is 0 we do no filtering at all. Is that intentional? \r\n4. I'm a bit concerned this doesn't do quite what we think (though it may \"do the right job\")\r\n   ```\r\n   if self._target_system:\r\n      src = msg.get_srcSystem()\r\n      if src != self._target_system and src != 0:\r\n         return\r\n   ```\r\nSpecifically what we're getting back is msg.get_srcSystem(), which is appears to be always the source id of the message. We're not filtering on \"messages that were sent to us or broadcast\" but on \"messages that have the id we think is our target vehicle\". \r\n\r\nThe assumption in this code is that 0 is the sourceSystem for a broadcast message, and I don't think it is. I think that we probably don't see messages unless they are either intended for us or for broadcast. We need to confirm this.\r\n\r\nAnyway, if I'm right, then we don't need the filter on  src != 0. However we do need to consider whether we will process broadcast messages at all. Is there a case where we ever want to read messages from anything that isn't the vehicle? \r\n\r\n\r\n\r\n\r\n\r\n"}}