From 8f67deaf47ca3e7cfe8eff974cd72a284635b231 Mon Sep 17 00:00:00 2001 From: chrishoder Date: Fri, 25 Jan 2013 21:37:17 +0000 Subject: [PATCH] update to GoodFETMCPCANCommunication.py to allow for id sweeps git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1418 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- client/GoodFETMCPCANCommunication.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/client/GoodFETMCPCANCommunication.py b/client/GoodFETMCPCANCommunication.py index 7d8c205..e269a7b 100644 --- a/client/GoodFETMCPCANCommunication.py +++ b/client/GoodFETMCPCANCommunication.py @@ -17,7 +17,7 @@ import array; import csv, time, argparse; import datetime import os - +from random import randrange from GoodFETMCPCAN import GoodFETMCPCAN; from intelhex import IntelHex; @@ -234,6 +234,29 @@ class GoodFETMCPCANCommunication: msgIDs.append(j) return msgIDs + def sweepRandom(self, freq, time = 5, number): + msgIDs = [] + ids = [] + for i in range(0,number,6): + idsTemp = [] + comment = "sweepFilter" + for j in range(0,6,1): + id = randrange(2047) + comment += "_%d" % id + idsTemp.append(id) + ids.append(id) + print comment + description = "Running a sweep filer for all the possible standard IDs. This runs the following : " + comment + count = self.sniff(freq=freq, duration=time, description=description, comment = comment, filename, standardid = idsTemp) + if( count != 0): + for element in idsTemp: + comment = "sweepFilter: %d" % (element) + description = "Running a sweep filer for all the possible standard IDs. This run filters for: %d " % element + count = self.sniff(freq=freq, duration = time, description = description,comment = comment, standardid = [element, element, element]) + if( count != 0): + msgIDs.append(j) + return msgIDs, ids + def sniffTest(self, freq): rate = freq; -- 2.20.1