forked from jordanh/cp4pc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cwm.py
31 lines (27 loc) · 975 Bytes
/
cwm.py
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
#
# Copyright (c) 2009-2012 Digi International Inc.
# All rights not expressly granted are reserved.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
#
# Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
#
"""Filler for compiling cwm_data.py"""
from simulator_settings import settings
def _get_ws_parms():
host = settings["idigi_server"]
device = settings["device_id"]
# find a better place for this
token = 'cwm_ds'
path = '/ws/device'
port = 80
device = device.replace('-', '')
device = device.lower()
token = "0x" + device + ":" + token
# NDS code says uu encode, but its really the base64 variant
encoded = token.encode('base64_codec')
encoded = encoded.strip()
address = host #+ ":" + str(port)
return address, encoded, path, port, 0x1337