From 5f5423cd763c75920072aef419eb9160f8f4fd48 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 19 Apr 2024 15:21:06 +0200 Subject: WIP more requirements --- docs/Gemfile | 4 + docs/makefile | 6 +- docs/requirements.adoc | 512 +++++++++++++++++++++++++++++++++++++++++++---- docs/share/glossary.adoc | 3 + 4 files changed, 482 insertions(+), 43 deletions(-) diff --git a/docs/Gemfile b/docs/Gemfile index 67cd54a..99f5ca1 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -1,7 +1,11 @@ ruby '~> 3.0' source 'https://rubygems.org' +gem 'json' # required for bibtex + gem 'asciidoctor', '~> 2.0' gem 'asciidoctor-pdf', '~> 2.3' gem 'asciidoctor-bibtex', '~> 0.8.0' +# gem 'asciidoctor-interdoc-reftext', '~> 0.5.2' +gem 'asciidoctor-interdoc-reftext', git: 'https://github.com/lonkaars/asciidoctor-interdoc-reftext' diff --git a/docs/makefile b/docs/makefile index a3f5597..e177f6d 100644 --- a/docs/makefile +++ b/docs/makefile @@ -6,13 +6,17 @@ all: requirements.pdf # PDFDEPS += $(ALL_FONTS) PDFDEPS += ./theme.yml +# uncomment to debug include errors +# ASCIIDOCTOR_ARGS += --trace + ASCIIDOCTOR_ARGS += --require asciidoctor-bibtex ASCIIDOCTOR_ARGS += --require asciidoctor-pdf # ASCIIDOCTOR_ARGS += --require ./plugin/helloworld +ASCIIDOCTOR_ARGS += --require asciidoctor-interdoc-reftext ASCIIDOCTOR_ARGS += --backend pdf ASCIIDOCTOR_ARGS += --attribute pdf-theme=./theme.yml # ASCIIDOCTOR_ARGS += --attribute pdf-fontsdir=./res/font ASCIIDOCTOR_ARGS += --attribute bibtex-file=./share/refs.bib %.pdf: %.adoc $(PDFDEPS) - asciidoctor $(ASCIIDOCTOR_ARGS) $< + bundle exec asciidoctor $(ASCIIDOCTOR_ARGS) $< diff --git a/docs/requirements.adoc b/docs/requirements.adoc index 94b532b..2170484 100644 --- a/docs/requirements.adoc +++ b/docs/requirements.adoc @@ -15,16 +15,16 @@ The priority of specifications is indicated using the MoSCoW method, see |=== | Priority | Description -| Must have +| [[must,M]]<> | Represents essential system requirements. Without these, the system will not function. -| Should have +| [[should,S]]<> | Denotes desirable system features. The system can work without these, but it lacks necessary elements. -| Could have +| [[could,C]]<> | Refers to additional functionalities that can be implemented if there is extra time. -| Won't have +| [[wont,W]]<> | Specifies requirements that will not be implemented in the current version but may be considered in a future release. |=== @@ -112,87 +112,515 @@ describes all functional requirements of the puzzle box. |=== | ID | Pri. | Specification -| 1. | M -| The dimensions of the puzzle box are 30×30×30cm ± 5% (Length × Width × Height). +| 001 | <> | +The dimensions of the puzzle box are 30×30×30cm ± 5% (Length × Width × Height). -| 2. | M -| The puzzle box extends a maximum of 5cm on the sides and the top. +| 002 | <> | +The puzzle box extends a maximum of 5cm on the sides and the top. -| 3. | M -| The puzzle box is flat at the bottom. +| 003 | <> | +The puzzle box is flat at the bottom. -| 4. | M -| The puzzle box has a key switch at the bottom of the NeoTrellis puzzle. +| <> | <> | +[[req:4,R-04]] The puzzle box has a key switch at the bottom of the NeoTrellis puzzle. -| 5. | M -| The puzzle box has an indicator LED at the bottom of the NeoTrellis puzzle. +| <> | <> | +[[req:5,R-05]] The puzzle box has an indicator LED at the bottom of the NeoTrellis puzzle. -| 6. | M -| The indicator LED turns green when the system is on and not charging. +| 006 | <> | +The indicator LED turns green when the system is on and not charging. -| 7. | M -| The indicator LED turns blue when the battery is charging. +| 007 | <> | +The indicator LED turns blue when the battery is charging. -| 8. | M -| The indicator LED turns red when the battery does not have enough capacity for the duration of one game and is not charging. +| 008 | <> | +The indicator LED turns red when the battery does not have enough capacity for the duration of one game and is not charging. -| 9. | M -| The puzzle box has a USB-C port at the bottom of the NeoTrellis puzzle for battery charging. +| 009 | <> | +The puzzle box has a USB-C port at the bottom of the NeoTrellis puzzle for battery charging. -| 10. | M -| The puzzle box has a distance sensor at the bottom to detect if it is lifted. +| 010 | <> | +The puzzle box has a distance sensor at the bottom to detect if it is lifted. -| 11. | M -| The puzzle box main board (PCB on the bottom plate) includes a speaker. +| 011 | <> | +The puzzle box main board (PCB on the bottom plate) includes a speaker. -| 12 | W -| When the puzzle box is lifted, the mainboard speaker emits an alarm sound for at least 10 seconds. It stops only when it has been on a table for another 10 seconds (detected by the distance sensor). +| 012 | <> | +When the puzzle box is lifted, the mainboard speaker emits an alarm sound for at least 10 seconds. It stops only when it has been on a table for another 10 seconds (detected by the distance sensor). -| 13. | W -| When the game is completed, the puzzle box produces a victory sound. +| 013 | <> | +When the game is completed, the puzzle box produces a victory sound. -| 14. | W -| Pressing the "identify" button on the web panel causes the indicator LED to blink. +| 014 | <> | +Pressing the "identify" button on the web panel causes the indicator LED to blink. -| 15. | W -| Pressing the "identify" button on the web panel triggers a sound from the speaker. +| 015 | <> | +Pressing the "identify" button on the web panel triggers a sound from the speaker. -| 16. | W -| The game starts once the scheduler time is reached (refer to section 3.7 - [2]). +| 016 | <> | +The game starts once the scheduler time is reached (refer to section 3.7 - [2]). |=== - === The bomb + +.Puzzle box specifications +[cols="1,1,10"] +|=== +| ID | Pri. | Specification + +| 017 | <> | +The bomb includes a 6-digit 7-segment display for showing the remaining playtime. + +| 018 | <> | +The bomb contains a keypad for entering the disarm code. + +| 019 | <> | +The 6-digit 7-segment display turns off when no game is in progress. + +| 020 | <> | +Once the disarm code is entered on the bomb keypad, the game is complete. + +| 021 | <> | +When the game is finished, the bomb emits a victory sound. + +| 022 | <> | +The timer on the bomb counts down from 60:00:00 to 00:00:00. + +| 023 | <> | +Pressing the "identify" button on the web panel causes the indicator LED to blink. + +| 024 | <> | +Pressing the "identify" button on the web panel triggers a sound from the speaker. + +|=== + === The game + +[cols="1,1,10"] +|=== +| 025 | <> | +The game lasts for 1 hour. + +| 026 | <> | +The game should be solvable within the given playtime, without the player having prior knowledge of the game or its mechanics. + +| 027 | <> | +The puzzles should be easy enough to solve without any prior knowledge of the game or its mechanics. + +| 167 | <> | +A puzzle module can manually be reset at the discretion of the game operator + +| 168 | <> | +A puzzle module can manually be set as solved at the discretion of the game operator + +| 028 | <> | +The disarm code for the bomb consists of 4 digits. + +| 029 | <> | +Once all games are solved, the mainboard PCB displays the disarm code on a red 7-segment 4-digit screen. + +| 030 | <> | +The puzzle box records the playtime of each game. + +| 031 | <> | +The puzzle box features 5 playable puzzles. + +| 032 | <> | +Only one game is active at a time; the other games do not respond to buttons. + +| 033 | <> | +The game always starts with the NeoTrellis puzzle. +|=== + ==== NeoTrellis puzzle + +[cols="1,1,10"] +|=== +| 034 | <> | +There is an 8x8 LED matrix where each LED can display different colors. + +| 035 | <> | +At the start of the puzzle, a pattern is displayed as shown in Figure 4. + +| 036 | <> | +When a button is pressed, the adjacent LEDs and the pressed LED toggle (If an LED is off, it turns on. If an LED is on, it turns off). + +| 037 | <> | +All LEDs in the Neotrellis that are turned on are blue. + +| 038 | <> | +The puzzle is considered solved when all LEDs are turned off, and then the software puzzle starts. +|=== + ==== Software puzzle + +[cols="1,1,10"] +|=== +| 039 | <> | +The software puzzle board has 6 banana plug connectors with different logic gates displayed next to them (Refer to Figure 5 for a sketch and Figure 7 for a banana plug example). + +| 040 | <> | +The software puzzle board has 6 banana plug connectors labeled with the letters A through F (Refer to Figure 5 for a sketch). + +| 041 | <> | +At the start of the puzzle box game, the preparer must connect all cables in parallel (horizontally) to the connectors. + +| 042 | <> | +There are C code blocks visible only to the players on the bomb side, corresponding to the letters A through F (Refer to Figure 6 for the codes). + +| 043 | <> | +The combinations of logic gates to letters are always the same. + +| 044 | <> | +The puzzle is considered solved when the cables from the logic gates match the code blocks (Refer to Figure 5 and Figure 6 for the combinations). + +| 045 | <> | +Once the puzzle is solved, the green indicator LED will light up (Refer to Figure 5 and Figure 6). + +| 046 | <> | +After the puzzle is solved, the automation puzzle begins. +|=== + ==== Automation puzzle + +[cols="1,1,10"] +|=== +| 047 | <> | +After the puzzle is solved, the hardware puzzle begins. +|=== + ==== Hardware puzzle + +[cols="1,1,10"] +|=== +| 048 | <> | +There are eight switches on the hardware puzzle board. + +| 049 | <> | +The hardware puzzle board features a diagram of a combinatorial circuit with 8 inputs (linked to the switches) and 1 output (Refer to Figure 8 for a sketch). + +| 050 | <> | +The hardware puzzle board includes a red 7-segment 4-digit display (Refer to Figure 8 for a sketch). + +| 051 | <> | +There are 4 potentiometers on the hardware puzzle board (Refer to Figure 8 for a sketch). + +| 052 | <> | +A blue LED on the hardware puzzle board displays the morse code. + +| 053 | <> | +A green LED on the hardware puzzle board indicates whether the combinatorial circuit is solved. + +| 054 | <> | +At the start of the puzzle, the potentiometers are inactive. + +| 055 | <> | +The 7-segment display is off at the beginning of the puzzle. + +| 056 | <> | +The LED for the combinatorial puzzle is off initially. + +| 057 | <> | +The morse code LED is off at the puzzle's outset. + +| 058 | <> | +The preparer must set all switches to the down position at the start of the puzzle box game. + +| 059 | <> | +The preparer must turn all potentiometers to the left (value '0') at the beginning of the puzzle box game. + +| 060 | <> | +The puzzle consists of two phases. + +| 061 | <> | +The puzzle begins in phase 1. + +| 062 | <> | +During the puzzle, the switches must be toggled to obtain a logical '1' at the output of the combinatorial circuit. + +| 063 | <> | +When the output of the combinatorial circuit equals '1', the green indicator LED turns on (Refer to Figure 8 for a sketch). + +| 064 | <> | +The puzzle proceeds to phase 2 when the output of the combinatorial circuit is a logical '1'. + +| 065 | <> | +The switches no longer respond once the puzzle enters phase 2. + +| 066 | <> | +The indicator LED from phase 1 remains green during phase 2. + +| 067 | <> | +In phase 2, a morse code is displayed using an LED. This morse code represents 4 numbers from 0 to 9 and repeats every second. + +| 068 | <> | +The morse code is randomly generated. + +| 069 | <> | +Each potentiometer can be rotated to display a value from 0 to 9 on the corresponding 4-digit 7-segment display. The order of the potentiometers matches the order of the segments on the display (Refer to Figure 8 for a sketch). + +| 070 | <> | +The puzzle is considered solved when the code displayed on the 7-segment 4-digit screen matches the 4 numbers from the morse code. + +| 071 | <> | +Once the puzzle is solved, the value shown on the 7-segment 4-digit display cannot be changed. + +| 072 | <> | +A 2-second victory sound is produced by the speaker upon solving the puzzle. + +| 073 | <> | +During the victory sound, the 7-segment display blinks twice per second. + +| 074 | <> | +After the victory sound, the puzzle has been solved and the vault puzzle begins. +|=== + ==== Vault puzzle + +[cols="1,1,10"] +|=== +| 075 | <> | +The vault puzzle board features a red 7-segment 4-digit display. + +| 076 | <> | +On the vault puzzle board, there is a 4x4 grid of holes for ventilation and sound. + +| 077 | <> | +The vault puzzle board includes a vault door, and the inside of the vault is transparent, allowing you to see inside the puzzle box. + +| 078 | <> | +A sensor is integrated with the vault to detect when the vault is closed. + +| 079 | <> | +At the beginning of the puzzle box game, the preparer must close the vault. + +| 080 | <> | +The puzzle starts at level 1. + +| 081 | <> | +Initially, the 7-segment display shows a code consisting of a letter and a digit. This code represents a valid key combination for level 1 (Refer to Figure 9 for all combinations). + +| 082 | <> | +There are a total of 5 levels. After each level, a key combination is displayed, starting with a letter followed by a digit, which is valid for that level (Refer to Figure 9). + +| 083 | <> | +Each level has unique key combinations for the button locations (Refer to Figure 9). + +| 084 | <> | +Pressing the button corresponding to the letter-digit combinations advances the puzzle to the next level. + +| 085 | <> | +If an incorrect button is pressed, the game resets to level 1. + +| 086 | <> | +An error sound is produced by the speaker when an incorrect button is pressed. + +| 087 | <> | +The 7-segment display blinks when an incorrect button is pressed. + +| 088 | <> | +After completing 5 levels, the puzzle is solved, and the vault opens. +|=== + === Battery + +[cols="1,1,10"] +|=== +| 089 | <> | +The puzzle box is powered by a rechargeable battery. + +| 090 | <> | +The battery lasts for a minimum of 4 hours. + +| 091 | <> | +The battery in the puzzle box can be replaced. +|=== + === Network Communication + +[cols="1,1,10"] +|=== +| 092 | <> | +The puzzle boxes, bombs, and the puzzle box hub must all be able to communicate with each other. + +| 093 | <> | +Communication between two devices in the network must have a range of at least 20 meters in an open field. +|=== + === Framework + +[cols="1,1,10"] +|=== +| 130 | <> | +The main controller and its software do not need to be modified to implement a new puzzle module + +| 131 | <> | +Puzzle modules can be added and removed while the main controller is powered on + +| 132 | <> | +Puzzle modules can be added and removed while the main controller is powered off + +| 133 | <> | +The puzzle box provides a single external interface for accessing and controlling game state variables +|=== + === Puzzle box hub +[cols="1,1,10"] +|=== +| 094 | <> | +The puzzle box hub hosts a website that can be accessed by a device connected to the network. +|=== + [[sec:technical]] == Technical Requirements +The technical specifications describe the specifications that are important for +developers. For example, this could include specific requirements related to +current, voltage, or communication protocols. This chapter outlines all the +technical specifications of the puzzle box. + === Wireless communication + +[cols="1,1,10"] +|=== +| 127 | <> | +The wireless communication between the system controller, bomb, and puzzle box operates over a WiFi mesh or WiFi network. +|=== + === Framework + +[cols="1,1,10"] +|=== +| 128 | <> | +A framework has been created to assist future groups in the development of the puzzle box. + +| 129 | <> | +The framework runs on the main puzzle box controller. + +| 134 | <> | +Puzzle modules are detected by the main controller module. + +| 135 | <> | +Puzzle modules are initialized by the main controller module. + +| 165 | <> | +Puzzle modules repeatedly send 'update' messages to the main controller while their global state is 'uninitialized' +|=== + === Main controller + +[cols="1,1,10"] +|=== +| 136 | <> | +The main controller has at least 1 I2C peripheral. + +| 137 | <> | +The main controller can connect to a standard 802.11b/g/n access point. + +| 138 | <> | +The main controller can serve TCP socket connection(s). + +| 139 | <> | +The main controller is available as a development kit from Farnell. + +| 140 | <> | +The main controller can communicate over I²C with a speed of 400kb/s + +| 166 | <> | +The main controller is power efficient. +|=== + === Puzzle module controller + +[cols="1,1,10"] +|=== +| 141 | <> | +The puzzle module controller has at least 1 I2C peripheral. + +| 142 | <> | +The puzzle module controller has enough I/O ports to control a puzzle. + +| 143 | <> | +The puzzle module is power efficient. + +| 144 | <> | +The puzzle module has a configurable clock speed. + +| 145 | <> | +The puzzle module controller is available as a development kit from Farnell. + +| 146 | <> | +The puzzle module can communicate over I²C with a speed of 400kb/s +|=== + === Vault puzzle + +[cols="1,1,10"] +|=== +| 147 | <> | +The vault puzzle can communicate with the main controller using I²C + +| 148 | <> | +The vault puzzle can produce a sound signal for the buzzer + +| 149 | <> | +The vault puzzle can lock & unlock a solenoid lock + +| 150 | <> | +The vault puzzle can translate and obtain a button press from the 3x4 keypad using 5 inputs + +| 151 | <> | +The vault puzzle can communicate with a 4x 7 SEG. Display using 2 lines (clock & data) + +| 152 | <> | +The vault puzzle can read a sensor's value to detect if the vault door is open or closed. +|=== + === Bomb + +[cols="1,1,10"] +|=== +| 153 | <> | +The bomb can communicate with the hub using a TCP socket connection + +| 154 | <> | +The bomb can sync. time using the WiFi connection + +| 155 | <> | +The bomb can retrieve, and store a given code in order to verify it later on input + +| 156 | <> | +The bomb can be paired to a puzzlebox using the hub's interface +|=== + == Preconditions + +[cols="1,11"] +|=== +| 160 | The delivery of components cannot take longer than two weeks. +| 161 | The price of a single puzzle box is not higher than €150. +| 162 | The existing games are used in the puzzle box. +| 163 | The puzzle box is not allowed to make a connection with the Avans network (Eduroam). +| 164 | The bomb hardware cannot be changed. +|=== + == Documentation +[cols="1,1,10"] +|=== +| 157 | <> | +All documentation is written according to the style guide [3] + +| 158 | <> | +All documentation is manually checked for spelling and grammar mistakes before being published + +| 159 | <> | +All project documents are examined once by Jonathan Overes from Avans +|=== + [appendix] == Explanatory Images -// [#alinea1,reftext='alinea 1'] -// Hoi ik ben een alinea -// -// <> - include::share/footer.adoc[] diff --git a/docs/share/glossary.adoc b/docs/share/glossary.adoc index 5ba8340..b0192a0 100644 --- a/docs/share/glossary.adoc +++ b/docs/share/glossary.adoc @@ -3,4 +3,7 @@ [glossary] RPI:: Raspberry Pi +Main board:: The main board is the PCB on the bottom of the puzzle box, this communicates with the puzzles and the bomb +Puzzle box hub:: The puzzle box hub communicates with the puzzle box and the bomb, as well as helps with configuring them +SID:: security identifiers -- cgit v1.2.3