Skip to content
Snippets Groups Projects
Commit f3996ba0 authored by jkerdreu's avatar jkerdreu
Browse files

Fix a stupid bug that cause unexpected answer


git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/fork@1505 b32b6428-25c9-4566-ad07-03861ab6144f
parent 19ecfb57
Branches
No related tags found
No related merge requests found
......@@ -7,12 +7,12 @@
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
......@@ -60,10 +60,19 @@ class Scanner:
def parse_answer(self,msg):
if (msg.msgtype == 'notify'):
if msg.action == 'alive':
if msg.source == self.addr:return #hidding myself
if msg.source not in self.seen:
print("%s : %s" % (msg.source,msg.devtype))
self.seen.append(msg.source)
# hidding myself
if msg.source == self.addr:
return
#it is really for us ?
if self.devtype != 'any.any':
if msg.devtype != self.devtype:
return
# already seen this
if msg.source in self.seen:
return
# everything is Ok :)
print("%s : %s" % (msg.source,msg.devtype))
self.seen.append(msg.source)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment