solax-py-library 1.0.0.16__tar.gz → 1.0.0.17__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/PKG-INFO +1 -1
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/pyproject.toml +1 -1
- solax_py_library-1.0.0.17/solax_py_library/__init__.py +1 -0
- solax_py_library-1.0.0.16/solax_py_library/upload/errors/base.py → solax_py_library-1.0.0.17/solax_py_library/exception.py +1 -1
- solax_py_library-1.0.0.17/solax_py_library/snap_shot/__init__.py +3 -0
- solax_py_library-1.0.0.17/solax_py_library/snap_shot/constant/__init__.py +5 -0
- solax_py_library-1.0.0.16/solax_py_library/snap_shot/address.py → solax_py_library-1.0.0.17/solax_py_library/snap_shot/constant/crc_table.py +0 -41
- solax_py_library-1.0.0.17/solax_py_library/snap_shot/core/__init__.py +7 -0
- solax_py_library-1.0.0.16/solax_py_library/snap_shot/core.py → solax_py_library-1.0.0.17/solax_py_library/snap_shot/core/snap_shot.py +3 -3
- solax_py_library-1.0.0.17/solax_py_library/snap_shot/exceptions/__init__.py +3 -0
- solax_py_library-1.0.0.17/solax_py_library/snap_shot/exceptions/snap_shot.py +9 -0
- solax_py_library-1.0.0.17/solax_py_library/snap_shot/types/__init__.py +15 -0
- solax_py_library-1.0.0.17/solax_py_library/snap_shot/types/address.py +39 -0
- {solax_py_library-1.0.0.16/solax_py_library/upload/errors → solax_py_library-1.0.0.17/solax_py_library/upload/exceptions}/__init__.py +2 -2
- {solax_py_library-1.0.0.16/solax_py_library/upload/errors → solax_py_library-1.0.0.17/solax_py_library/upload/exceptions}/upload_error.py +5 -5
- solax_py_library-1.0.0.17/solax_py_library/upload/test/__init__.py +0 -0
- solax_py_library-1.0.0.17/solax_py_library/utils/__init__.py +0 -0
- solax_py_library-1.0.0.16/solax_py_library/snap_shot/untils.py → solax_py_library-1.0.0.17/solax_py_library/utils/common.py +0 -1
- {solax_py_library-1.0.0.16/solax_py_library/snap_shot → solax_py_library-1.0.0.17/solax_py_library/utils}/parser.py +2 -3
- solax_py_library-1.0.0.16/solax_py_library/__init__.py +0 -1
- solax_py_library-1.0.0.16/solax_py_library/snap_shot/__init__.py +0 -4
- solax_py_library-1.0.0.16/solax_py_library/snap_shot/exceptions.py +0 -6
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/README.md +0 -0
- {solax_py_library-1.0.0.16/solax_py_library/snap_shot → solax_py_library-1.0.0.17/solax_py_library/snap_shot/core}/base_modbus.py +0 -0
- {solax_py_library-1.0.0.16/solax_py_library/upload → solax_py_library-1.0.0.17/solax_py_library/snap_shot}/test/__init__.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/__init__.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/api/__init__.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/api/service.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/core/__init__.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/core/data_adapter/__init__.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/core/data_adapter/base.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/core/data_adapter/csv.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/core/upload_service/__init__.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/core/upload_service/base.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/core/upload_service/ftp.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/test/test_ftp.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/types/__init__.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/types/client.py +0 -0
- {solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/types/ftp.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__all__ = ["upload", "snap_shot"]
|
@@ -1,37 +1,3 @@
|
|
1
|
-
from enum import Enum
|
2
|
-
|
3
|
-
|
4
|
-
class SnapshotMCUSource(Enum):
|
5
|
-
MCU_SOURCE_MDSP = 0
|
6
|
-
MCU_SOURCE_SDSP = 1
|
7
|
-
|
8
|
-
|
9
|
-
class SnapshotExportDevice(Enum):
|
10
|
-
EXPORT_DEVICE_UART = 0
|
11
|
-
EXPORT_DEVICE_USB = 1
|
12
|
-
|
13
|
-
|
14
|
-
class SnapshotStartResult(Enum):
|
15
|
-
SNAPSHOT_START_START = 0xAAAA
|
16
|
-
SNAPSHOT_START_SUCCESS = 0xA5A5
|
17
|
-
SNAPSHOT_START_FAILED = 0x5A5A
|
18
|
-
SNAPSHOT_START_STOP = 0xBBBB
|
19
|
-
|
20
|
-
|
21
|
-
class SnapshotRegisterAddress(Enum):
|
22
|
-
SNAPSHOT_REGISTERADDRESS_MCUSOURCE = 0x4011
|
23
|
-
SNAPSHOT_REGISTERADDRESS_EXPORTDEVICE = 0x4012
|
24
|
-
SNAPSHOT_REGISTERADDRESS_START = 0x4013
|
25
|
-
SNAPSHOT_REGISTERADDRESS_TOTALNUMBER = 0x4070
|
26
|
-
SNAPSHOT_REGISTERADDRESS_SNAPSHOTINDEX = 0x4071
|
27
|
-
SNAPSHOT_REGISTERADDRESS_PACKDATASTATUS = 0x4072
|
28
|
-
SNAPSHOT_REGISTERADDRESS_DATASIZE = 0x4073
|
29
|
-
SNAPSHOT_REGISTERADDRESS_CHANNELNUMBER = 0x4074
|
30
|
-
SNAPSHOT_REGISTERADDRESS_CHANNELDATASIZE = 0x4075
|
31
|
-
SNAPSHOT_REGISTERADDRESS_PACKINDEX = 0x407F
|
32
|
-
SNAPSHOT_REGISTERADDRESS_PACKDATA = 0x4080
|
33
|
-
|
34
|
-
|
35
1
|
CRC_Table = [
|
36
2
|
0x0000,
|
37
3
|
0x8005,
|
@@ -290,10 +256,3 @@ CRC_Table = [
|
|
290
256
|
0x558207,
|
291
257
|
0x550202,
|
292
258
|
]
|
293
|
-
|
294
|
-
|
295
|
-
class CommandType(Enum):
|
296
|
-
ACK = 0x80 # 接收应答
|
297
|
-
TOTAL_PACKETS = 0x81 # 上报总包数
|
298
|
-
DATA_PACKET = 0x82 # 具体分包数据
|
299
|
-
ERROR = 0x83 # 报错应答
|
@@ -1,9 +1,9 @@
|
|
1
1
|
from typing import Dict, Optional, List
|
2
2
|
import asyncio
|
3
3
|
|
4
|
-
from .base_modbus import ModbusClientBase
|
5
|
-
from .address import *
|
6
|
-
from .
|
4
|
+
from solax_py_library.snap_shot.core.base_modbus import ModbusClientBase
|
5
|
+
from solax_py_library.snap_shot.types.address import *
|
6
|
+
from solax_py_library.utils.common import retry
|
7
7
|
|
8
8
|
|
9
9
|
class SnapshotCore:
|
@@ -0,0 +1,15 @@
|
|
1
|
+
from .address import (
|
2
|
+
SnapshotMCUSource,
|
3
|
+
SnapshotRegisterAddress,
|
4
|
+
SnapshotStartResult,
|
5
|
+
SnapshotExportDevice,
|
6
|
+
CommandType,
|
7
|
+
)
|
8
|
+
|
9
|
+
__all__ = [
|
10
|
+
"SnapshotMCUSource",
|
11
|
+
"SnapshotRegisterAddress",
|
12
|
+
"SnapshotStartResult",
|
13
|
+
"SnapshotExportDevice",
|
14
|
+
"CommandType",
|
15
|
+
]
|
@@ -0,0 +1,39 @@
|
|
1
|
+
from enum import IntEnum
|
2
|
+
|
3
|
+
|
4
|
+
class SnapshotMCUSource(IntEnum):
|
5
|
+
MCU_SOURCE_MDSP = 0
|
6
|
+
MCU_SOURCE_SDSP = 1
|
7
|
+
|
8
|
+
|
9
|
+
class SnapshotExportDevice(IntEnum):
|
10
|
+
EXPORT_DEVICE_UART = 0
|
11
|
+
EXPORT_DEVICE_USB = 1
|
12
|
+
|
13
|
+
|
14
|
+
class SnapshotStartResult(IntEnum):
|
15
|
+
SNAPSHOT_START_START = 0xAAAA
|
16
|
+
SNAPSHOT_START_SUCCESS = 0xA5A5
|
17
|
+
SNAPSHOT_START_FAILED = 0x5A5A
|
18
|
+
SNAPSHOT_START_STOP = 0xBBBB
|
19
|
+
|
20
|
+
|
21
|
+
class SnapshotRegisterAddress(IntEnum):
|
22
|
+
SNAPSHOT_REGISTERADDRESS_MCUSOURCE = 0x4011
|
23
|
+
SNAPSHOT_REGISTERADDRESS_EXPORTDEVICE = 0x4012
|
24
|
+
SNAPSHOT_REGISTERADDRESS_START = 0x4013
|
25
|
+
SNAPSHOT_REGISTERADDRESS_TOTALNUMBER = 0x4070
|
26
|
+
SNAPSHOT_REGISTERADDRESS_SNAPSHOTINDEX = 0x4071
|
27
|
+
SNAPSHOT_REGISTERADDRESS_PACKDATASTATUS = 0x4072
|
28
|
+
SNAPSHOT_REGISTERADDRESS_DATASIZE = 0x4073
|
29
|
+
SNAPSHOT_REGISTERADDRESS_CHANNELNUMBER = 0x4074
|
30
|
+
SNAPSHOT_REGISTERADDRESS_CHANNELDATASIZE = 0x4075
|
31
|
+
SNAPSHOT_REGISTERADDRESS_PACKINDEX = 0x407F
|
32
|
+
SNAPSHOT_REGISTERADDRESS_PACKDATA = 0x4080
|
33
|
+
|
34
|
+
|
35
|
+
class CommandType(IntEnum):
|
36
|
+
ACK = 0x80 # 接收应答
|
37
|
+
TOTAL_PACKETS = 0x81 # 上报总包数
|
38
|
+
DATA_PACKET = 0x82 # 具体分包数据
|
39
|
+
ERROR = 0x83 # 报错应答
|
@@ -1,8 +1,8 @@
|
|
1
|
-
from .
|
1
|
+
from solax_py_library.exception import SolaxBaseError
|
2
2
|
from .upload_error import ConfigurationError, ConnectError, LoginError, SendDataError
|
3
3
|
|
4
4
|
__all__ = [
|
5
|
-
"
|
5
|
+
"SolaxBaseError",
|
6
6
|
"ConnectError",
|
7
7
|
"LoginError",
|
8
8
|
"SendDataError",
|
@@ -1,21 +1,21 @@
|
|
1
|
-
from .
|
1
|
+
from solax_py_library.exception import SolaxBaseError
|
2
2
|
|
3
3
|
|
4
|
-
class ConnectError(
|
4
|
+
class ConnectError(SolaxBaseError):
|
5
5
|
code = 0x1001
|
6
6
|
message = "connect error"
|
7
7
|
|
8
8
|
|
9
|
-
class LoginError(
|
9
|
+
class LoginError(SolaxBaseError):
|
10
10
|
code = 0x1002
|
11
11
|
message = "authentication error"
|
12
12
|
|
13
13
|
|
14
|
-
class SendDataError(
|
14
|
+
class SendDataError(SolaxBaseError):
|
15
15
|
code = 0x1003
|
16
16
|
message = "send data error"
|
17
17
|
|
18
18
|
|
19
|
-
class ConfigurationError(
|
19
|
+
class ConfigurationError(SolaxBaseError):
|
20
20
|
code = 0x1004
|
21
21
|
message = "server configuration error"
|
File without changes
|
File without changes
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import re
|
2
2
|
import struct
|
3
3
|
|
4
|
-
from .address import
|
4
|
+
from solax_py_library.snap_shot.types.address import CommandType
|
5
|
+
from solax_py_library.snap_shot.constant.crc_table import CRC_Table
|
5
6
|
|
6
7
|
|
7
8
|
class Parser:
|
@@ -72,8 +73,6 @@ class Parser:
|
|
72
73
|
end = start + chunk_size
|
73
74
|
yield (i, data[start:end])
|
74
75
|
|
75
|
-
import struct
|
76
|
-
|
77
76
|
def build_response_frame(
|
78
77
|
self, task_id: str, business_type: int, ack_code: int
|
79
78
|
) -> bytes:
|
@@ -1 +0,0 @@
|
|
1
|
-
__all__ = ["upload"]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/api/__init__.py
RENAMED
File without changes
|
{solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/api/service.py
RENAMED
File without changes
|
{solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/core/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/test/test_ftp.py
RENAMED
File without changes
|
{solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/types/__init__.py
RENAMED
File without changes
|
{solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/types/client.py
RENAMED
File without changes
|
{solax_py_library-1.0.0.16 → solax_py_library-1.0.0.17}/solax_py_library/upload/types/ftp.py
RENAMED
File without changes
|