Blame view

gw_RPi3/python/Endpoint.py 681 Bytes
7e6be9319   jfriedt   gateway commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  #!/usr/bin/env python3
  # -*- coding: utf-8 -*-
  """
  Created on Wed Jun  9 11:15:10 2021
  
  @author: Georges de Massol
  """
  import base64
  #import binascii
  
  class Endpoint:
      def __init__(self, EUI = None):
          """
  
          Parameters
          ----------
          EUI : bytes
              ex : bytes([0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01])
  
          Returns
          -------
          None.
  
          """
          # This must point to the API interface.
          self.EUI = EUI
          
          #EUI = bytes([0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01])
      def EUIfromjson(self, json):
          self.EUI = base64.b64decode(json["devEUI"]).hex()
          return self.EUI