Skip to content

Commit dd30e76

Browse files
authored
Fix student review feedback for #4101 (#4584)
1 parent e7345da commit dd30e76

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/reference/gds-plugins/data-handler.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Data Handler plugins are `FEATURE` plugins. All will run unless individually di
1111

1212
## Usage
1313

14-
To use a Data Handler plugin, implement the `data_callback()` method, which is invoked whenever a matching decoded data item is received. You can register for specific descriptor types by returning them in the `get_descriptor()` method.
14+
To use a Data Handler plugin, implement the `data_callback()` method, which is invoked whenever a matching decoded data item is received. You can register for specific descriptor types by returning them in the `get_handled_descriptors()` method.
1515

1616
Typical use cases include:
1717

@@ -45,18 +45,19 @@ To create a Data Handler plugin, subclass the [`DataHandlerPlugin`](https://gith
4545

4646
```python
4747
from fprime_gds.common.handlers import DataHandlerPlugin
48-
from fprime_gds.common.plugins import gds_plugin
48+
from fprime_gds.plugin.definitions import gds_plugin
4949

5050
@gds_plugin(DataHandlerPlugin)
5151
class EventLogger(DataHandlerPlugin):
5252
"""Logs all event data to a file."""
5353

54-
def get_descriptor(self):
54+
def get_handled_descriptors(self):
5555
return ["FW_PACKET_LOG"]
5656

5757
def data_callback(self, data, source):
58+
value_object = data.get_val_obj()
5859
with open("event_log.txt", "a") as f:
59-
f.write(f"{data}\n")
60+
f.write(f"{value_object.val}\n")
6061
```
6162

6263
This plugin will be called for every decoded event received by the system.

0 commit comments

Comments
 (0)