Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F70906634
MOB.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jul 8, 05:05
Size
631 B
Mime Type
text/x-python
Expires
Wed, Jul 10, 05:05 (2 d)
Engine
blob
Format
Raw Data
Handle
18884953
Attached To
R890 mux0183
MOB.py
View Options
#!/usr/bin/env python3
import
time
,
math
,
sys
,
socket
sys
.
path
.
append
(
'../lib'
)
from
aisMsg
import
*
# Connect to multiplexer
client
=
socket
.
socket
()
host
=
socket
.
gethostname
()
client
.
connect
((
'0.0.0.0'
,
39150
))
obj
=
AISmsg1
()
obj
.
mmsi
=
972010001
obj
.
navStatus
=
AISmsg1
.
SART_ACTIVE
obj
.
accuracy
=
1
obj
.
lat
=
43.02
obj
.
lon
=
6.1
obj
.
cog
=
0
obj
.
hdg
=
AISmsg1
.
HDG_NOT_AVAILABLE
obj
.
timeStamp
=
40
obj
.
specialManoeuvre
=
AISmsg1
.
SPECIAL_MANOEUVRE_NOT_AVAIL
obj
.
RAIM
=
1
obj
.
state
=
0
multi
=
obj
.
Encode
()
while
True
:
for
aivdm
in
multi
:
sys
.
stdout
.
write
(
aivdm
)
client
.
send
(
bytes
(
aivdm
,
'ASCII'
))
time
.
sleep
(
15
)
Event Timeline
Log In to Comment