summaryrefslogtreecommitdiff
path: root/HACKING
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2019-12-30 16:31:25 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2019-12-31 17:40:16 +0100
commit1734f4c263201ae4b3aeab6b9ffc7f0eb23fdffd (patch)
tree2406e54c67e1778c918306df9d05c69abbb76907 /HACKING
parentb7d7e99011eb2a4bfd493bfca2f386ad9916a6a2 (diff)
downloadlibsigrokdecode-1734f4c263201ae4b3aeab6b9ffc7f0eb23fdffd.tar.gz
libsigrokdecode-1734f4c263201ae4b3aeab6b9ffc7f0eb23fdffd.zip
srd_decoder_load(): Error out upon various duplicate IDs.
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING13
1 files changed, 13 insertions, 0 deletions
diff --git a/HACKING b/HACKING
index c5f24f5..9f2f143 100644
--- a/HACKING
+++ b/HACKING
@@ -150,6 +150,19 @@ Protocol decoder guidelines
protocol decoder, e.g., UART) via "sigrok-cli -P uart --show", or in various
other places in GUIs.
+ - Input IDs, output IDs, tags, channel IDs, option IDs, annotation class IDs,
+ annotation row IDs, and binary class IDs each must be unique.
+
+ - Annotation class IDs must not overlap with annotation row IDs.
+ For example, you cannot have an annotation row named "foo" if you already
+ have an annotation class named "foo". This avoids confusion for users
+ and simplifies e.g. command-line usage of decoders.
+
+ - Annotation class IDs should generally be singular, annotation row IDs
+ should generally be plural. Example: UART annotation classes could be
+ named "stop-bit" or "parity-bit" (singular), the annotation row containing
+ these annotation classes could be named "bits" (plural).
+
- Generally use strings for states (of the PD state machine), not integers.
This avoids having to keep a list of state definitions at the top of file.
The performance overhead for this is negligible in practice.