adafruit / adafruit/Adafruit_IO_Arduino

Add debug hook to trace feeds

Open
#58 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
222
Forks
109
PR merge metrics
No merged PRs in 30d

Description

Add virtual method to trace feeds
> It would be nice if there was a virtual method that I could override by creating a subclass, where I could print out the name of the feed I had received, and the AdafruitIO_Data object I could display. It would be a convenient debugging hook. The default method would just have an empty body; I could subclass AdafruitIO_Group and override it. - https://forums.adafruit.com/viewtopic.php?f=56&t=139210

Proposed Method:
```
public:
virtual void traceFeed(AdafruitIO_Data * d) {}
```
Implementation
```
class MyAdafruitIO_Group : public AdafruitIO_Group {
public:
virtual void traceFeed(AdafruitIO_data * d) {
Serial.println(d->feedName());
...maybe other stuff
};
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the AdafruitIO_Group class and the code path that receives feeds. Add the proposed traceFeed virtual hook with a default empty body, ensure subclasses can receive the AdafruitIO_Data object, and verify that the hook is called for received feeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.