Schema: Network

(v1.0.0)

Network

kind: Network
metadata:
  name: CAN1
  annotations:
    message_lib: examples/stub/data/message.so
    function_lib: examples/stub/data/function.so
spec:
  messages:
    - message: systemStatus
      annotations:
        struct_name: CAN1_systemStatus_t
        struct_size: 4
        frame_id: 496
        frame_length: 8
        cycle_time_ms: 10
      signals:
        - signal: Crc
          annotations:
            struct_member_name: crc
            struct_member_offset: 0
            struct_member_primitive_type: uint8_t
        - signal: Alive
          annotations:
            struct_member_name: alive
            struct_member_offset: 1
            struct_member_primitive_type: uint8
        - signal: Temperature
          annotations:
            struct_member_name: temperature
            struct_member_offset: 2
            struct_member_primitive_type: int16_t
      functions:
        encode:
          - function: counter_inc_uint8
            annotations:
              position: 1
          - function: crc_generate
            annotations:
              position: 0
        decode:
          - function: crc_validate
            annotations:
              position: 0

A Network definition.

Supported annotations:

AnnotationDescription
message_libRelative path of the shared library containing the Network Message symbols.
function_libRelative path of the shared library containing Network Function symbols.
node_idThe identifier of the Node used to indicate the sender of a network message. Typically specified in a mimeTYPE for the Network Signal, however a value may also be specified here.
interface_idThe identifier of the Interface of the Node used to send a network message. Typically specified in a mimeTYPE for the Network Signal, however a value may also be specified here.
bus_idThe identifier of the Bus connected to the Interface of the Node. Typically specified in a mimeTYPE for the Network Signal, however a value may also be specified here.

Properties

NameTypeRequiredDescription
kindstringtruenone
metadataobjectfalseInformation relating to an object.
» namestringfalseThe name of the object.
» labelsobjectfalseIdentifying information used to identify objects within the system (e.g. giving a specific ’label’ to an object).
»» additionalPropertiesstringfalsenone
» annotationsobjectfalseNon identifying information (i.e. information specific to the object itself).
»» additionalPropertiesanyfalsenone
specNetworkSpectruenone

Enumerated Values

PropertyValue
kindNetwork

NetworkSpec

messages:
  - message: systemStatus
    annotations:
      struct_name: CAN1_systemStatus_t
      struct_size: 4
      frame_id: 496
      frame_length: 8
      cycle_time_ms: 10
    signals:
      - signal: Crc
        annotations:
          struct_member_name: crc
          struct_member_offset: 0
          struct_member_primitive_type: uint8_t
    functions:
      encode:
        - function: crc_generate
          annotations:
            position: 0
      decode:
        - function: crc_validate
          annotations:
            position: 0

Properties

NameTypeRequiredDescription
messages[NetworkMessage]trueA list of messages belonging to this Network.

NetworkMessage

message: systemStatus
annotations:
  struct_name: CAN1_systemStatus_t
  struct_size: 4
  frame_id: 496
  frame_length: 8
  cycle_time_ms: 10
signals:
  - signal: Crc
    annotations:
      struct_member_name: crc
      struct_member_offset: 0
      struct_member_primitive_type: uint8_t
functions:
  encode:
    - function: crc_generate
      annotations:
        position: 0
  decode:
    - function: crc_validate
      annotations:
        position: 0

A Network message definition.

Supported annotations:

AnnotationDescription
struct_nameName of the typedef/struct representing the message.
struct_sizeSize of the message struct (in bytes).
frame_idThe frame id of the message when encoded to a bus transport (e.g. CAN Frame ID).
frame_lengthThe length of the message when encoded (in bytes).
cycle_time_msMessage will be sent according to the specified schedule (milliseconds).

Properties

NameTypeRequiredDescription
messagestringtrueThe name of the message.
annotationsobjectfalseNon identifying information (i.e. information specific to the object itself).
» additionalPropertiesanyfalsenone
signals[NetworkSignal]falseA list of signals represented in this message.
functionsNetworkFunctionsfalseMessage functions to be applied to this message.

NetworkSignal

signal: Temperature
annotations:
  struct_member_name: temperature
  struct_member_offset: 2
  struct_member_primitive_type: int16_t

A Network signal definition.

Supported annotations:

AnnotationDescription
init_valueThe signal is initialised to this value. The value will be interpreted according to the struct_member_primitive_type annotation.
struct_member_nameName of the struct member which represents this signal.
struct_member_offsetOffset of the member in the struct (in bytes).
struct_member_primitive_typeThe primitive type of the member (select from int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, float or double).

Properties

NameTypeRequiredDescription
signalstringtrueThe name of the signal.
annotationsNetworkMessage/properties/annotationsfalseNon identifying information (i.e. information specific to the object itself).

NetworkFunctions

encode:
  - &a1
    function: crc_generate
    annotations:
      position: 0
decode:
  - *a1

Message functions to be applied to this message.

Properties

NameTypeRequiredDescription
encode[NetworkFunction]falseMessage functions applied to the encode processing path (i.e. from Signal to Network interface). Functions are implicitly applied in the order of definition.
decode[NetworkFunction]falseMessage functions applied to the decode processing path (i.e. from Network to Signal interface). Functions are implicitly applied in the order of definition.

NetworkFunction

function: crc_generate
annotations:
  position: 0

A Network Function definition.

Properties

NameTypeRequiredDescription
functionstringtrueThe name of the function (i.e. the name of the symbol in the Network Function shared library).
annotationsNetworkMessage/properties/annotationsfalseNon identifying information (i.e. information specific to the object itself).

undefined