AUTOSAR SOME/IP container: PHP parsing library

KS implementation details

License: CC0-1.0
Minimal Kaitai Struct required: 0.9

This page hosts a formal specification of AUTOSAR SOME/IP container using Kaitai Struct. This specification can be automatically translated into a variety of programming languages to get a parsing library.

PHP source code to parse AUTOSAR SOME/IP container

SomeIpContainer.php

<?php
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild

namespace {
    class SomeIpContainer extends \Kaitai\Struct\Struct {
        public function __construct(\Kaitai\Struct\Stream $_io, \Kaitai\Struct\Struct $_parent = null, \SomeIpContainer $_root = null) {
            parent::__construct($_io, $_parent, $_root);
            $this->_read();
        }

        private function _read() {
            $this->_m_someIpPackages = [];
            $i = 0;
            while (!$this->_io->isEof()) {
                $this->_m_someIpPackages[] = new \SomeIp($this->_io);
                $i++;
            }
        }
        protected $_m_someIpPackages;
        public function someIpPackages() { return $this->_m_someIpPackages; }
    }
}