diff --git a/HighLevelAnalyzer.py b/HighLevelAnalyzer.py index 1bd85c7..8018aa1 100644 --- a/HighLevelAnalyzer.py +++ b/HighLevelAnalyzer.py @@ -13,12 +13,6 @@ # High level analyzers must subclass the HighLevelAnalyzer class. class Hla(HighLevelAnalyzer): - # List of settings that a user can set for this High Level Analyzer. - # my_string_setting = StringSetting() - # my_number_setting = NumberSetting(min_value=0, max_value=100) - # my_choices_setting = ChoicesSetting(choices=('A', 'B')) - - # An optional list of types this analyzer produces, providing a way to customize the way frames are displayed in Logic 2. result_types = { "gtl": { "format": "Message ID: {{data.MSG_ID}}({{data.MSG_ID_decoded}}), Dest ID: {{data.DST_ID}}, Source ID: {{data.SRC_ID}}, Parameter length: {{data.PAR_LEN}}, Data: {{data.data}}" @@ -42,11 +36,6 @@ def __init__(self): print("Dialog Semiconductor GTL interface decoder") def decode(self, frame: AnalyzerFrame): - """ - Process a frame from the input analyzer, and optionally return a single `AnalyzerFrame` or a list of `AnalyzerFrame`s. - - The type and data values in `frame` will depend on the input analyzer. - """ return_packet = False try: if ( @@ -136,9 +125,7 @@ def decode(self, frame: AnalyzerFrame): sup_to = str( (self.receiveBuffer[16] << 8 | self.receiveBuffer[15]) * 10 ) # Extract the supervision timeout from the message - addr_type = self.receiveBuffer[ - 18 - ] # Extract the address type from the message + addr_type = self.receiveBuffer[18] # Extract the address type from the message if addr_type == 0: addr_type = "public" else: @@ -167,8 +154,7 @@ def decode(self, frame: AnalyzerFrame): (self.receiveBuffer[10] << 8 | self.receiveBuffer[9]) * 1.25 ) # Extract the min connection interval from the message con_interval_max = str( - (self.receiveBuffer[12] << 8 | self.receiveBuffer[11]) - * 1.25 + (self.receiveBuffer[12] << 8 | self.receiveBuffer[11]) * 1.25 ) # Extract the max connection interval from the message con_latency = str( self.receiveBuffer[14] << 8 | self.receiveBuffer[13] diff --git a/README.md b/README.md index 195c0fc..1d36338 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,16 @@ - # GTL decode + # GTL interface decoder -## Getting started - -1. Build your extension by updating the Python files for your needs -2. Create a public Github repo and push your code -3. Update this README -4. Open the Logic app and publish your extension -5. Create a Github release -6. Debug your hardware like you've never done before :) +![Screenshot of the decoder working](assets/screenshot.png) + +## Installation + +Open the extensions tab in Saleae logic 2, 'GTL interface decoder' should be in the list. If it isn't you can click the three dots and check for updates. + +You can also clone this repo, click the three dots under extentions, click 'Load existing extention' and select the json file from this repo in the window that pops up. + +## Usage + +This analyzer can be added like any other analyzer, it only has one input. That should be set to the UART that communicates the GTL commands. As GTL usually has bidirectional communication another analyzer can be added for the second UART line. \ No newline at end of file diff --git a/assets/screenshot.png b/assets/screenshot.png new file mode 100644 index 0000000..8d0187f Binary files /dev/null and b/assets/screenshot.png differ diff --git a/extension.json b/extension.json index dbe4f86..f84b2f9 100644 --- a/extension.json +++ b/extension.json @@ -1,9 +1,9 @@ { - "name": "GTL decode", + "name": "GTL interface decoder", "apiVersion": "1.0.0", "author": "Dialog Semiconductor", - "version": "0.0.1", - "description": "", + "version": "1.0.0", + "description": "Dialog GTL interface decoder", "extensions": { "GTL decode": { "type": "HighLevelAnalyzer",