Skip to content

Message Routing

Alex Omar edited this page Feb 27, 2017 · 1 revision

Message Routing on the Flight Computer

To send messages to where they need to go on the flight computer you need to send a json object formatted with the following fields:

To: This is what object the message is meant for. The available objects are "fueling", "logging", "radio", and "network".

Dest: The final destination for this packet. Which valve, which Network Destination, etc.

Payload: The payload for that object.

Example

I want to open Valve A. The "To" field should be fueling, and the "Dest" field should be valve a, and the "payload" should be "open". There are a lot of possible commands other than open. They just havent been implemented yet :)

Rocket side

A Queued_Msg struct gets passed around the MessageQueue object. You can pass normal (not dynamic) Queued_Msgs in here and it will dynamically copy it when it is pushed, and deleted when it is popped. From an api stand point you don't have to worry about weird memory things happening to you. treat the IO as strings.

the struct looks like this:

//MessageQueue.h

struct Queued_Msg
{
    string to;
    string dest;
    string payload;
}

Destinations

fueling

to: fueling dest: valve name payload: open, close, status

logging

to: logging dest: payload: string of what you want to log

network

to: network dest: origin, tbd... payload: http request to send

Clone this wiki locally