Skip to main content

Python Stanag 4586 Edition A v1

Project description

Python package for STANAG 4586 Edition A Version 1

Tested with python 3.8x

Published branch Development branch
build status main branch build status development branch

This repository conotains code that will enable encoding/decoding of STANAG messages. So far the following messages have been implemented which should enable basic communication with a platform, messages are being continually added, please check back soon for updates.

  • Message wrapper
  • 01
  • 20
  • 21
  • 200
  • 300
  • 301
  • 302
  • 1200
  • 20000 [Private message for EO Pan and Tilt functionality]
  • 20010 [Private message for query request]
  • 20020 [Private message for query response]

See further below for simple usage.

Important note

Please note this is a low level library and does not provide any network I/O or message assembly/disassembly.

Take a look at the python-stanag-4586-vsm library which provides a basic implementation of a vehicle specific module (VSM) and uses this library to respond to discover, authorization and control messages.

Simple usage example

Assuming you would have already parsed the message wrapper and know what message is contained in the byte array, save the following in a file called stanag-test.py

from stanag4586edav1.message01 import *

# We create a dummy byte stream containing only Message 01 contents
PACKET_TO_DECODE = b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x50\x00\x00\x00\xA0\x00\x00\x00\x00" \
b"\x00\x00\x00\x00\x00\x39\x00\x00\x01\x00\x00\x00\x00\x01\x00"


def decode_message01():
    msg01 = Message01(PACKET_TO_DECODE)
    
    print(msg01.time_stamp)
    print(msg01.cucs_id)

decode_message01()

Executing the above code will produce output as follows

$ python stanag-test.py
0.0
160

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stanag4586edav1-0.0.11.tar.gz (19.4 kB view details)

Uploaded Source

File details

Details for the file stanag4586edav1-0.0.11.tar.gz.

File metadata

  • Download URL: stanag4586edav1-0.0.11.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.7

File hashes

Hashes for stanag4586edav1-0.0.11.tar.gz
Algorithm Hash digest
SHA256 c6e9c209a935c3c1f069c8e19b3cb3713d87890991761fb072973de7899cf7a1
MD5 28d15dfecbec0739d3e9e170ddede907
BLAKE2b-256 e6b936f3e050fd9d727c725a4bdabb5487f62b2028e582326ee53fe2e0f5abec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page