Skip to content

Commit

Permalink
Merge pull request #8 from scs/feature/gurux_update
Browse files Browse the repository at this point in the history
Feature/gurux update
* set and freeze gurux-dlms to 1.0.107
* reduce max HDLC buffer size to 5KB (~10x default L+G meter message)
  • Loading branch information
raymar9 authored Sep 10, 2021
2 parents 419a9f8 + 8cc89f8 commit 6845bab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ verify_ssl = true
name = "pypi"

[packages]
aioserial = "~=1.3"
asyncio-mqtt = "~=0.10"
gurux-dlms = "~=1.0.104"
aioserial = "~=1.3.0"
asyncio-mqtt = "~=0.10.0"
gurux-dlms = "==1.0.107"

[dev-packages]
autopep8 = "*"
Expand Down
8 changes: 4 additions & 4 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
install_requires=[
"aioserial==1.3.0",
"asyncio-mqtt==0.10.0",
"gurux-dlms==1.0.104",
"gurux-dlms==1.0.107",
"paho-mqtt==1.5.1",
"pyserial==3.5",
],
scripts=['bin/smartmeter-datacollector'],
scripts=["bin/smartmeter-datacollector"],
zip_safe=True,
dependency_links=[],
)
13 changes: 8 additions & 5 deletions smartmeter_datacollector/smartmeter/hdlc_dlms_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from typing import Any, Dict, List, Optional, Tuple

from gurux_dlms import GXByteBuffer, GXDateTime, GXDLMSClient, GXReplyData
from gurux_dlms.enums import ObjectType, Security
from gurux_dlms.enums import InterfaceType, ObjectType, Security
from gurux_dlms.objects import GXDLMSClock, GXDLMSData, GXDLMSObject, GXDLMSRegister
from gurux_dlms.secure import GXDLMSSecureClient

Expand All @@ -21,17 +21,20 @@


class HdlcDlmsParser:
HDLC_BUFFER_MAX_SIZE = 10000
HDLC_BUFFER_MAX_SIZE = 5000

def __init__(self, cosem_config: CosemConfig, block_cipher_key: str = None) -> None:
if block_cipher_key:
self._client = GXDLMSSecureClient(True)
self._client = GXDLMSSecureClient(
useLogicalNameReferencing=True,
interfaceType=InterfaceType.HDLC)
self._client.ciphering.security = Security.ENCRYPTION
self._client.ciphering.blockCipherKey = GXByteBuffer.hexToBytes(block_cipher_key)
else:
self._client = GXDLMSClient(True)
self._client = GXDLMSClient(
useLogicalNameReferencing=True,
interfaceType=InterfaceType.HDLC)

# self._client.settings.standard = Standard.IDIS use IDIS for ISKRA meter?
self._hdlc_buffer = GXByteBuffer()
self._dlms_data = GXReplyData()
self._cosem = cosem_config
Expand Down

0 comments on commit 6845bab

Please sign in to comment.