Use GetChannelClientId
David Blume

David Blume commited on 2018-10-21 14:12:17
Showing 4 changed files, with 9 additions and 12 deletions.

... ...
@@ -29,10 +29,6 @@ Here's [the corresponding server code](http://git.dlma.com/kvs.git/).
29 29
 
30 30
 [Yes](https://news.ycombinator.com/item?id=3067434).
31 31
 
32
-# To Do
33
-
34
-1. Replace roDeviceInfo.GetDeviceUniqueId with GetChannelClientId()
35
-
36 32
 # Licence
37 33
 
38 34
 This software uses the [MIT license](http://git.dlma.com/roku_ip_tagger.git/blob/master/LICENSE.txt).
... ...
@@ -3,13 +3,13 @@
3 3
   <children>
4 4
     <Label id="title"
5 5
       text="IP Tagger"
6
-      width="1200"
6
+      width="1160"
7 7
       height="100"
8 8
       horizAlign="right"
9 9
       vertAlign="top" />
10 10
     <Label id="updates"
11 11
       text=""
12
-      width="1200"
12
+      width="1160"
13 13
       height="600"
14 14
       horizAlign="left"
15 15
       vertAlign="bottom"
... ...
@@ -26,12 +26,12 @@
26 26
     m.title = m.top.findNode("title")
27 27
     m.title.font.size=92
28 28
     m.title.color="0x72D7EEFF"
29
-    m.title.translation = [40, 20]
29
+    m.title.translation = [60, 40]
30 30
 
31 31
     m.updates = m.top.findNode("updates")
32 32
     m.updates.font.size=46
33 33
     m.updates.color="0x62EE97FF"
34
-    m.updates.translation = [40, 100]
34
+    m.updates.translation = [60, 80]
35 35
 
36 36
     m.tagTask = CreateObject("roSGNode", "TagTask")
37 37
     m.tagTask.ObserveField("updateText", "onUpdateText")
... ...
@@ -21,9 +21,10 @@ function executeTask() as void
21 21
     m.port = CreateObject("roMessagePort")
22 22
 
23 23
     deviceInfo = CreateObject("roDeviceInfo")
24
-    deviceID = deviceInfo.GetDeviceUniqueId()
25
-    aaIPAddrs = deviceInfo.GetIPAddrs()
24
+    clientID = Right(deviceInfo.GetChannelClientId(), 12)
25
+    modelID = deviceInfo.GetModel()
26 26
 
27
+    aaIPAddrs = deviceInfo.GetIPAddrs()
27 28
     for each key in aaIPAddrs
28 29
         ipAddr = aaipAddrs[key]
29 30
         if ipAddr <> invalid and ipAddr.Len() > 0
... ...
@@ -31,7 +32,7 @@ function executeTask() as void
31 32
         end if
32 33
     end for
33 34
 
34
-    sendRequest(ipAddr, deviceID)
35
+    sendRequest(ipAddr, clientID + "-" + modelID)
35 36
 end function
36 37
 
37 38
 sub sendRequest(ipAddr as String, deviceID as String)
... ...
@@ -1,7 +1,7 @@
1 1
 title=IP Tagger
2 2
 major_version=2
3 3
 minor_version=0
4
-build_version=0
4
+build_version=1
5 5
 mm_icon_focus_hd=pkg:/images/mm_icon_focus_hd.png
6 6
 mm_icon_focus_sd=pkg:/images/mm_icon_focus_sd.png
7 7
 splash_screen_hd=pkg:/images/splash_screen_hd.png
8 8