Skip to content

Commit

Permalink
specify interface type in gurux client
Browse files Browse the repository at this point in the history
  • Loading branch information
raymar9 committed Sep 9, 2021
1 parent 9e85c18 commit 8cc89f8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 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 @@ -25,13 +25,16 @@ class HdlcDlmsParser:

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 8cc89f8

Please sign in to comment.