mavlink / mavlink2rest

mavlink2rest creates a REST server that provides mavlink information from a mavlink source
MIT License
68 stars 23 forks source link

sequence is required but ignored #79

Open clydemcqueen opened 11 months ago

clydemcqueen commented 11 months ago

The API requires that we send a MAVLink sequence number, but it is ignored.

E.g., this API call fails:

curl --verbose http://127.0.0.1:6040/mavlink -H "accept: application/json" --data \
'{
    "header": {
        "system_id": 255,
        "component_id": 240,
    },
    "message": {
        "type": "COMMAND_LONG",
        "param1": 1.0,
        "param2": 0.0,
        "param3": 0.0,
        "param4": 0.0,
        "param5": 0.0,
        "param6": 0.0,
        "param7": 0.0,
        "command": {"type": "MAV_CMD_COMPONENT_ARM_DISARM"},
        "target_system": 1,
        "target_component": 1,
        "confirmation": 1
    }
}'

while this one succeeds:

curl --verbose http://127.0.0.1:6040/mavlink -H "accept: application/json" --data \
'{
    "header": {
        "system_id": 255,
        "component_id": 240,
        "sequence": 0
    },
    "message": {
        "type": "COMMAND_LONG",
        "param1": 1.0,
        "param2": 0.0,
        "param3": 0.0,
        "param4": 0.0,
        "param5": 0.0,
        "param6": 0.0,
        "param7": 0.0,
        "command": {"type": "MAV_CMD_COMPONENT_ARM_DISARM"},
        "target_system": 1,
        "target_component": 1,
        "confirmation": 1
    }
}'

but the sequence number that appears in the packet is set by the MAVLink library, not by the API.