mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-11-07 22:18:29 +01:00
update Antunnel and its dependencies
This commit is contained in:
parent
2f7a677463
commit
3808a4ed10
File diff suppressed because one or more lines are too long
@ -9,7 +9,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@lxsang.me"
|
||||
},
|
||||
"version":"0.1.6-a",
|
||||
"version":"0.1.7-a",
|
||||
"category":"Library",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"],
|
||||
|
Binary file not shown.
@ -12,7 +12,7 @@ class Msg
|
||||
|
||||
|
||||
as_raw:() ->
|
||||
length = 11 + @header.size
|
||||
length = 13 + @header.size
|
||||
arr = new Uint8Array(length)
|
||||
arr.set(Msg.MAGIC_START, 0)
|
||||
arr[2] = @header.type
|
||||
@ -20,11 +20,11 @@ class Msg
|
||||
arr.set(bytes,3)
|
||||
bytes = Msg.bytes_of @header.sid
|
||||
arr.set(bytes,5)
|
||||
bytes = Msg.bytes_of @header.size
|
||||
bytes = Msg.bytes_of @header.size, 4
|
||||
arr.set(bytes,7)
|
||||
if @data
|
||||
arr.set(@data, 9)
|
||||
arr.set(Msg.MAGIC_END, @header.size + 9)
|
||||
arr.set(@data, 11)
|
||||
arr.set(Msg.MAGIC_END, @header.size + 11)
|
||||
arr.buffer
|
||||
|
||||
Msg.decode = (raw) ->
|
||||
@ -35,22 +35,29 @@ Msg.decode = (raw) ->
|
||||
msg.header.type = raw[2]
|
||||
msg.header.cid = Msg.int_from(raw, 3)
|
||||
msg.header.sid = Msg.int_from(raw,5)
|
||||
msg.header.size = Msg.int_from(raw, 7)
|
||||
msg.data = raw.slice(9, 9+msg.header.size)
|
||||
if(Msg.int_from(Msg.MAGIC_END, 0) != Msg.int_from(raw, 9+msg.header.size))
|
||||
msg.header.size = Msg.int_from(raw, 7,4)
|
||||
msg.data = raw.slice(11, 11+msg.header.size)
|
||||
if(Msg.int_from(Msg.MAGIC_END, 0) != Msg.int_from(raw, 11+msg.header.size))
|
||||
return reject("Unmatch message end magic number")
|
||||
resolve msg
|
||||
|
||||
|
||||
Msg.bytes_of = (x) ->
|
||||
bytes=new Uint8Array(2)
|
||||
Msg.bytes_of = (x,s) ->
|
||||
s = 2 unless s is 4
|
||||
bytes=new Uint8Array(s)
|
||||
bytes[0]=x & (255)
|
||||
x=x>>8
|
||||
bytes[1]=x & (255)
|
||||
bytes
|
||||
return bytes unless s is 4
|
||||
x=x>>8
|
||||
bytes[2]=x & (255)
|
||||
x=x>>8
|
||||
bytes[3]=x & (255)
|
||||
return bytes
|
||||
|
||||
Msg.int_from = (bytes, offset) ->
|
||||
(bytes[offset] | (bytes[offset+1]<<8))
|
||||
Msg.int_from = (bytes, offset, size) ->
|
||||
return (bytes[offset] | (bytes[offset+1]<<8)) unless size is 4
|
||||
return (bytes[offset] | (bytes[offset+1]<<8) | (bytes[offset+2]<<16) | (bytes[offset+3] << 24))
|
||||
|
||||
Msg.OK = 0
|
||||
Msg.ERROR = 1
|
||||
|
@ -9,7 +9,7 @@
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@lxsang.me"
|
||||
},
|
||||
"version":"0.1.6-a",
|
||||
"version":"0.1.7-a",
|
||||
"category":"Library",
|
||||
"iconclass":"fa fa-adn",
|
||||
"mimes":["none"],
|
||||
|
@ -35,7 +35,7 @@
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Antunnel/README.md",
|
||||
"category": "Library",
|
||||
"author": "Xuan Sang LE",
|
||||
"version": "0.1.6-a",
|
||||
"version": "0.1.7-a",
|
||||
"dependencies": [],
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Antunnel/build/release/Antunnel.zip"
|
||||
},
|
||||
@ -236,7 +236,7 @@
|
||||
"category": "System",
|
||||
"author": "Xuan Sang LE",
|
||||
"version": "0.1.9-a",
|
||||
"dependencies": ["Antunnel@0.1.6-a","xTerm@4.8.1-r"],
|
||||
"dependencies": ["Antunnel@0.1.7-a","xTerm@4.8.1-r"],
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/vTerm/build/release/vTerm.zip"
|
||||
},
|
||||
{
|
||||
|
@ -11,7 +11,7 @@
|
||||
"iconclass":"fa fa-terminal",
|
||||
"mimes":["none"],
|
||||
"dependencies": [
|
||||
"Antunnel@0.1.6-a",
|
||||
"Antunnel@0.1.7-a",
|
||||
"xTerm@4.8.1-r"
|
||||
],
|
||||
"locales":{
|
||||
|
Binary file not shown.
@ -11,7 +11,7 @@
|
||||
"iconclass":"fa fa-terminal",
|
||||
"mimes":["none"],
|
||||
"dependencies": [
|
||||
"Antunnel@0.1.6-a",
|
||||
"Antunnel@0.1.7-a",
|
||||
"xTerm@4.8.1-r"
|
||||
],
|
||||
"locales":{
|
||||
|
Loading…
Reference in New Issue
Block a user