Skip to content

Commit

Permalink
Merge pull request #29 from Wiznet/issue#28
Browse files Browse the repository at this point in the history
Fix issue #28
  • Loading branch information
renakim committed Feb 8, 2022
2 parents 01067a8 + e455fa6 commit cd0724e
Show file tree
Hide file tree
Showing 5 changed files with 551 additions and 271 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ celerybeat-schedule
.env

# virtualenv
.venv
.venv*
venv/
ENV/

Expand Down
12 changes: 6 additions & 6 deletions WIZ510SSLCMDSET.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ def __init__(self, log_level):
# ----------------------------------------------
# WIZ750SR: F/W 1.2.0 verison or later
"TR": ["TCP Retransmission Retry count", "^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-5][0-5])$", {}, "RW"],
"OP": [
"Network Operation Mode",
"^[0-3]$",
{"0": "TCP Client mode", "1": "TCP Server mode", "2": "TCP Mixed mode", "3": "UDP mode"},
"RW",
],
# "OP": [
# "Network Operation Mode",
# "^[0-3]$",
# {"0": "TCP Client mode", "1": "TCP Server mode", "2": "TCP Mixed mode", "3": "UDP mode"},
# "RW",
# ],
"IM": ["IP address Allocation Mode", "^[0-1]$", {"0": "Static IP", "1": "DHCP"}, "RW"],
"LI": [
"Local IP address",
Expand Down
20 changes: 9 additions & 11 deletions WIZMakeCMD.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# -*- coding: utf-8 -*-

## Make Serial command
"""
Make Serial command
"""

import sys
import logging
import re
import logging

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger()
Expand Down Expand Up @@ -36,9 +38,9 @@
"KA", "KI", "KE", "RI", "LI", "SM", "GW", "DS", "PI", "PP",
"DX", "DP", "DI", "DW", "DH", "LP", "RP", "RH", "BR", "DB",
"PR", "SB", "FL", "IT", "PT", "PS", "PD", "TE", "SS", "NP",
"SP", "S0", "S1"
"SP"
]
# cmd_ch1 = ['MC','VR','MN','UN','ST','IM','OP','DD','CP','PO','DG','KA','KI','KE','RI','LI','SM','GW','DS','PI','PP','DX','DP','DI','DW','DH','LP','RP','RH','BR','DB','PR','SB','FL','IT','PT','PS','PD','TE','SS','NP','SP']
cmd_wiz75xsr = ["S0", "S1"]
cmd_added = ["SC", "TR"] # for WIZ750SR F/W version 1.2.0 or later
cmd_ch2 = [
"QS", "QO", "QH", "QP", "QL", "RV", "RA", "RE", "RR", "EN",
Expand All @@ -63,9 +65,9 @@
"QK", "PU", "U0", "U1", "U2", "QO", "RC", "CE", "BA"
]

### CMD list
# Command list
cmd_1p_default = cmd_ch1
cmd_1p_advanced = cmd_ch1 + cmd_added
cmd_1p_advanced = cmd_ch1 + cmd_wiz75xsr + cmd_added
cmd_2p_default = cmd_ch1 + cmd_ch2


Expand Down Expand Up @@ -143,9 +145,8 @@ def get_gpiovalue(self, mac_addr, idcode):
# TODO: device profile 적용
def setcommand(self, mac_addr, idcode, set_pw, command_list, param_list, devname, version):
cmd_list = self.make_header(mac_addr, idcode, devname=devname, set_pw=set_pw)
# print('Macaddr: %s' % mac_addr)
try:
# print('Macaddr: %s' % mac_addr)

for i in range(len(command_list)):
cmd_list.append([command_list[i], param_list[i]])

Expand All @@ -157,8 +158,6 @@ def setcommand(self, mac_addr, idcode, set_pw, command_list, param_list, devname
for cmd in cmd_1p_default:
cmd_list.append([cmd, ""])
elif devname in TWO_PORT_DEV or "752" in devname:
# for cmd in cmd_2p_default:
# cmd_list.append([cmd, ""])
# for WIZ752SR-12x
for cmd in cmd_ch2:
cmd_list.append([cmd, ""])
Expand Down Expand Up @@ -187,4 +186,3 @@ def factory_reset(self, mac_addr, idcode, set_pw, devname, param):
cmd_list = self.make_header(mac_addr, idcode, devname=devname, set_pw=set_pw)
cmd_list.append(["FR", param])
return cmd_list

0 comments on commit cd0724e

Please sign in to comment.