Use osmocom.construct.{Bytes,GreedyBytes} for hexstring input support
The upstream construct.{Bytes,GreedyBytes} only support bytes/bytearray
input data for the encoder, while the [newly-created]
osmocom.construct.{Bytes,GreedyBytes} support alternatively hex-string input.
This is important in the context of encoding construct-based types from
JSON, where our osmocom.utils.JsonEncoder will automatically convert any
bytes to hex-string, while re-encoding those hex-strings will fail prior
to this patch.
Change-Id: I1c8df6350c68aa408ec96ff6cd1e405ceb1a4fbb
Closes: OS#6774
This commit is contained in:
@@ -19,9 +19,9 @@ hence need to be in a separate python module to avoid circular dependencies.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
from construct import Struct, Switch, Bytes, GreedyString, GreedyBytes, Int8ub, Prefixed, Enum, Byte
|
||||
from construct import Struct, Switch, GreedyString, Int8ub, Prefixed, Enum, Byte
|
||||
from osmocom.tlv import BER_TLV_IE, TLV_IE_Collection
|
||||
from osmocom.construct import HexAdapter, Utf8Adapter
|
||||
from osmocom.construct import Bytes, HexAdapter, Utf8Adapter, GreedyBytes
|
||||
from pySim.filesystem import *
|
||||
|
||||
# TS 31.103 Section 4.2.16
|
||||
|
||||
Reference in New Issue
Block a user