abdo1819 / evil_car

car self reporting for traffic violation
2 stars 1 forks source link

Possible Modifications (Dependency injection + Redundancy reduction): [/gsm/gsm.py] #9

Open ak-seyam opened 4 years ago

ak-seyam commented 4 years ago

line(28,34) are redundant

line([28:35]) these data should be injected not hard defined within this file, my modifications old: line(141)

def sendHTTPRequest_POST(self,ser,host,request):

new:

def sendHTTPRequest_POST(self,ser,host,request,data):

line(36,37) are redundant line(143) " I've previously suggested to remove this field however if it's not removed remove the time key as the sever MUST use it's time" line(40) this should be injected as __init()__ parameter old:

    def __init__(self,verbose=True):
        # code...
        self.serial_port='/dev/ttyUSB0'

new:

    def __init__(self,verbose=True,serial_port):
        # code...
        self.ser=serial.Serial(serial_port, baudrate=115200, timeout=6)

etc... i hope you got my idea.

abdo1819 commented 4 years ago

hope you open multiple issues for every case i'am seeing

i will ask salma if she accept this work if not , I may do it

ak-seyam commented 4 years ago

hope you open multiple issues for every case

ok, i will

ak-seyam commented 4 years ago
i used server time because of field type only but you were wright 

please don't send time from client's machine it may pollute our data and will reduce portability

abdo1819 commented 4 years ago

then we need server to send time in egypt not greenwich https://github.com/abdo1819/server_evilcar/issues/1

and remove time sent by gsm here