Skip to content

Commit fe003c8

Browse files
committed
serverfix #4
1 parent ead38f8 commit fe003c8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

csn_server_helper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class ServerHelper:
1717
cID = 0 #client ID, used for LED color changing
1818
armed = True
1919
disarmed_lcd_showed = False
20+
breached = False
2021

2122

2223
def __init__(self,c,addr):
@@ -42,10 +43,11 @@ def RunAlarmTriggerTimer(self):
4243
elif(self.alarm_triggered == False and self.armed == True):
4344
lcd_text("All clients\nOK")
4445
elif(self.alarm_triggered == False and self.armed == False):
45-
lcd_text("Client "+self.cID+"\nDisarmed")
46+
lcd_text("Client "+str(self.cID)+"\nDisarmed")
4647

4748
def PoundAlarm(self):
48-
alarm(self)
49+
GPIOServerSide.alarm(self)
50+
self.breached = True
4951
print("Client",self.cID,"breached! Please investigate!")
5052
#alarm(self) #needs to be fired in seperate thread, to prevent blocking on main thread of client.
5153

packet_processor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ def AlarmDisarm(helper):
4646
helper.alarm_triggered = False
4747
helper.timer = 0 #time in sec.
4848
helper.armed = False
49+
helper.breached = False
4950

5051
def AlarmArm(helper):
5152
helper.alarm_triggered = False
5253
helper.timer = 0 #time in sec.
5354
helper.armed = True
55+
helper.breached = False
5456
#armed()
5557

5658

0 commit comments

Comments
 (0)