The socket outputs the messages on port 30003 in a CSV forma

Post Reply
Albert
Posts: 3017
Joined: Mon Sep 08, 2008 8:57 am

The socket outputs the messages on port 30003 in a CSV forma

Post by Albert »

The socket outputs the messages on port 30003 in a CSV format, with a carriage return and lifefeed (ascii 13 followed by ascii 10) at the end of each message.

Not all lines will have the same number of fields, and not all fields will have the same meaning. Basically, the first field has the message type, and then from that you can know how many other fields there will be and what they will contain. At the moment, the first few fields are common for all messages, but that should not be taken as a hard and fast rule.

The best thing is to ignore any message types that aren't ones you handle, so that if new messages are added you'll just ignore them.

Note that the log files logged by the logger are identical from the socket output with one difference: I add a number column at the front so that if you sort it, you can sort it back into the original order.

Four types of messages are currently outputted. They are:

SELECTION CHANGE MESSAGE

This is broadcast when the user changes the selection, although because of the way the grid works, it is possible that this might also fire when new aircraft are added (with the values staying the same).

Fields are:

Field 1: SEL
Field 2: [null]
Field 3: SessionID
Field 4: AircraftID
Field 5: HexIdent
Field 6: FlightID
Field 7: Date message generated
Field 8: Time message generated
Field 9: Date message logged
Field 10: Time message logged
Field 11: Callsign

Because this is a real-time message, fields 7 and 9 and 8 and 10 will have the same value.

Flight ID is the database ID of the record for the flight that the aircraft is currently making.

NEW AIRCRAFT MESSAGE

This message is broadcast when the SBS-1 picks up a signal for an aircraft that it isn't currently tracking.

i.e. It's when a new aircraft appears on the right-hand aircraft list.

It doesn't mean new aircraft in the sense of an aircraft that wasn't previously in the database.

Fields are:

Field 1: AIR
Field 2: [null]
Field 3: SessionID
Field 4: AircraftID
Field 5: HexIdent
Field 6: FlightID
Field 7: Date message generated
Field 8: Time message generated
Field 9: Date message logged
Field 10: Time message logged

Because this is a real-time message, fields 7 and 9 and 8 and 10 will again have the same value.

NEW ID MESSAGE

This is broadcast when an aircraft changes, or sets, its callsign. (So you would usually get it very soon after first picking up the aircraft).

Fields are:

Field 1: ID
Field 2: [null]
Field 3: SessionID
Field 4: AircraftID
Field 5: HexIdent
Field 6: FlightID
Field 7: Date message generated
Field 8: Time message generated
Field 9: Date message logged
Field 10: Time message logged
Field 11: Callsign

Again, because this is a real-time message, fields 7 and 9 and 8 and 10 will have the same value.

TRANSMISSION MESSAGE

This is basically a delayed (5 minutes) outputting of every message received from the aircraft.

Fields are:

Field 1: MSG
Field 2: Transmission Type
Field 3: AircraftID
Field 4: HexIdent
Field 5: FlightID
Field 6: Time message generated
Field 7: Time message logged
Field 8: Callsign
Field 9: Altitude
Field 10: GroundSpeed
Field 11: Track
Field 12: Lat
Field 13: Long
Field 14: VerticalRate
Field 15: Squawk
Field 16: Alert
Field 17: Emergency
Field 18: SPI
Field 19: IsOnGround

However, it gets a bit more complicated, as you will see if you look in the log files, because not all messages set all fields. Basically, you have to look at field 2, the TransmissionType. This can have the following values:

1 = IDMessage
2 = SurfacePositionMessage
3 = AirbornePositionMessage
4 = AirborneVelocityMessage
5 = SurveillanceAltMessage
6 = SurveillanceIDMessage
7 = AirToAirMessage
8 = AllCallReply

These messages have values in the following fields:

IDMessage: Callsign
SurfacePositionMessage: Altitude, GroundSpeed, Track, Lat, Long
AirbornePositionMessage: Altitude, Lat, Long, Alert, Emergency, SPI
AirborneVelocityMessage: GroundSpeed, Track, VerticalRate
SurveillanceAltMessage: Altitude, Alert, SPI
SurveillanceIDMessage: Altitude, Squawk, Alert, Emergency, SPI
AirToAirMessage: Altitude
AllCallReply: None at the moment (need to do a further check).
Post Reply