Kerbal Simpit Compound Messages

Structs for compound message types.

Functions

template<typename MsgType>
MsgType parseMessage(byte msg[])

Parse a message of type MsgType.

Use it as ‘altitudeMessage myMsg = parseMessage<altitudeMessage>(msg);’

Parameters:

msg – The byte array of the message body.

Returns:

MsgType A formatted MsgType struct.

cagStatusMessage parseCAGStatusMessage(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing status of all the CAG.

Parameters:

msg – The byte array of the message body.

Returns:

cagStatusMessage A formatted cagStatusMessage struct.

SASInfoMessage parseSASInfoMessage(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing status of the SAS.

Parameters:

msg – The byte array of the message body.

Returns:

SASInfoMessage A formatted SASInfoMessage struct.

altitudeMessage parseAltitude(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing Altitude data.

Parameters:

msg – The byte array of the message body.

Returns:

altitudeMessage A formatted altitudeMessage struct.

apsidesMessage parseApsides(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing Apsides data.

Returns:

apsidesMessage A formatted apsidesMessage struct.

orbitInfoMessage parseOrbitInfo(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing orbital information.

Returns:

orbitInfoMessage A formatted orbitInfoMessage struct.

apsidesTimeMessage parseApsidesTime(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing Apsides Time data.

Returns:

apsidesTimeMessage A formatted apsidesTimeMessage struct.

resourceMessage parseResource(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message countaining Resource data.

Returns:

resourceMessage A formatted resourceMessage struct.

TACLSResourceMessage parseTACLSResource(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message countaining TACLSResourceMessage data.

Returns:

TACLSResourceMessage A formatted TACLSResourceMessage struct.

TACLSWasteMessage parseTACLSWaste(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message countaining TACLSWasteMessage data.

Returns:

TACLSWasteMessage A formatted TACLSWasteMessage struct.

CustomResourceMessage parseCustomResource(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message countaining CustomResourceMessage data.

Returns:

CustomResourceMessage A formatted CustomResourceMessage struct.

velocityMessage parseVelocity(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing Velocity data.

Returns:

velocityMessage A formatted velocityMessage struct.

vesselPointingMessage parseRotation(byte msg[])

Parse a message containing Rotation data.

Returns:

vesselPointingMessage a formatted vesselPointingMessage struct.

targetMessage parseTarget(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing Target data.

Returns:

targetMessage A formatted targetMessage struct.

airspeedMessage parseAirspeed(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing Airspeed data.

Returns:

airspeedMessage a formatted airspeedMessage struct.

maneuverMessage parseManeuver(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing Maneuver data.

Returns:

maneuverMessage a formatted maneuverMessage struct.

deltaVMessage parseDeltaV(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing DeltaV data.

Returns:

deltaVMessage a formatted deltaVMessage struct.

deltaVEnvMessage parseDeltaVEnv(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing DeltaVEnv data.

Returns:

deltaVEnvMessage a formatted deltaVEnvMessage struct.

burnTimeMessage parseBurnTime(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing BurnTime data.

Returns:

burnTimeMessage a formatted burnTimeMessage struct.

tempLimitMessage parseTempLimitMessage(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing tempLimitMessage data.

Returns:

tempLimitMessage a formatted tempLimitMessage struct.

flightStatusMessage parseFlightStatusMessage(byte msg[])

DEPRECATED.

Use parseMessage instead. Parse a message containing flightStatusMessage data.

Returns:

flightStatusMessage a formatted flightStatusMessage struct.

struct cagStatusMessage
#include <PayloadStructs.h>

An Custom Action Group message.

Public Functions

inline bool is_action_activated(byte i)

Public Members

byte status[32]

List of all the action status organised by bytes.

Read them with the is_action_activated method.

struct SASInfoMessage
#include <PayloadStructs.h>

An SAS info message to reprsent the current SAS state.

Public Members

byte currentSASMode

Current SAS mode.

SAS modes are listed in the AutopilotMode enum. 255 is used to indicate a disabled SAS.

int16_t SASModeAvailability

bitmask for the availability of each SAS mode.

If a mode is not available, a SAS_MODE_MESSAGE setting this mode will be ignored. The corresponing bitmask can be obtained with 1 << AP_RADIALIN for the radial in direction for instance, taking values from the AutopilotMode enum.

struct altitudeMessage
#include <PayloadStructs.h>

An Altitude message.

Public Members

float sealevel

Altitude above sea level.

float surface

Surface altitude at current position.

struct apsidesMessage
#include <PayloadStructs.h>

An Apsides message.

Public Members

float periapsis

Current vessel’s orbital periapsis.

float apoapsis

Current vessel’s orbital apoapsis.

struct apsidesTimeMessage
#include <PayloadStructs.h>

An Apsides Time message.

Public Members

int32_t periapsis
int32_t apoapsis

Time until the current vessel’s orbital periapsis, in seconds.

struct orbitInfoMessage
#include <PayloadStructs.h>

An message containing orbital information.

Public Members

float eccentricity

Current vessel’s orbital eccentricity.

float semiMajorAxis

Current vessel’s orbital semi major axis.

float inclination

Current vessel’s orbital inclination.

float longAscendingNode

Current vessel’s orbital longitude of ascending node.

float argPeriapsis

Current vessel’s orbital argument of periapsis.

float trueAnomaly

Current vessel’s orbital true anomaly.

float meanAnomaly

Current vessel’s orbital mean anomaly.

float period

Current vessel’s orbital period.

struct flightStatusMessage
#include <PayloadStructs.h>

An message containing information about the current flight.

Public Functions

inline bool isInFlight()
inline bool isInEVA()
inline bool isRecoverable()
inline bool isInAtmoTW()
inline byte getControlLevel()

Returns the current control level.

KSP1: 0 for no control, 1 for partially unmanned, 2 for partially manned, 3 for full control. KSP2: 0 for no control, 1 for no CommNet, 2 for Full Control Hibernation, 3 for Full Control.

inline bool hasTarget()

Public Members

byte flightStatusFlags

Different booleans as defined by FlightStatusFlags.

You can access them with the helper funtions.

byte vesselSituation

Current situation of the vessel, as defined by the Vessel.Situations enum (KSP1) or KSP.Sim.impl.VesselSituations (KSP2) in the KSP API (KSP1: 1 for Landed, 8 for flying, etc.

; KSP2: PreLaunch = 0, Landed = 1, Splashed = 2, Flying = 3, SubOrbital = 4, Orbiting = 5, Escaping = 6, Unknown = byte.MaxValue).

byte currentTWIndex

Current TW index.

byte crewCapacity

Current vessel crew total capacity.

byte crewCount

Current vessel crew count.

byte commNetSignalStrenghPercentage

Current vessel commNet signal strengh (in percentage).

0 when CommNet is not used

byte currentStage

Current stage of the vessel (also the total number of stage remaining).

Decreased by one at each staging. Caped at 255 by Simpit.

byte vesselType

Current type of the vessel (KSP1: e.g.

0 for debris, 5 for rover, 3 for probe, 7 for ship, etc. as indicated in https://www.kerbalspaceprogram.com/api/_vessel_8cs.html#afa39c7ec7cc0926b332fcd2d77425edb ). Gives the map item as in KSP.Map.MapItemType for KSP2 (0 for unknown, 1 for CelestialBody, 2 for Debries, 3 for Vessel, 4 for Astronaut, etc).

struct atmoConditionsMessage
#include <PayloadStructs.h>

An message containing information about the current atmospheric conditions.

Public Functions

inline bool hasAtmosphere()
inline bool hasOxygen()
inline bool isVesselInAtmosphere()

Public Members

byte atmoCharacteristics

Different booleans as defined by AtmoConditionsFlags.

You can access them with the helper funtions.

float airDensity

Current density in the current atmosphere where the current vessel is.

Only defined if in atmosphere.

float temperature

Current temperature in the current atmosphere where the current vessel is.

Only defined if in atmosphere.

float pressure

Current pressure in the current atmosphere where the current vessel is.

Only defined if in atmosphere.

struct resourceMessage
#include <PayloadStructs.h>

A Resource message.

All resource messages use this struct for sending data.

Public Members

float total

Maximum capacity of the resource.

float available

Current resource level.

struct TACLSResourceMessage
#include <PayloadStructs.h>

A Resource message for TACLS ressources.

Only for KSP1.

Public Members

float currentFood

Current resource level for food.

float maxFood

Maximum capacity of food.

float currentWater

Current resource level for water.

float maxWater

Maximum capacity of water.

float currentOxygen

Current resource level for oxygen.

float maxOxygen

Maximum capacity of oxygen.

struct TACLSWasteMessage
#include <PayloadStructs.h>

A Resource message for TACLS ressources.

Only for KSP1.

Public Members

float currentWaste

Current resource level for waste.

float maxWaste

Maximum capacity of waste.

float currentLiquidWaste

Current resource level for liquid waste.

float maxLiquidWaste

Maximum capacity of liquid waste.

float currentCO2

Current resource level for CO2.

float maxCO2

Maximum capacity of CO2.

struct CustomResourceMessage
#include <PayloadStructs.h>

A Resource message for custom ressources.

The resources must be set in the configuration file. Only for KSP1.

Public Members

float currentResource1

Current resource level resource 1.

float maxResource1

Maximum capacity of resource 1.

float currentResource2

Current resource level resource 2.

float maxResource2

Maximum capacity of resource 2.

float currentResource3

Current resource level resource 3.

float maxResource3

Maximum capacity of resource 3.

float currentResource4

Current resource level resource 4.

float maxResource4

Maximum capacity of resource 4.

struct velocityMessage
#include <PayloadStructs.h>

A Velocity message.

Public Members

float orbital

Orbital velocity.

float surface

Surface velocity.

float vertical

Vertical velocity.

struct targetMessage
#include <PayloadStructs.h>

A Target information message.

Public Members

float distance

Distance to target.

float velocity

Velocity relative to target.

float heading

Heading of the target.

Only available in KSP1.

float pitch

Pitch of the target.

Only available in KSP1.

float velocityHeading

Heading of the velocity to the target.

Only available in KSP1.

float velocityPitch

Pitch of the velocity to the target.

Only available in KSP1.

struct intersectsMessage
#include <PayloadStructs.h>

A Intersect information message.

If an intersect does not exist, the according values are negative.

Public Members

float distanceAtIntersect1

Relative distance at the first intercept.

int32_t timeToIntersect1

Time to the first intercept in seconds.

float velocityAtIntersect1

Relative velocity at the first intercept.

float distanceAtIntersect2

Relative distance at the second intercept.

int32_t timeToIntersect2

Time to the second intercept in seconds.

float velocityAtIntersect2

Relative velocity at the second intercept.

struct airspeedMessage
#include <PayloadStructs.h>

An Airspeed information message.

Public Members

float IAS

Indicated airspeed.

float mach

Mach number.

float gForces

G forces.

struct maneuverMessage
#include <PayloadStructs.h>

A maneuver information message.

Public Members

float timeToNextManeuver

Time to the next planned maneuver.

float deltaVNextManeuver

Delta to the next planned maneuver.

float durationNextManeuver

Duration of the burn for the next planned maneuver.

float deltaVTotal

DeltaV of all the planned maneuvers.

float headingNextManeuver

Heading of the next maneuver.

Only available in KSP1.

float pitchNextManeuver

Pitch of the next maneuver.

Only available in KSP1.

struct vesselPointingMessage
#include <PayloadStructs.h>

A vessel orientation information message, including velocity orientation.

Public Members

float heading

Heading of the vessel (between 0 and 360, as indicated in the navball.

90 when pointing east, 180 when pointing south).

float pitch

Pitch angle of the vessel (between -90 and +90.

0 for an horizontal craft, +90 when pointing up, -90 when pointing down).

float roll

Roll angle of the vessel (between -180 and +180.

0 for a plane on the runway, ready to takeoff). Values may differ between KSP1 and KSP2.

float orbitalVelocityHeading

Heading of the orbital velocity.

Only available in KSP1.

float orbitalVelocityPitch

Pitch of the orbital velocity.

Only available in KSP1.

float surfaceVelocityHeading

Heading of the surface velocity.

Only available in KSP1.

float surfaceVelocityPitch

Pitch of the surface velocity.

Only available in KSP1.

struct advancedActionStatusMessage
#include <PayloadStructs.h>

A advanced action group information message.

Public Functions

inline byte getActionStatus(byte groupIndex)

param: index of the action group as it is defined in AdvancedActionGroupIndexes or a number from 1 to 10 for custom action groups returns: 0 for not available, 1 for on, 2 for off and 3 for mixed

Public Members

uint32_t status

List of all the action status with 2 bits per action group.

Read them with the get_action_status method.

struct setSingleActionGroupMessage
#include <PayloadStructs.h>

A message to set a single action group.

Public Functions

setSingleActionGroupMessage(byte advancedActionGroupIndex, ActionGroupSettings setting)

param: index of the action group as it is defined in AdvancedActionGroupIndexes or a number from 1 to 10 for custom action groups.

Public Members

byte actionGroupAndSetting

6 bits of which action group to set and 2 bits of what to to with said action group.

struct deltaVMessage
#include <PayloadStructs.h>

A deltaV information message.

Public Members

float stageDeltaV

DeltaV of the current stage.

float totalDeltaV

DeltaV of the whole vessel.

struct deltaVEnvMessage
#include <PayloadStructs.h>

A deltaV information message in different environments.

Public Members

float stageDeltaVASL

DeltaV of the current stage at atmospheric sea level.

float totalDeltaVASL

DeltaV of the whole vessel at atmospheric sea level.

float stageDeltaVVac

DeltaV of the current stage in vacuum.

float totalDeltaVVac

DeltaV of the whole vessel in vacuum.

struct burnTimeMessage
#include <PayloadStructs.h>

A burn time information message.

Public Members

float stageBurnTime

Burn time of the current stage.

float totalBurnTime

Burn time of the whole vessel.

struct tempLimitMessage
#include <PayloadStructs.h>

A temperature limit message.

Public Members

byte tempLimitPercentage

Maximum temperature percentage (as current temp over max temp) of any part of the vessel.

byte skinTempLimitPercentage

Maximum temperature percentage (as current skin temp over max skin temp) of any part of the vessel.

Only works in KSP1

struct rotationMessage
#include <PayloadStructs.h>

A vessel rotation message, only used to send commands to KSP.

This struct contains information about vessel rotation commands.

Public Functions

rotationMessage()
void setPitch(int16_t pitch)
void setRoll(int16_t roll)
void setYaw(int16_t yaw)
void setPitchRollYaw(int16_t pitch, int16_t roll, int16_t yaw)

Public Members

int16_t pitch

Vessel pitch.

int16_t roll

Vessel roll.

int16_t yaw

Vessel yaw.

byte mask

The mask indicates which elements are intentionally set.

Unset elements should be ignored. It should be one or more of:

  • 1: pitch (PITCH_ROT)

  • 2: roll (ROLL_ROT)

  • 4: yaw (YAW_ROT)

struct translationMessage
#include <PayloadStructs.h>

A vessel translation message.

This struct contains information about vessel translation commands.

Public Functions

translationMessage()
void setX(int16_t x)
void setY(int16_t y)
void setZ(int16_t z)
void setXYZ(int16_t x, int16_t y, int16_t z)

Public Members

int16_t X

Translation along the X axis.

int16_t Y

Translation along the Y axis.

int16_t Z

Translation along the Z axis.

byte mask

The mask indicates which elements are intentionally set.

Unset elements should be ignored. It should be one or more of:

  • 1: X (X_TRANS)

  • 2: Y (Y_TRANS)

  • 4: Z (Z_TRANS)

struct customAxisMessage
#include <PayloadStructs.h>

A vessel custom axis message.

Only for KSP1. This struct contains information about custom axis commands.

Public Functions

customAxisMessage()
void setCustom1(int16_t val)
void setCustom2(int16_t val)
void setCustom3(int16_t val)
void setCustom4(int16_t val)
void setAllCustom(int16_t custom1, int16_t custom2, int16_t custom3, int16_t custom4)

Public Members

int16_t custom1

Value for the custom1 axis.

int16_t custom2

Value for the custom2 axis.

int16_t custom3

Value for the custom3 axis.

int16_t custom4

Value for the custom4 axis.

byte mask

The mask indicates which elements are intentionally set.

Unset elements should be ignored. It should be one or more of:

  • 1: Custom1

  • 2: Custom2

  • 4: Custom3

  • 8: Custom4

struct wheelMessage
#include <PayloadStructs.h>

A wheel control message.

This struct contains information about wheel steering and throttle.

Public Functions

wheelMessage()
void setSteer(int16_t steer)
void setThrottle(int16_t throttle)
void setSteerThrottle(int16_t steer, int16_t throttle)

Public Members

int16_t steer

Wheel steer.

int16_t throttle

Wheel throttle.

byte mask

The mask indicates which elements are intentionally set.

Unset elements should be ignored. It should be one or more of:

  • 1: steer (STEER_WHEEL)

  • 2: throttle (THROTTLE_WHEEL)

struct throttleMessage
#include <PayloadStructs.h>

A throttle control message.

This struct contains information about throttle.

Public Members

int16_t throttle

Throttle.

struct timewarpMessage
#include <PayloadStructs.h>

A timewarp message.

This struct contains a single timewarp command, defined in the Timewarp enum.

Public Members

byte command

Command in the Timewarp enum.

struct timewarpToMessage
#include <PayloadStructs.h>

A timewarp TO message.

This struct contains a single timewarp command, defined in the Timewarp enum.

Public Functions

timewarpToMessage(byte instant, float delay)

Public Members

byte instant

Instant defined in the TimewarpTo enum.

float delay

Delay in seconds to add to the instant defined (negative to timewarp before the target instant).

struct cameraRotationMessage
#include <PayloadStructs.h>

A camera mode message.

This struct contains information about the camera mode.

Public Functions

cameraRotationMessage()
void setPitch(int16_t pitch)
void setRoll(int16_t roll)
void setYaw(int16_t yaw)
void setZoom(int16_t zoom)
void setPitchRollYawZoom(int16_t pitch, int16_t roll, int16_t yaw, int16_t zoom)

Public Members

int16_t cameraPitch
int16_t cameraRoll
int16_t cameraYaw
int16_t cameraZoom
byte mask

The mask indicates which elements are intentionally set.

Unset elements should be ignored. Based on the RotationAxes enum.

struct keyboardEmulatorMessage
#include <PayloadStructs.h>

A keyboard emulator message.

This struct contains information about the keypress to emulate.

Public Functions

keyboardEmulatorMessage(int16_t keyCode)
keyboardEmulatorMessage(int16_t keyCode, byte modifier)

Public Members

byte modifier
int16_t keyCode

This documentation was build using ArduinoDocs.