# Path: pydatacoll/utils/read_config.py



from construct import *
from enum import IntEnum
from pydatacoll.utils.read_config import config
import datetime
#!/usr/bin/env python
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.



class IECParam(IntEnum):
    # socket的connect / listen超时
    T0 = config.getint('IEC104', 'T0', fallback=30)
    # 发送I帧或U帧后，等待对方应答，等待超过T1则重启链路
    T1 = config.getint('IEC104', 'T1', fallback=15)
    # 接收到I帧后等待T2时间，然后发送对I帧的应答
    T2 = config.getint('IEC104', 'T2', fallback=10)
    # T3时间内未收到任何报文，发送TESTFR
    T3 = config.getint('IEC104', 'T3', fallback=20)
    # 发送方在有k个I格式报文未得到对方的确认时，将停止数据传送
    K = config.getint('IEC104', 'K', fallback=12)
    # 接收方最迟在接收了w个I格式报文后应发出认可

# Path: pydatacoll/utils/read_config.py



# Path: pydatacoll/protocols/iec104/frame.py
from construct import *
from enum import IntEnum
from pydatacoll.utils.read_config import config
import datetime

#!/usr/bin/env python
#
# Copyright 2016 timercrack
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.



class IECParam(IntEnum):
    # socket的connect / listen超时
    T0 = config.getint('IEC104', 'T0', fallback=30)
    # 发送I帧或U帧后，等待对方应答，等待超过T1则重启链路
    T1 = config.getint('IEC104', 'T1', fallback=15)
    # 接收到I帧后等待T2时间，然后发送对I帧的应答
    T2 = config.getint('IEC104', 'T2', fallback=10)
    # T3时间内未收到任何报文，发送TESTFR
    T3 = config.getint('IEC104', 'T3', fallback=20)
    # 发送方在有k个I格式报文未得到对方的确认时，将停止数据传送
    K = config.getint('IEC104', 'K', fallback=12)
    # 接收方最迟在接收了w个I格式报文后应发出认可

    W = config.getint('IEC104', 'W', fallback=8)