Main Page
Namespaces
Namespace List
Namespace Members
All
c
d
e
f
g
l
m
p
r
s
Functions
Variables
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
h
i
j
l
m
n
o
p
r
s
t
u
~
Functions
_
a
b
c
d
e
i
j
m
o
p
r
s
t
u
~
Variables
_
b
c
d
e
f
h
i
j
l
m
n
p
r
s
t
Files
File List
File Members
All
b
c
d
e
g
i
j
l
m
p
r
s
t
v
w
Functions
c
d
g
i
j
l
m
p
r
s
t
w
Typedefs
examples
skyway_for_ros_examples
scripts
utils
data.py
Go to the documentation of this file.
1
import
json
2
3
4
def
create_connect_request
(
5
peer_id,
6
token,
7
target_id,
8
plugin_info,
9
metadata,
10
data_id,
11
redirect_ip,
12
redirect_port,
13
):
14
message = json.loads(
15
"{"
16
' "request_type":"DATA",'
17
' "command":"CONNECT",'
18
' "params": {'
19
f
' "peer_id": "{peer_id}", '
20
f
' "token": "{token}", '
21
f
' "target_id": "{target_id}", '
22
f
' "plugin_info": {json.dumps(plugin_info)}, '
23
' "options": {'
24
' "serialization": "NONE", '
25
' "dcInit": {'
26
' "ordered": false, '
# パケットの順番をソートさせない場合
27
' "maxRetransmits": 0 '
# リアルタイム通信を阻害しないよう再送させない場合
28
" }"
29
" },"
30
' "params": { '
31
f
' "data_id": "{data_id}" '
32
" }, "
33
' "redirect_params": { '
34
f
' "ip_v4": "{redirect_ip}", '
35
f
' "port": {redirect_port}'
36
" }"
37
" }"
38
"}"
39
)
40
41
message[
"params"
][
"options"
][
"metadata"
] = json.dumps(metadata)
42
return
json.dumps(message)
43
44
45
def
redirect_request
(data_connection_id, plugin_info):
46
return
(
47
"{"
48
' "request_type":"DATA",'
49
' "command":"REDIRECT",'
50
' "params":{'
51
f
' "data_connection_id":"{data_connection_id}",'
52
f
' "plugin_info":{json.dumps(plugin_info)}'
53
" }"
54
"}"
55
)
56
57
58
def
create_data_status_request
(data_connection_id):
59
return
(
60
"{"
61
' "request_type":"DATA",'
62
' "command":"STATUS",'
63
' "params":{'
64
f
' "data_connection_id":"{data_connection_id}"'
65
" }"
66
"}"
67
)
utils.data.create_connect_request
def create_connect_request(peer_id, token, target_id, plugin_info, metadata, data_id, redirect_ip, redirect_port)
Definition:
data.py:4
utils.data.redirect_request
def redirect_request(data_connection_id, plugin_info)
Definition:
data.py:45
utils.data.create_data_status_request
def create_data_status_request(data_connection_id)
Definition:
data.py:58
skyway
Author(s): Toshiya Nakakura
autogenerated on Thu Oct 26 2023 02:42:21