Forum

RTSA Suite PRO Release v2.1

Please or Register to create posts and topics.

Graph Messages – Script block interaction with the Remote Config block

In this example the Script block interacts with the Remote Config block.

ScriptToRemoteConfig

Following code snippet will print out the received graph message types:

GraphMessageTypes

To interact with the Remote Config Block the Script block reacts to three different types of graph messages:

  • REQUEST_HEALTH_STATUS ( reply with health status )
  • REQUEST_REMOTE_CONFIG ( reply with the Script block configuration )
  • SET_REMOTE_CONFIG ( check and accept configuration changes )

The graph message may also be addressed to other RTSA block. Therefore to accept a configuration change the unique destination identifier of the graph message need to match the unique identifier of the current Script block. The Mission.block() promise returns the current Script block information together with its unique identifier.

ReceiveGraphMessages

The structure of a response is in JSON format, have a look into attached mission.

RemoteConfigStructure

To get a feeling of the message format you can always use a HTTP Server block together with other RTSA blocks to show the JSON structures in your web browser. The graph messages are also mapped to the HTTP interface endpoints.

Following the Spectran V6 block replies to the REQUEST_REMOTE_CONFIG graph message via the HTTP endpoint   http://localhost:54664/remoteconfig. Firefox for example will parse the JSON format to show it in a more human friendly way:

SpectranV6RemoteConfig

Uploaded files: