SatOS Interface Reference¶
This reference document describes how to work with the SatOS Interface, from a conceptual level down to actual API requests and responses.
Introduction¶
The SatOS Interface is a bidirectional communication mechanism utilized by the Application Controller and a Payload Application. A “channel” below represents an open connection between a single PA and the AC.
The SatOS Interface relies on an asynchronous request/response model. A “correlation ID” is used to map responses back to the originating requests when async responses are to be expected. The Application Controller also works with this asynchronous model, expecting async responses from the Payload Application to its own requests.
Though the API schema and data structures defined in this document are in syntax of programming language C, the SDK library is available in multiple languages.
Request Flow Example¶
The following flow diagram represents how the SatOS Interface is used during a typical period of payload operation:
Encryption & Authentication¶
Communication between a Payload Application and the Application Controller is encrypted. All messages between the PA and AC are encrypted. This encryption feature is built into available SDK software libraries, and should be left enabled at all times.
Authentication of communication via the SatOS Interface is achieved with a simple auth token retrieved during the PA registration call. This detail is handled by the SDK software libraries made available to payload developers, and no explicit action needs to be taken.
Establishing a Connection¶
To begin communication via the SatOS Interface, PA creates a connection to the Application Controller via the CreateChannel API. With the CreateInsecureChannel API, communication between PA and AC will not be encrypted. Once a channel is created, it is used to facilitate all other API calls.
To explicitly close the channel, a PA may use the DeleteChannel API. This is not required, but highly encouraged as it helps the AC understand the current state of the PA.
Connection/channel management is typically abstracted by an SDK library, and developesr should not need to worry about explicit create/delete.
API Reference¶
Payload Application Requests¶
Below are the interactions that may be initiated by a Payload Application. Note that most requests define a corresponding asynchronous response, but some do not.
Register¶
Register the PA with the AC, typically executed immediately after opening a channel. The AC will only communicate with PAs that successfully register themselves. After some time without registration, a PA will be considered in a bad state and may be shut down prematurely.
Parameters:
U16 CorrelationIdU16 HealthCheckFailActionIndicates what the AC should do if the application fails to respond to health checks five consecutive times. A
0value results in no action taken, while1indicates the application should be rebooted.
Expected async response from AC: ResponseRegister
U16 CorrelationIdWill match what was sent in
Registerrequest
U16 ReqStatus0if request succeeded, otherwise non-zero value indicating failure
[256]U8 AuthToken
GetCurrentLocation¶
Retrieve current GNSS (GPS) location.
Parameters:
U16 CorrelationId
Expected async response from AC: ResponseGetCurrentLocation
U16 CorrelationIdWill match what was sent in request
U16 ReqStatus0if request succeeded, otherwise non-zero value indicating failure
DOUBLE LatitudeDOUBLE LongitudeDOUBLE AltitudeFLOAT SD_LatitudeFLOAT SD_LongitudeFLOAT SD_AltitudeU64 DeterminedAtTime at which the location was determined
PayloadPowerControl¶
Request to change the power state of any specific Payload Device. PA can power cycle its device by issuing a Power-Off request followed by a Power-On after some delay.
Parameters:
U16 CorrelationIdU16 PowerOperationU16 hwidRequest Power-Off with a value of
0, or Power-On with a value of1U16 hw_idthe Id of the payload device which needs to Power-On or Power-Off
Expected async response from AC: ResponsePayloadPowerControl
U16 CorrelationIdWill match what was sent in request
U16 ReqStatus0if request succeeded, otherwise non-zero value indicating failure
StageFileDownload¶
Indicate that a file is ready to be download through a ground link. The Payload Application is expected to first place the file in /opt/antaris/outbound before making this API call. The Application Controller will delete this file from the outbound folder once it is successfully downlinked.
Parameters:
U16 CorrelationIdchar[64] FileLocationRelative path within
/opt/antaris/outbound. For example, to stage a file located at/opt/antaris/outbound/foo/bar.json, one would setFileLocation=foo/bar.json
Expected async response from AC: ResponseStageFileDownload
U16 CorrelationIdWill match what was sent in request
U16 ReqStatus0if request succeeded, otherwise non-zero value indicating failure. Success here does NOT mean the file has been downlinked. It simply represents the downlink request has been accepted, and the file will be downlinked at a later time.
GetGnssEphData¶
Request to get GNSS EPH1/EPH2 data periodically or one-time. Callback is received to application based on time period set.
Parameters:
U16 CorrelationIdU8 Enable_EPH2Request Enable_Eph2 with a value of
1, or disable with value of0
U32 Periodicity_in_MSSet it to
0if onetime GNSS EPS data needed, or set with expected periodicty in milliseconds
Expected periodic callback from AC: ResponseGnssEphData
U16 CorrelationIdWill match what was sent in request
U64 GPS_Fix_TimeGPS time
U64 GPS_Sys_TimeGPS System time
U64 OBC_TimeOBC time
U64 GPS_Position_ECEF[3]GPS position
U64 GPS_Velocity_ECEF[3]GPS velocity
U16 GPS_Validity_flag_pos_velGPS validity flag
U64 ADCS_TimeOrbit time
U64 Position_WRT_ECI[3]Position
U64 Velocity_wrt_ECI[3]Position
U64 Position_wrt_ECEF[3]Position
U64 Velocity_wrt_ECEF[3]Position
U32 Body_Rate[3]Body rate
U32 Attitude[3]RPY WRT LVLH
U32 ADCS_POS[3]Lat, Lon, Altitude (ADCS)
U32 Nadir_Vector_Body[3]Nadir vector
U32 GD_Nadir_Vector_Body[3]GD Nadir Vector Body
U32 Beta_AngleBeta Angle
U16 Validity_Flags1-bit flagsTime Validity,Position and Velocity ECI Validity,
Position and Velocity ECEF Validity, Rate Validity, Attitude Validity, Lat-Lon-Altitude Validity, Nadir Vector Validity, GD Nadir Vector Validity, Beta Angle Validity
GetEpsVoltage¶
Request to get EPS voltage data periodically or one-time. Callback is received to application based on time period set.
Parameters:
U16 CorrelationIdU32 Periodicity_in_MSSet it to
0if onetime EPS voltage info needed, or set with expected periodicty in milliseconds
Expected periodic callback from AC: ResponseEpsVoltage
U16 CorrelationIdWill match what was sent in request
FLOAT EPS_VoltageEPS instanteneous voltage
SesThermMgmntReq¶
Request SatOS to monitor temperature of hardware in every n ms (duration). Callback is received to SatOS_SDK if temperature of hardware is not in the range of lower and upper thresholds .
Parameters:
U16 CorrelationIdU8 hardware_idId of hardware which needs to be monitor
U32 durationit monitor the hardware temperature in every given duration.
U8 lower_thresholdvalue of lower threshold, will recieve callback if temperature goes below this value.
U8 upper_thresholdvalue of upper threshold, will recieve callback if temperature goes above this value.
Expected periodic callback from AC: SesThrmlNtf
U16 CorrelationIdWill match what was sent in request
U8 heater_pwr_statusstatus of heater 0:OFF, 1:ON
U8 temptemperature of hardware in celsius
SesTempReq¶
Request temperature of hardware and power state of heater .
Parameters:
U16 CorrelationIdU8 hardware_idId of hardware
Expected periodic callback from AC: RespSesTempReq
U16 CorrelationIdWill match what was sent in request
U8 temptemperature of hardware in celsius
U8 heater_pwr_statusstatus of heater 0:OFF, 1:ON
PaSatosMessage¶
Data that has to be sent to the SatOS.
Parameters:
U16 CorrelationIdU16 CommandCommand is payload specific and it is understanding between SatOS_SDK and SatOS.
INT[255] payload datapayload data is a command parameter that has to be sent to the SatOS. it can be upto to 1020 bytes.
Expected periodic callback from AC: RespPaSatOsMsg
U16 CorrelationIdWill match what was sent in request
U16 Command IdWill match what was sent in request
U16 ReqStatus0if request succeeded, otherwise non-zero value indicating failure
Application Controller Requests¶
Below are the interactions that may be initiated by the Application Controller. Responses, when appropriate, are sent from the Payload Application.
StartSequence¶
AC sends this command to the PA to instruct it to execute a known sequence immediately.
Parameters:
U16 CorrelationIdchar[16] SequenceNameAn alphanumeric string that should be mapped and/or parsed by the Payload Application
char[64] SequenceParamsAn alphanumeric string that should be mapped and/or parsed by the Payload Application
U64 ScheduledDeadlineAbsolute unix time at which the PA must must have completed the sequence
Expected async response from PA: SequenceDone
U16 CorrelationIdMust match what was sent in request
Shutdown¶
Initiate a PA shutdown immediately. Application can shutdown its payload hardware gracefully before shutting itself down. PA will have a graceful shutdown deadline, the length of which is pre-configured in the Antaris Cloud Platform tasks.
Parameters:
U16 CorrelationIdU64 ShutdownDeadlineAbsolute unix time at which the PA must must have issued a response and shut down gracefully, otherwise more aggressive shutdown procedures may be taken
Expected async response from PA: ResponseShutdown
U16 CorrelationIdMust match what was sent in request
U16 ReqStatus0if request succeeded, otherwise non-zero value indicating failure
HealthCheck¶
AC monitors PA health by calling this request periodically (every 5 seconds). The PA should be prepared to process this request and report an accurate representation of its health immediately
Parameters:
U16 CorrelationId
Expected async response from PA: ResponseHealthCheck
U16 AppStateIndicate overall payload application health with
0, otherwise non-zero indicates the PA is in a bad state
U16 ReqsToPCInErrCntNumber of requests from PA to AC that failed
U16 RespsToPCInErrCntNumber of responses from PA to AC that failed
PayloadMetrics¶
PA maintains an array of eight name-value` pairs, called Metrics, containing payload-specific statistical information. The AC periodically requests these statistics by sending a request to the PA. The PA must be ready to process this request and respond immediately with accurate, up-to-date statistics.
Parameters:
U16 CorrelationId
Expected async response from PA: ResponsePayloadMatrics
U16 UsedCounterIndicate total number of metrics maintained by PA
U64 TimeStampIndicates current timestamp of response
Struct PayloadMetricsInfo MatricsU8 name[256]* Name of counterU32 counter* Value