JSON String Format

The format of JSON string in TCP/IP communication is defined here.

Command Acknowledgement

The M2 cell controller should acknowledge the M2 CSC/GUI actively for the command status with ack if:

  1. The command is in the list of registered commands by the M2 cell controller.

  2. The sequence_id is bigger than the previous by one if it is not the first command. Let the M2 CSC/GUI decides the first value of sequence_id.

Otherwise, the noack should be used. In the condition 2 above, if the M2 cell controller received a command with sequence_id: 1 followed by sequence_id: 3, it should do the noack as the following and vice versa:

{
    "id": "noack",
    "sequence_id": 2
}

Details of the Parameters

The parameter details should be inline with the JSON string. For example, the M2 CSC/GUI might issue a move command with x, y, and z as the following:

{
    "id": "cmd_move",
    "sequence_id": 1,
    "x": 0.1,
    "y": 0.2,
    "z": 0.3
}

The M2 CSC/GUI might issue multiple commands in a short time, but the M2 cell controller only executes a single command in a single time and reply the result.

Take the above command as an example, the acknowledgement from the M2 cell controller at each time of receiving the command will be:

{
    "id": "ack",
    "sequence_id": 1
}

If this command succeeds after the execution by M2 cell controller, the following message will be issued to the M2 CSC/GUI:

{
    "id": "success",
    "sequence_id": 1
}

In some cases, the parameters might not be needed. For example, the M2 cell controller might publish a inPosition event:

{
    "id": "inPosition"
}

The M2 cell controller might subscribe the inPosition event from MTMount component with the parameter of tolerance (the M2 CSC/GUI should send this message to the M2 cell controller):

{
    "id": "evt_inPosition",
    "compName": "MTMount",
    "tolerance": 0.001
}

The telemetry is similar to the event. The main difference is that the telemetry will be in a fixed rate (in the ideal case).