feature: in ListenMode, log the SECC MAC to MacLog.txt

This commit is contained in:
uhi22 2024-05-21 17:31:16 +02:00
parent 196c4c3ea5
commit 5ff3e813c1
2 changed files with 8 additions and 0 deletions

3
MacLog.txt Normal file
View file

@ -0,0 +1,3 @@
2024-05-21T17:29:08.611520 SECC MAC B8:27:EB:27:33:53
2024-05-21T17:29:18.323217 SECC MAC B8:27:EB:27:33:53
2024-05-21T17:29:27.135444 SECC MAC B8:27:EB:27:33:53

View file

@ -43,6 +43,7 @@ from pyPlcModes import *
from mytestsuite import *
from random import random
from configmodule import getConfigValue, getConfigValueBool
from datetime import datetime
import sys
MAC_BROADCAST = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF ]
@ -667,6 +668,10 @@ class pyPlcHomeplug():
self.enterState(STATE_SLAC_PARAM_CNF_RECEIVED) # enter next state. Will be handled in the cyclic runPevSequencer
if (self.iAmListener==1):
self.addToTrace("SECC MAC is " + self.getSourceMacAddressAsString())
strDateTime=datetime.today().strftime('%Y-%m-%dT%H:%M:%S.%f')
MacLogFile = open('MacLog.txt', 'a')
MacLogFile.write(strDateTime + " SECC MAC " + self.getSourceMacAddressAsString() + "\n") # write the MAC to the MacLogFile
MacLogFile.close()
def evaluateMnbcSoundInd(self):
# We received MNBC_SOUND.IND from the PEV. Normally this happens 10times, with a countdown (remaining number of sounds)