@@ -0,0 +1,1921 @@
+import csv%0Afrom datetime import datetime%0Aimport sys%0A%0Alogfile = open('mbus_snoop_log.txt','w')%0A%0Awr = csv.writer(open('snsv7_snoop.txt','w'), delimiter=',', lineterminator='%5Cn')%0Awr.writerow(%5B'DATE','TIME','C_MEAS','C_REF','C_REV','C_PAR'%5D)%0A%0Acount = 0%0A%0Acdc_cmeas = 0%0Acdc_crev = 0%0Acdc_cpar = 0%0Acdc_cref = 0%0Acdc_date = 0%0Acdc_time = 0%0Acdc_group = False%0A%0Adef callback(time, address, data, cb0=-1, cb1=-1):%0A    global count%0A    global cdc_cmeas, cdc_crev, cdc_cpar, cdc_cref, cdc_date, cdc_time, cdc_group%0A%0A    # m3_ice snoop prints this for you now %5Bthough needs to add count - can do%5D%0A    #print(%22@%22 + str(count) + %22 Time: %22 + datetime.now().strftime(%22%25Y-%25m-%25d %25H:%25M:%25S.%25f%22)%5B:-3%5D + %22  ADDR: 0x%22 + address.encode('hex') + %22  DATA: 0x%22 + data.encode('hex') + %22  (ACK: %22 + str(not cb1) + %22)%22)%0A    print %3E%3E logfile, %22@%22 + str(count) + %22 Time: %22 + datetime.now().strftime(%22%25Y-%25m-%25d %25H:%25M:%25S.%25f%22)%5B:-3%5D + %22  ADDR: 0x%22 + address.encode('hex') + %22  DATA: 0x%22 + data.encode('hex') + %22  (ACK: %22 + str(not cb1) + %22)%22%0A    if (str(int(address.encode('hex'),16))==%22116%22):%0A        cdc_group = True%0A        cdc_cmeas = int(data.encode('hex'),16)%0A        cdc_time = datetime.now().strftime(%22%25H:%25M:%25S.%25f%22)%5B:-3%5D%0A        cdc_date = datetime.now().strftime(%22%25Y-%25m-%25d%22)%0A    elif (str(int(address.encode('hex'),16))==%22118%22):%0A        if cdc_group:%0A            cdc_cref = int(data.encode('hex'),16)%0A    elif (str(int(address.encode('hex'),16))==%22119%22):%0A        if cdc_group:%0A            cdc_crev = int(data.encode('hex'),16)%0A    elif (str(int(address.encode('hex'),16))==%22121%22):%0A        if cdc_group:%0A            cdc_cpar = int(data.encode('hex'),16)%0A            wr.writerow(%5Bcdc_date,cdc_time,cdc_cmeas,cdc_cref,cdc_crev,cdc_cpar%5D)%0A            count += 1%0A            cdc_group = False%0A    #if count%3Eargs.killcount:%0A    #    sys.exit()%0A    # TODO(Pat): I need to add support for custom arguments, which I will do%0A    if count %3E 1000:%0A        sys.exit()%0A

Add example for m3_ice + callback