Skip to content

Commit

Permalink
Doc update.
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Rule (VM/EMT3) <[email protected]>
  • Loading branch information
timrulebosch committed Nov 12, 2024
1 parent 23610bb commit 9eedb1e
Show file tree
Hide file tree
Showing 24 changed files with 708 additions and 780 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The resultant Functional Simulation (FSIL) may be used to validate complex funct
The following diagram shows how Network Functions and a Virtual ECU may be connected using the Network Model to form a typical FSIL simulation.


![network-introduction](doc/static/network-introduction.png)
![network-introduction](doc/static/tutorial.png)


The Network Model is implemented with the [Model C Library](https://github.com/boschglobal/dse.modelc) and uses the
Expand Down
41 changes: 35 additions & 6 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Robert Bosch GmbH
# Copyright 2024 Robert Bosch GmbH
#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -8,17 +8,46 @@ DSE_CDOCGEN_IMAGE ?= dse-cdocgen:latest
DSE_PLANTUML_IMAGE ?= dse-plantuml:latest


###############
## Document Modules

# File "_index.md"
define _INDEX_MD_FILE =
---
title: "DSE Network API Reference"
linkTitle: "Network"
weight: 800
---

## DSE Network API Reference
endef
export _INDEX_MD_FILE
DOC_OUTPUT_index := doc/content/apis/network/_index.md

# Module "network"
DOC_INPUT_network := dse/network/network.h
DOC_CDIR_network := dse/network/network.c,dse/network/schedule.c,dse/network/parser.c,dse/network/loader.c,dse/network/engine.c,dse/network/encoder.c,
DOC_OUTPUT_network := doc/content/apis/network/network.md
DOC_LINKTITLE_network := Network
DOC_TITLE_network := "Network API Reference"


# Module "function"
DOC_INPUT_function := dse/network/examples/stub/functions/function.h
DOC_OUTPUT_function := doc/content/apis/examples/functions.md
DOC_CDIR_function := dse/network/examples/stub/functions/counters.c,dse/network/examples/stub/functions/crc.c,dse/network/examples/stub/functions/function.c
DOC_OUTPUT_function := doc/content/apis/network/functions.md
DOC_LINKTITLE_function := Functions
DOC_TITLE_function := "Network Function Examples"
DOC_TITLE_function := "Example Network Function API Reference"


# Targets
DOC_C_MODULES := function
DOC_C_MODULES := network function


.PHONY: index
index:
@cd ..; mkdir -p $$(dirname $(DOC_OUTPUT_index))
@cd ..; echo "$$_INDEX_MD_FILE" > $(DOC_OUTPUT_index)

.PHONY: $(DOC_C_MODULES)
$(DOC_C_MODULES):
Expand All @@ -29,7 +58,7 @@ $(DOC_C_MODULES):
$(DSE_CDOCGEN_IMAGE) \
--input $(DOC_INPUT_$@) \
--output $(DOC_OUTPUT_$@) \
--cdir $$(dirname $(DOC_INPUT_$@)) \
--cdir $(DOC_CDIR_$@) \
--title $(DOC_TITLE_$@) \
--linktitle $(DOC_LINKTITLE_$@)
@cd ../$$(dirname $(DOC_OUTPUT_$@)); docker run -it --rm \
Expand All @@ -39,4 +68,4 @@ $(DOC_C_MODULES):
-tpng $$(basename $(DOC_OUTPUT_$@))

.PHONY: generate
generate: $(DOC_C_MODULES)
generate: index $(DOC_C_MODULES)
7 changes: 0 additions & 7 deletions doc/content/apis/_index.md

This file was deleted.

7 changes: 0 additions & 7 deletions doc/content/apis/examples/_index.md

This file was deleted.

128 changes: 0 additions & 128 deletions doc/content/apis/network.md

This file was deleted.

7 changes: 7 additions & 0 deletions doc/content/apis/network/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "DSE Network API Reference"
linkTitle: "Network"
weight: 800
---

## DSE Network API Reference
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
---
title: Network Function Examples
title: Example Network Function API Reference
linkTitle: Functions
---
## Example Network Functions


Example implementation of Network Functions.



## Typedefs

### InstanceData
Expand Down
130 changes: 130 additions & 0 deletions doc/content/apis/network/network.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
---
title: Network API Reference
linkTitle: Network
---
## Network Model


The Network Model runs a Communication Stack which represents the connection
between Physical Signals and Network Messages.




## Typedefs

### MarshalItem

```c
typedef struct MarshalItem {
NetworkSignal* signal;
NetworkMessage* message;
size_t signal_vector_index;
}
```

### Network

```c
typedef struct Network {
const char* name;
int* doc;
NetworkMessage* messages;
const char* message_lib_path;
const char* function_lib_path;
void* message_lib_handle;
void* function_lib_handle;
MarshalItem* marshal_list;
size_t signal_count;
const char** signal_name;
double* signal_vector;
NetworkScheduleItem* schedule_list;
uint32_t tick;
uint32_t bus_id;
uint32_t node_id;
uint32_t interface_id;
}
```

### NetworkFunction

```c
typedef struct NetworkFunction {
char* name;
int* annotations;
void* data;
NetworkFunctionFunc function;
}
```

### NetworkMessage

```c
typedef struct NetworkMessage {
const char* name;
uint32_t frame_id;
uint8_t frame_type;
NetworkSignal* signals;
const char* container;
uint32_t mux_id;
NetworkSignal* mux_signal;
void* buffer;
size_t buffer_len;
uint8_t cycle_time_ms;
void* payload;
uint8_t payload_len;
uint32_t buffer_checksum;
bool needs_tx;
PackFunc pack_func;
UnpackFunc unpack_func;
bool update_signals;
NetworkFunction* encode_functions;
NetworkFunction* decode_functions;
}
```

### NetworkScheduleItem

```c
typedef struct NetworkScheduleItem {
NetworkMessage* message;
uint32_t alarm;
}
```

### NetworkSignal

```c
typedef struct NetworkSignal {
const char* name;
char* signal_name;
const char* member_type;
unsigned int buffer_offset;
double init_value;
bool internal;
double value;
bool mux_signal;
MarshalItem* mux_mi;
EncodeFuncInt8 encode_func_int8;
EncodeFuncInt16 encode_func_int16;
EncodeFuncInt32 encode_func_int32;
EncodeFuncInt64 encode_func_int64;
EncodeFuncFloat encode_func_float;
EncodeFuncDouble encode_func_double;
DecodeFuncInt8 decode_func_int8;
DecodeFuncInt16 decode_func_int16;
DecodeFuncInt32 decode_func_int32;
DecodeFuncInt64 decode_func_int64;
DecodeFuncFloat decode_func_float;
DecodeFuncDouble decode_func_double;
RangeFuncInt8 range_func_int8;
RangeFuncInt16 range_func_int16;
RangeFuncInt32 range_func_int32;
RangeFuncInt64 range_func_int64;
RangeFuncFloat range_func_float;
RangeFuncDouble range_func_double;
}
```

## Functions

Binary file removed doc/content/architecture/fsil-network-arch.png
Binary file not shown.
Empty file added doc/content/docs/arch/.keep
Empty file.
File renamed without changes
File renamed without changes
Empty file added doc/content/docs/devel/.keep
Empty file.
Loading

0 comments on commit 9eedb1e

Please sign in to comment.