-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1 Moved DeviceIdentification1 to own file
- Loading branch information
Showing
3 changed files
with
29 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import enum | ||
|
||
from common.helper import TwoWayDict | ||
from seatalk.seatalk_datagram import _TwoWayDictDatagram | ||
|
||
|
||
class DeviceIdentification1(_TwoWayDictDatagram): | ||
""" | ||
90 00 XX Device Identification | ||
XX=02 sent by ST600R ~every 2 secs | ||
XX=05 sent by type 150, 150G and 400G course computer | ||
XX=A3 sent by NMEA <-> SeaTalk bridge ~every 10 secs | ||
""" | ||
seatalk_id = 0x90 | ||
data_length = 0 | ||
|
||
class DeviceID(enum.IntEnum): | ||
ST600R = enum.auto() | ||
Type_150_150G_400G = enum.auto() | ||
NMEASeatalkBridge = enum.auto() | ||
|
||
def __init__(self, device_id: DeviceID=None): | ||
device_id_map = TwoWayDict({ | ||
bytes([0x02]): self.DeviceID.ST600R, | ||
bytes([0x05]): self.DeviceID.Type_150_150G_400G, | ||
bytes([0xA3]): self.DeviceID.NMEASeatalkBridge | ||
}) | ||
_TwoWayDictDatagram.__init__(self, map=device_id_map, set_key=device_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters