func (c CommunicationStateNoItdma) GetState() uint32 {
	return c.CommunicationState
}
GetState will return the communication state
package ais
import (
	"reflect"
)
type processFunc func(packet Packet) Packet
type msgMapType struct {
	rType reflect.Type
}
var msgMap [28]msgMapType
type Packet interface {
	GetHeader() *Header
}
type Header struct {
	MessageID       uint8  `aisWidth:"6"`
	RepeatIndicator uint8  `aisWidth:"2"`
	UserID          uint32 `aisWidth:"30"`
}
func (h Header) GetHeader() *Header {
	return &h
}
type PositionReport struct {
	Header                    `aisWidth:"38"`
	Valid                     bool            `aisEncodeMaxLen:"168"`
	NavigationalStatus        uint8           `aisWidth:"4"`
	RateOfTurn                int16           `aisWidth:"8"`
	Sog                       Field10         `aisWidth:"10"`
	PositionAccuracy          bool            `aisWidth:"1"`
	Longitude                 FieldLatLonFine `aisWidth:"28"`
	Latitude                  FieldLatLonFine `aisWidth:"27"`
	Cog                       Field10         `aisWidth:"12"`
	TrueHeading               uint16          `aisWidth:"9"`
	Timestamp                 uint8           `aisWidth:"6"`
	SpecialManoeuvreIndicator uint8           `aisWidth:"2"`
	Spare                     uint8           `aisWidth:"3" aisEncodeAs:"0"`
	Raim                      bool            `aisWidth:"1"`
	CommunicationStateNoItdma `aisWidth:"19"`
}
type BaseStationReport struct {
	Header                    `aisWidth:"38"`
	Valid                     bool            `aisEncodeMaxLen:"168"`
	UtcYear                   uint16          `aisWidth:"14"`
	UtcMonth                  uint8           `aisWidth:"4"`
	UtcDay                    uint8           `aisWidth:"5"`
	UtcHour                   uint8           `aisWidth:"5"`
	UtcMinute                 uint8           `aisWidth:"6"`
	UtcSecond                 uint8           `aisWidth:"6"`
	PositionAccuracy          bool            `aisWidth:"1"`
	Longitude                 FieldLatLonFine `aisWidth:"28"`
	Latitude                  FieldLatLonFine `aisWidth:"27"`
	FixType                   uint8           `aisWidth:"4"`
	LongRangeEnable           bool            `aisWidth:"1"`
	Spare                     uint16          `aisWidth:"9" aisEncodeAs:"0"`
	Raim                      bool            `aisWidth:"1"`
	CommunicationStateNoItdma `aisWidth:"19"`
}
type ShipStaticData struct {
	Header               `aisWidth:"38"`
	Valid                bool           `aisEncodeMaxLen:"424"`
	AisVersion           uint8          `aisWidth:"2"`
	ImoNumber            uint32         `aisWidth:"30"`
	CallSign             string         `aisWidth:"42"`
	Name                 string         `aisWidth:"120"`
	Type                 uint8          `aisWidth:"8"`
	Dimension            FieldDimension `aisWidth:"30"`
	FixType              uint8          `aisWidth:"4"`
	Eta                  FieldETA       `aisWidth:"20"`
	MaximumStaticDraught Field10        `aisWidth:"8"`
	Destination          string         `aisWidth:"120"`
	Dte                  bool           `aisWidth:"1"`
	Spare                bool           `aisWidth:"1" aisEncodeAs:"0"`
}
type AddressedBinaryMessage struct {
	Header         `aisWidth:"38"`
	Valid          bool                       `aisEncodeMaxLen:"1008"`
	SequenceNumber uint8                      `aisWidth:"2"`
	DestinationID  uint32                     `aisWidth:"30"`
	Retransmission bool                       `aisWidth:"1"`
	Spare          bool                       `aisWidth:"1" aisEncodeAs:"0"`
	ApplicationID  FieldApplicationIdentifier `aisWidth:"16"`
	BinaryData     []byte                     `aisWidth:"-1"`
}
type BinaryBroadcastMessage struct {
	Header        `aisWidth:"38"`
	Valid         bool                       `aisEncodeMaxLen:"1008"`
	Spare         uint8                      `aisWidth:"2" aisEncodeAs:"0"`
	ApplicationID FieldApplicationIdentifier `aisWidth:"16"`
	BinaryData    []byte                     `aisWidth:"-1"`
}
type StandardSearchAndRescueAircraftReport struct {
	Header                  `aisWidth:"38"`
	Valid                   bool            `aisEncodeMaxLen:"168"`
	Altitude                uint16          `aisWidth:"12"`
	Sog                     uint16          `aisWidth:"10"`
	PositionAccuracy        bool            `aisWidth:"1"`
	Longitude               FieldLatLonFine `aisWidth:"28"`
	Latitude                FieldLatLonFine `aisWidth:"27"`
	Cog                     Field10         `aisWidth:"12"`
	Timestamp               uint8           `aisWidth:"6"`
	AltFromBaro             bool            `aisWidth:"1"`
	Spare1                  uint8           `aisWidth:"7" aisEncodeAs:"0"`
	Dte                     bool            `aisWidth:"1"`
	Spare2                  uint8           `aisWidth:"3" aisEncodeAs:"0"`
	AssignedMode            bool            `aisWidth:"1"`
	Raim                    bool            `aisWidth:"1"`
	CommunicationStateItdma `aisWidth:"20"`
}
type CoordinatedUTCInquiry struct {
	Header        `aisWidth:"38"`
	Valid         bool   `aisEncodeMaxLen:"72"`
	Spare1        uint8  `aisWidth:"2" aisEncodeAs:"0"`
	DestinationID uint32 `aisWidth:"30"`
	Spare2        uint8  `aisWidth:"2" aisEncodeAs:"0"`
}
type AddessedSafetyMessage struct {
	Header         `aisWidth:"38"`
	Valid          bool   `aisEncodeMaxLen:"1008"`
	SequenceNumber uint8  `aisWidth:"2"`
	DestinationID  uint32 `aisWidth:"30"`
	Retransmission bool   `aisWidth:"1"`
	Spare          bool   `aisWidth:"1" aisEncodeAs:"0"`
	Text           string `aisWidth:"-1"`
}
type SafetyBroadcastMessage struct {
	Header `aisWidth:"38"`
	Valid  bool   `aisEncodeMaxLen:"1008"`
	Spare  uint8  `aisWidth:"2" aisEncodeAs:"0"`
	Text   string `aisWidth:"-1"`
}
type GnssBroadcastBinaryMessage struct {
	Header    `aisWidth:"38"`
	Valid     bool              `aisEncodeMaxLen:"816"`
	Spare1    uint8             `aisWidth:"2" aisEncodeAs:"0"`
	Longitude FieldLatLonCoarse `aisWidth:"18"`
	Latitude  FieldLatLonCoarse `aisWidth:"17"`
	Spare2    uint8             `aisWidth:"5" aisEncodeAs:"0"`
	Data      []byte            `aisWidth:"-1"`
}
type StandardClassBPositionReport struct {
	Header                  `aisWidth:"38"`
	Valid                   bool            `aisEncodeMaxLen:"168"`
	Spare1                  uint8           `aisWidth:"8" aisEncodeAs:"0"`
	Sog                     Field10         `aisWidth:"10"`
	PositionAccuracy        bool            `aisWidth:"1"`
	Longitude               FieldLatLonFine `aisWidth:"28"`
	Latitude                FieldLatLonFine `aisWidth:"27"`
	Cog                     Field10         `aisWidth:"12"`
	TrueHeading             uint16          `aisWidth:"9"`
	Timestamp               uint8           `aisWidth:"6"`
	Spare2                  uint8           `aisWidth:"2" aisEncodeAs:"0"`
	ClassBUnit              bool            `aisWidth:"1"`
	ClassBDisplay           bool            `aisWidth:"1"`
	ClassBDsc               bool            `aisWidth:"1"`
	ClassBBand              bool            `aisWidth:"1"`
	ClassBMsg22             bool            `aisWidth:"1"`
	AssignedMode            bool            `aisWidth:"1"`
	Raim                    bool            `aisWidth:"1"`
	CommunicationStateItdma `aisWidth:"20"`
}
type ExtendedClassBPositionReport struct {
	Header           `aisWidth:"38"`
	Valid            bool            `aisEncodeMaxLen:"312"`
	Spare1           uint8           `aisWidth:"8" aisEncodeAs:"0"`
	Sog              Field10         `aisWidth:"10"`
	PositionAccuracy bool            `aisWidth:"1"`
	Longitude        FieldLatLonFine `aisWidth:"28"`
	Latitude         FieldLatLonFine `aisWidth:"27"`
	Cog              Field10         `aisWidth:"12"`
	TrueHeading      uint16          `aisWidth:"9"`
	Timestamp        uint8           `aisWidth:"6"`
	Spare2           uint8           `aisWidth:"4" aisEncodeAs:"0"`
	Name             string          `aisWidth:"120"`
	Type             uint8           `aisWidth:"8"`
	Dimension        FieldDimension  `aisWidth:"30"`
	FixType          uint8           `aisWidth:"4"`
	Raim             bool            `aisWidth:"1"`
	Dte              bool            `aisWidth:"1"`
	AssignedMode     bool            `aisWidth:"1"`
	Spare3           uint8           `aisWidth:"4" aisEncodeAs:"0"`
}
type AidsToNavigationReport struct {
	Header           `aisWidth:"38"`
	Valid            bool            `aisEncodeMaxLen:"356"`
	Type             uint8           `aisWidth:"5"`
	Name             string          `aisWidth:"120"`
	PositionAccuracy bool            `aisWidth:"1"`
	Longitude        FieldLatLonFine `aisWidth:"28"`
	Latitude         FieldLatLonFine `aisWidth:"27"`
	Dimension        FieldDimension  `aisWidth:"30"`
	Fixtype          uint8           `aisWidth:"4"`
	Timestamp        uint8           `aisWidth:"6"`
	OffPosition      bool            `aisWidth:"1"`
	AtoN             uint8           `aisWidth:"8"`
	Raim             bool            `aisWidth:"1"`
	VirtualAtoN      bool            `aisWidth:"1"`
	AssignedMode     bool            `aisWidth:"1"`
	Spare            bool            `aisWidth:"1" aisEncodeAs:"0"`
	NameExtension    string          `aisWidth:"-1"`
}
type GroupAssignmentCommand struct {
	Header            `aisWidth:"38"`
	Valid             bool              `aisEncodeMaxLen:"160"`
	Spare1            uint8             `aisWidth:"2" aisEncodeAs:"0"`
	Longitude1        FieldLatLonCoarse `aisWidth:"18"`
	Latitude1         FieldLatLonCoarse `aisWidth:"17"`
	Longitude2        FieldLatLonCoarse `aisWidth:"18"`
	Latitude2         FieldLatLonCoarse `aisWidth:"17"`
	StationType       uint8             `aisWidth:"4"`
	ShipType          uint8             `aisWidth:"8"`
	Spare2            uint32            `aisWidth:"22" aisEncodeAs:"0"`
	TxRxMode          uint8             `aisWidth:"2"`
	ReportingInterval uint8             `aisWidth:"4"`
	QuietTime         uint8             `aisWidth:"4"`
	Spare3            uint8             `aisWidth:"6" aisEncodeAs:"0"`
}
type StaticDataReportA struct {
	Valid bool
	Name  string `aisWidth:"120"`
}
type StaticDataReportB struct {
	Valid          bool
	ShipType       uint8          `aisWidth:"8"`
	VendorIDName   string         `aisWidth:"18"`
	VenderIDModel  uint8          `aisWidth:"4"`
	VenderIDSerial uint32         `aisWidth:"20"`
	CallSign       string         `aisWidth:"42"`
	Dimension      FieldDimension `aisWidth:"30"`
	FixType        uint8          `aisWidth:"4"`
	Spare          uint8          `aisWidth:"2" aisEncodeAs:"0"`
}
type StaticDataReport struct {
	Header     `aisWidth:"38"`
	Valid      bool              `aisEncodeMaxLen:"168"`
	Reserved   uint8             `aisWidth:"1" aisEncodeAs:"0" aisCheckValue:"0"`
	PartNumber bool              `aisWidth:"1"`
	ReportA    StaticDataReportA `aisWidth:"120" aisDependsBit:"~39" aisDependsField:"~PartNumber"`
	ReportB    StaticDataReportB `aisWidth:"120" aisDependsBit:"39" aisDependsField:"PartNumber"`
}
type LongRangeAisBroadcastMessage struct {
	Header             `aisWidth:"38"`
	Valid              bool              `aisEncodeMaxLen:"96"`
	PositionAccuracy   bool              `aisWidth:"1"`
	Raim               bool              `aisWidth:"1"`
	NavigationalStatus uint8             `aisWidth:"4"`
	Longitude          FieldLatLonCoarse `aisWidth:"18"`
	Latitude           FieldLatLonCoarse `aisWidth:"17"`
	Sog                uint8             `aisWidth:"6"`
	Cog                uint16            `aisWidth:"9"`
	PositionLatency    bool              `aisWidth:"1"`
	Spare              bool              `aisWidth:"1" aisEncodeAs:"0"`
}
type BinaryAcknowledgeData struct {
	Valid          bool
	DestinationID  uint32 `aisWidth:"30"`
	SequenceNumber uint8  `aisWidth:"2"`
}
type BinaryAcknowledge struct {
	Header       `aisWidth:"38"`
	Valid        bool                     `aisEncodeMaxLen:"168"`
	Spare        uint8                    `aisWidth:"2" aisEncodeAs:"0"`
	Destinations [4]BinaryAcknowledgeData `aisWidth:"0"`
}
type InterrogationStation1Message1 struct {
	Valid      bool
	StationID  uint32 `aisWidth:"30"`
	MessageID  uint8  `aisWidth:"6"`
	SlotOffset uint16 `aisWidth:"12"`
}
type InterrogationStation1Message2 struct {
	Valid      bool   `aisOptional:"1"`
	Spare      uint8  `aisWidth:"2" aisEncodeAs:"0"`
	MessageID  uint8  `aisWidth:"6"`
	SlotOffset uint16 `aisWidth:"12"`
}
type InterrogationStation2 struct {
	Valid      bool   `aisOptional:"1"`
	Spare1     uint8  `aisWidth:"2" aisEncodeAs:"0"`
	StationID  uint32 `aisWidth:"30"`
	MessageID  uint8  `aisWidth:"6"`
	SlotOffset uint16 `aisWidth:"12"`
	Spare2     uint8  `aisWidth:"2" aisEncodeAs:"0"`
}
type Interrogation struct {
	Header       `aisWidth:"38"`
	Valid        bool                          `aisEncodeMaxLen:"160"`
	Spare        uint8                         `aisWidth:"2" aisEncodeAs:"0"`
	Station1Msg1 InterrogationStation1Message1 `aisWidth:"48"`
	Station1Msg2 InterrogationStation1Message2 `aisWidth:"0"`
	Station2     InterrogationStation2         `aisWidth:"0"`
}
type AssignedModeCommandData struct {
	Valid         bool
	DestinationID uint32 `aisWidth:"30"`
	Offset        uint16 `aisWidth:"12"`
	Increment     uint16 `aisWidth:"10"`
}
type AssignedModeCommand struct {
	Header   `aisWidth:"38"`
	Valid    bool                       `aisEncodeMaxLen:"144"`
	Spare    uint8                      `aisWidth:"2" aisEncodeAs:"0"`
	Commands [2]AssignedModeCommandData `aisWidth:"0"`
}
type DataLinkManagementMessageData struct {
	Valid         bool
	Offset        uint16 `aisWidth:"12"`
	NumberOfSlots uint8  `aisWidth:"4"`
	TimeOut       uint8  `aisWidth:"3"`
	Increment     uint16 `aisWidth:"11"`
}
type DataLinkManagementMessage struct {
	Header `aisWidth:"38"`
	Valid  bool                             `aisEncodeMaxLen:"160"`
	Spare  uint8                            `aisWidth:"2" aisEncodeAs:"0"`
	Data   [4]DataLinkManagementMessageData `aisWidth:"0"`
}
type ChannelManagementBroadcastData struct {
	Longitude1 FieldLatLonCoarse `aisWidth:"18"`
	Latitude1  FieldLatLonCoarse `aisWidth:"17"`
	Longitude2 FieldLatLonCoarse `aisWidth:"18"`
	Latitude2  FieldLatLonCoarse `aisWidth:"17"`
}
type ChannelManagementUnicastData struct {
	AddressStation1 uint32 `aisWidth:"30"`
	Spare2          uint8  `aisWidth:"5" aisEncodeAs:"0"`
	AddressStation2 uint32 `aisWidth:"30"`
	Spare3          uint8  `aisWidth:"5" aisEncodeAs:"0"`
}
type ChannelManagement struct {
	Header               `aisWidth:"38"`
	Valid                bool                           `aisEncodeMaxLen:"168"`
	Spare1               uint8                          `aisWidth:"2" aisEncodeAs:"0"`
	ChannelA             uint16                         `aisWidth:"12"`
	ChannelB             uint16                         `aisWidth:"12"`
	TxRxMode             uint8                          `aisWidth:"4"`
	LowPower             bool                           `aisWidth:"1"`
	Area                 ChannelManagementBroadcastData `aisWidth:"70" aisDependsBit:"~139" aisDependsField:"~IsAddressed"`
	Unicast              ChannelManagementUnicastData   `aisWidth:"70" aisDependsBit:"139" aisDependsField:"IsAddressed"`
	IsAddressed          bool                           `aisWidth:"1"`
	BwA                  bool                           `aisWidth:"1"`
	BwB                  bool                           `aisWidth:"1"`
	TransitionalZoneSize uint8                          `aisWidth:"3"`
	Spare4               uint32                         `aisWidth:"23" aisEncodeAs:"0"`
}
type SingleSlotBinaryMessage struct {
	Header             `aisWidth:"38"`
	Valid              bool                       `aisEncodeMaxLen:"168"`
	DestinationIDValid bool                       `aisWidth:"1"`
	ApplicationIDValid bool                       `aisWidth:"1"`
	DestinationID      uint32                     `aisWidth:"30" aisDependsBit:"38" aisDependsField:"DestinationIDValid"`
	Spare              uint8                      `aisWidth:"2" aisDependsBit:"38" aisDependsField:"DestinationIDValid" aisEncodeAs:"0"`
	ApplicationID      FieldApplicationIdentifier `aisWidth:"16" aisDependsBit:"39" aisDependsField:"ApplicationIDValid"`
	Payload            []byte                     `aisWidth:"-1"`
}
type MultiSlotBinaryMessage struct {
	Header                  `aisWidth:"38"`
	Valid                   bool                       `aisEncodeMaxLen:"1064"`
	DestinationIDValid      bool                       `aisWidth:"1"`
	ApplicationIDValid      bool                       `aisWidth:"1"`
	DestinationID           uint32                     `aisWidth:"30" aisDependsBit:"38" aisDependsField:"DestinationIDValid"`
	Spare1                  uint8                      `aisWidth:"2" aisDependsBit:"38" aisDependsField:"DestinationIDValid" aisEncodeAs:"0"`
	ApplicationID           FieldApplicationIdentifier `aisWidth:"16" aisDependsBit:"39" aisDependsField:"ApplicationIDValid"`
	Payload                 []byte                     `aisWidth:"-1"`
	Spare2                  uint8                      `aisWidth:"4" aisEncodeAs:"0"`
	CommunicationStateItdma `aisWidth:"20"`
}
type FieldETA struct {
	Month  uint8 `aisWidth:"4"`
	Day    uint8 `aisWidth:"5"`
	Hour   uint8 `aisWidth:"5"`
	Minute uint8 `aisWidth:"6"`
}
type FieldDimension struct {
	A uint16 `aisWidth:"9"`
	B uint16 `aisWidth:"9"`
	C uint8  `aisWidth:"6"`
	D uint8  `aisWidth:"6"`
}
type FieldApplicationIdentifier struct {
	Valid              bool
	DesignatedAreaCode uint16 `aisWidth:"10"`
	FunctionIdentifier uint8  `aisWidth:"6"`
}
type HasCommunicationState interface {
	IsItdma() int
	GetState() uint32
}
type CommunicationStateItdma struct {
	CommunicationStateIsItdma bool   `aisWidth:"1"`
	CommunicationState        uint32 `aisWidth:"19"`
}
func (c CommunicationStateItdma) IsItdma() int {
	if c.CommunicationStateIsItdma {
		return 1
	}
	return 0
}
func (c CommunicationStateItdma) GetState() uint32 {
	return c.CommunicationState
}
type CommunicationStateNoItdma struct {
	CommunicationState uint32 `aisWidth:"19"`
}
func (c CommunicationStateNoItdma) IsItdma() int {
	return -1
}