Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
edwardaux
Level 7

Execution timeout running getLinkStatus()

I'm seeing a weird (to me) execution timeout when running some code that is launched from a timer.  My timer code looks like:


m.deviceInfo = createObject("roDeviceInfo")

m.internetCheckTimer = createObject("roSGNode", "Timer")
m.internetCheckTimer.duration = 1
m.internetCheckTimer.repeat = true
m.internetCheckTimer.observeField("fire", "checkNetworkAvailable")
m.internetCheckTimer.control = "start"


and then the routine that gets called looks like:


sub checkNetworkAvailable()
    currentlyOffline = m.deviceInfo.getLinkStatus() = false
    print(currentlyOffline)
end sub


I've had a couple of reports from testers with a stack trace reporting an Execution Timeout on the line where I'm checking getLinkStatus() - I must admit I'm somewhat puzzled as to how that might cause an execution timeout. The only thing I can think of is that (maybe) there's a rendesvouz timeout when accessing the m.deviceInfo variable? It isn't used or referenced anywhere else, though, so that seems like a long shot. 

Any thoughts would be greatly appreciated. Thanks a lot.

--
Craig
0 Kudos
6 Replies
squirreltown
Level 8

Re: Execution timeout running getLinkStatus()

currentlyOffline = m.deviceInfo.getLinkStatus() = false
 

I don't see how 2 equal signs is going to work.
Kinetics Screensavers
0 Kudos
Komag
Level 9

Re: Execution timeout running getLinkStatus()

That approach works fine, I use it all the time.
If the second part is true, the variable will be True, otherwise it will be False.
So if m.deviceInfo.getLinkStatus() = false is a true statement, then currentlyOffline will be True.
But I have no idea how getLinkStatus() works, so no help from me, sorry.
0 Kudos
squirreltown
Level 8

Re: Execution timeout running getLinkStatus()

"Komag" wrote:
That approach works fine, I use it all the time.
If the second part is true, the variable will be True, otherwise it will be False.
So if m.deviceInfo.getLinkStatus() = false is a true statement, then currentlyOffline will be True.
But I have no idea how getLinkStatus() works, so no help from me, sorry.

Interesting. So putting a statement after the first = turns it all into a boolean?
Kinetics Screensavers
0 Kudos
Komag
Level 9

Re: Execution timeout running getLinkStatus()

I find it very useful:


FUNCTION saveItemDetails(Item, y, x, rm, inv = FALSE AS BOOLEAN)
IF NOT inv THEN ItemA = [y, x, rm, Item.code] ELSE ItemA = [Item.code]

stk = Item.inven <> INVALID AND Item.inven.stack <> INVALID AND Item.inven.stack > 1
hth = Item.hth <> INVALID AND Item.hth < Item.max
cnt = Item.contents <> INVALID AND Item.contents.Count() > 0
dscr = Item.kind = "160 readable"
br = Item.bid <> INVALID
lit = br AND Item.bright > 0
torch = Item.name = "torch" AND Item.fuel < m.sy.torchLife

IF stk: ItemA.Push(0): ItemA.Push(Item.inven.stack): END IF
IF hth: ItemA.Push(1): ItemA.Push(Item.hth): END IF
IF cnt: ItemA.Push(2): ItemA.Push(saveContents(Item.contents)): END IF
IF dscr: ItemA.Push(3): ItemA.Push(Item.dscr): END IF
IF br: ItemA.Push(4): ItemA.Push(Item.bid.ToInt()): END IF
IF lit: ItemA.Push(5): ItemA.Push(Item.bright): END IF
IF torch: ItemA.Push(6): ItemA.Push(Item.fuel): END IF

IF NOT inv
  frP = Item.frPlyr <> INVALID AND Item.frPlyr
  fac = Item.facing <> INVALID
  IF frP: ItemA.Push(7): ItemA.Push(1): END IF
  IF fac: ItemA.Push(8): ItemA.Push(Item.facing): END IF
ELSE
  eqp = Item.inven.equipped <> INVALID AND Item.inven.equipped
  IF eqp: ItemA.Push(9): ItemA.Push(m.sy.eqC[Item.inven.eqSlot]): END IF
END IF

RETURN ItemA
END FUNCTION
0 Kudos
gomad
Level 7

Re: Execution timeout running getLinkStatus()

So you are getting the Execution timeouts in which all devices? Also since you mentioned logs, i am assuming the testers are testing on a dev channel right rather than a private channel?
0 Kudos
edwardaux
Level 7

Re: Execution timeout running getLinkStatus()

So you are getting the Execution timeouts in which all devices? Also since you mentioned logs, i am assuming the testers are testing on a dev channel right rather than a private channel?

Yup, all devices. And yes, this is currently via a sideloaded channel. 
In the finish, I managed to work around it by removing the periodic polling of getLinkStatus(), and instead I watch for incoming roDeviceInfoEvent events in my runloop. 
0 Kudos