Problem with new SDK.
This was working in 2.4, now with 2.6 it crashes the Roku.
Function Byte_2_String( in as object, idx as integer, sz as integer) as string
str = CreateObject( "roString" )
if sz = 0 return str
for i=0 to sz-1
if in[idx+i] = 0 exit for
c = Chr( in[idx+i] )
str = str + c
end for
return str
End Function
* Modified routine so it would work.
Function Byte_2_String( in as object, idx as integer, sz as integer) as string
str = ""
if sz = 0 return str
for i=0 to sz-1
if in[idx+i] = 0
exit for
end if
j = in[idx+i]
str = str+Chr(j)
end for
return str
End Function
*
The reason I didn't notice it, is because something else changed.
The status from GetToFile() used to return the http status now it returns a 1 for completed.
I was never getting to the code that crashes the Roku.
sock = Socket( url )
hdr = 128 + 228
beg = size - hdr
sock.AddHeader( "Range", "bytes="+beg.tostr()+"-"+size.tostr() )
st = sock.GetToFile( "tmp:/ID3-tail" )
? "get = " st
if st <> 206 and st <> 1 return