Skip to content

Commit

Permalink
Added an introduction, reformatted .tex files and fixed spelling errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
linguini1 committed Oct 27, 2023
1 parent 172e5a7 commit 15c3441
Show file tree
Hide file tree
Showing 4 changed files with 191 additions and 223 deletions.
99 changes: 44 additions & 55 deletions data-logging-format/data_logging_format.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
\usepackage[hidelinks,bookmarksnumbered]{hyperref}
\usepackage[all]{hypcap}
\usepackage{fancyhdr}
%\usepackage{sectsty}
\usepackage[calcwidth]{titlesec}
\usepackage{chngcntr}
\usepackage{bytefield}
Expand All @@ -18,7 +17,7 @@
\usepackage{amsmath}

\title{CU InSpace Data Logging Format}
\author{Samuel Dewan}
\author{Samuel Dewan \\ Matteo Golin}

% Headers and footers
\pagestyle{fancy}
Expand Down Expand Up @@ -54,76 +53,67 @@
\makebox[0pt][r]{#1\hspace{6pt}}%
}
\titleformat{\section}
{\sffamily\Large\bfseries}
{\marginsecnumber\thesection}
{0pt}
{}
{\sffamily\Large\bfseries}
{\marginsecnumber\thesection}
{0pt}
{}
\titleformat{\subsection}
{\sffamily\large\bfseries}
{\marginsecnumber\thesubsection}
{0pt}
{}
{\sffamily\large\bfseries}
{\marginsecnumber\thesubsection}
{0pt}
{}
\titleformat{\subsubsection}
{\sffamily\normalsize\bfseries}
{\marginsecnumber\thesubsubsection}
{0pt}
{}

% Draft watermark
\usepackage{eso-pic,graphicx}
\AddToShipoutPicture*{%
\AtTextCenter{%
\makebox(0,0)[c]{\resizebox{\textwidth}{!}{%
\rotatebox{45}{\textsf{\textbf{\color{lightgray}DRAFT}}}}}
}
}
{\sffamily\normalsize\bfseries}
{\marginsecnumber\thesubsubsection}
{0pt}
{}

% Coloured skipped words command for bytefields
\makeatletter
\DeclareRobustCommand{\cskippedwords}[2][2ex]{%
\setlength{\units@wide}{\bf@bitwidth * \bits@wide}%
\setlength{\units@high}{1pt * \ratio{\units@wide}{6.0pt}}%
\setlength{\units@tall}{#1 + \units@high}%
\edef\num@wide{\strip@pt\units@wide}%
\edef\num@tall{\strip@pt\units@tall}%
\edef\num@high{\strip@pt\units@high}%
\begin{picture}(\num@wide,\num@tall)%
\begin{tikzpicture}[overlay]
\draw[fill=#2,fill opacity=0.2]
(0,-\bf@bitheight) -- (0,0) -- (0,\units@high) -- (\units@wide,0) -- +(0,-\bf@bitheight) -- cycle;
\draw[fill=#2,fill opacity=0.2]
(0,\units@high+#1+\bf@bitheight) -- ++(\units@wide,0) -- ++(0,-\bf@bitheight-\units@high) -- (0,\units@high+#1) -- cycle;
\end{tikzpicture}%
\end{picture}%
\ifcounting@words
\inc@bytefield@height{\unitlength * \real{\num@tall}}%
\global\counting@wordsfalse
\fi}
\setlength{\units@wide}{\bf@bitwidth * \bits@wide}%
\setlength{\units@high}{1pt * \ratio{\units@wide}{6.0pt}}%
\setlength{\units@tall}{#1 + \units@high}%
\edef\num@wide{\strip@pt\units@wide}%
\edef\num@tall{\strip@pt\units@tall}%
\edef\num@high{\strip@pt\units@high}%
\begin{picture}(\num@wide,\num@tall)%
\begin{tikzpicture}[overlay]
\draw[fill=#2,fill opacity=0.2]
(0,-\bf@bitheight) -- (0,0) -- (0,\units@high) -- (\units@wide,0) -- +(0,-\bf@bitheight) -- cycle;
\draw[fill=#2,fill opacity=0.2]
(0,\units@high+#1+\bf@bitheight) -- ++(\units@wide,0) -- ++(0,-\bf@bitheight-\units@high) -- (0,\units@high+#1) -- cycle;
\end{tikzpicture}%
\end{picture}%
\ifcounting@words
\inc@bytefield@height{\unitlength * \real{\num@tall}}%
\global\counting@wordsfalse
\fi}
\makeatother


\begin{document}
\frenchspacing

\pagenumbering{Alph}
\begin{titlepage}
\centering
\centering

\vspace*{\stretch{2}}
{\large \textbf{CU InSpace}}
\vspace*{\stretch{2}}
{\large \textbf{CU InSpace}}

\vspace{\stretch{1}}
{\Huge \sffamily Data Logging Format}
\vspace{\stretch{1}}
{\Huge \sffamily Data Logging Format}

\vspace{\stretch{1}}
{\large \textbf{\today}}
\vspace{\stretch{1}}
{\large \textbf{\today}}

\vspace{\stretch{1}}
Samuel Dewan
\vspace{\stretch{1}}
Samuel Dewan \\
Matteo Golin

\vspace{\stretch{4}}
\includegraphics[width=0.5\textwidth]{logo.png}
\vspace{\stretch{5}}
\vspace{\stretch{4}}
\includegraphics[width=0.5\textwidth]{logo.png}
\vspace{\stretch{5}}

\end{titlepage}

Expand All @@ -147,5 +137,4 @@ \section{Block Formats}
\input{sections/block-formats.tex}
\clearpage


\end{document}
99 changes: 41 additions & 58 deletions data-logging-format/sections/block-formats.tex
Original file line number Diff line number Diff line change
@@ -1,86 +1,69 @@
\subsection{Logging Metadata Blocks}
\label{subsec:logging-metadata-blocks}

Logging metadata blocks are used to store metadata generated by the logging
system and information required in order to correctly parse the logged data.
Logging metadata blocks are used to store metadata generated by the logging system and information required in order to
correctly parse the logged data.

The block types within the Logging Metadata class are described in table
\ref{table:logging-metadata-types}.
The block types within the Logging Metadata class are described in table \ref{table:logging-metadata-types}.

\begin{table*}[htb]
\centering
\begin{tabular}{@{}ll@{}}
\toprule
Data Type & Description \\
\midrule
0x0 & Spacer block \\
0x1 through 0x3FF & Reserved for future use \\
\bottomrule
\end{tabular}
\caption{Logging metadata block types}
\label{table:logging-metadata-types}
\centering
\begin{tabular}{@{}ll@{}}
\toprule
Data Type & Description \\
\midrule
0x0 & Spacer block \\
0x1 through 0x3FF & Reserved for future use \\
\bottomrule
\end{tabular}
\caption{Logging metadata block types}
\label{table:logging-metadata-types}
\end{table*}

\subsubsection{Spacer Block}

Spacer blocks are used when writing telemetry data to indicate a region that
does not contain any valid data. When telemetry is being written one SD card
block at a time without the ability to have telemetry data overflow from one
block into another, a spacer block can be used at the end of the SD card block
to take up any excess bytes.

When parsing, spacer blocks should always be skiped using the length field in
the block header and no attempt should be made to parse a spacer block's
payload.


Spacer blocks are used when writing telemetry data to indicate a region that does not contain any valid data. When
telemetry is being written one SD card block at a time without the ability to have telemetry data overflow from one
block into another, a spacer block can be used at the end of the SD card block to take up any excess bytes.

When parsing, spacer blocks should always be skipped using the length field in the block header and no attempt should
be made to parse a spacer block's payload.

\subsection{Telemetry Data Blocks}
\label{subsec:telemetry-data-blocks}

Data blocks of the Telemetry class follow the formats specified in the CU
InSpace Radio Packet Format document.
Data blocks of the Telemetry class follow the formats specified in the CU InSpace Radio Packet Format document.

\subsection{Diagnostic Data Blocks}
\label{subsec:diagnostic-data-blocks}

Data blocks with the Diagnostic Data class are used to store information which
is intended to be used for debugging.
Data blocks with the Diagnostic Data class are used to store information which is intended to be used for debugging.

The block types within the Diagnostic Data class are described in table
\ref{table:diagnostic-data-types}.
The block types within the Diagnostic Data class are described in table \ref{table:diagnostic-data-types}.

\begin{table*}[htb]
\centering
\begin{tabular}{@{}ll@{}}
\toprule
Data Type & Description \\
\midrule
0x0 & Log message \\
0x1 & Outgoing radio packet \\
0x2 & Incoming radio packet \\
0x3 through 0x3FF & Reserved for future use \\
\bottomrule
\end{tabular}
\caption{Diagnostic data block types}
\label{table:diagnostic-data-types}
\centering
\begin{tabular}{@{}ll@{}}
\toprule
Data Type & Description \\
\midrule
0x0 & Log message \\
0x1 & Outgoing radio packet \\
0x2 & Incoming radio packet \\
0x3 through 0x3FF & Reserved for future use \\
\bottomrule
\end{tabular}
\caption{Diagnostic data block types}
\label{table:diagnostic-data-types}
\end{table*}

\subsubsection{Log Message}

Log messages are string messages intended to provide human readable debugging
output. They are encoded as UTF-8 strings and do not require a terminating NUL
character because the string length can be extrapolated from the block length.
Log messages are string messages intended to provide human readable debugging output. They are encoded as UTF-8 strings
and do not require a terminating NULL character because the string length can be extrapolated from the block length.
Every log message is preceded by a 32 bit unsigned mission time value.

Note that like all other data blocks log messages must be a multiple of four
bytes long. If the string to be logged is not a multiple of four bytes it must
be padded with NUL characters at the end to make it fit the required alignment.
The length recorded in the block header must be a multiple of four, and
therefore must include any NUL padding bytes at the end of the string.

\subsubsection{Outgoing Radio Packet}

\subsubsection{Incoming Radio Packet}

Note that like all other data blocks log messages must be a multiple of four bytes long. If the string to be logged is
not a multiple of four bytes it must be padded with NULL characters at the end to make it fit the required alignment.
The length recorded in the block header must be a multiple of four, and therefore must include any NULL padding bytes
at the end of the string.
7 changes: 6 additions & 1 deletion data-logging-format/sections/introduction.tex
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
To do.
The following format specification describes how Carleton University InSpace logs telemetry data and diagnostic
information on an SD card from a telemetry device. This format makes use of the CU InSpace radio packet format for
logging telemetry data. This greatly simplifies encoding, and ensures that all outgoing radio messages are recorded in
the case that they are not delivered to the recipient.

This packet format is made publicly available via the GNUGPLv3 license.
Loading

0 comments on commit 15c3441

Please sign in to comment.