-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DeviceInfo i2cscanner #88
base: main
Are you sure you want to change the base?
Conversation
DeviceInfo I2C scanner
added include library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix cpplint issues:
src/supla/network/html/i2cscanner.h:19: #ifndef header guard has wrong style, please use: SRC_SUPLA_NETWORK_HTML_I2CSCANNER_H_ [build/header_guard] [5]
src/supla/network/html/i2cscanner.h:53: #endif line should be "#endif // SRC_SUPLA_NETWORK_HTML_I2CSCANNER_H_" [build/header_guard] [5]
src/supla/network/html/i2cscanner.h:34: Missing space before ( in for( [whitespace/parens] [5]
src/supla/network/html/i2cscanner.h:34: Mismatching spaces inside () in for [whitespace/parens] [5]
src/supla/network/html/i2cscanner.h:40: Never use sprintf. Use snprintf instead. [runtime/printf] [5]
src/supla/network/html/i2cscanner.h:47: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3]
src/supla/network/html/i2cscanner.h:48: At least two spaces is best between code and comments [whitespace/comments] [2]
src/supla/network/html/i2cscanner.h:50: At least two spaces is best between code and comments [whitespace/comments] [2]
src/supla/network/html/i2cscanner.h:51: At least two spaces is best between code and comments [whitespace/comments] [2]
src/supla/network/html/i2cscanner.h
Outdated
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License898 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove 898 from the end of this line
src/supla/network/html/i2cscanner.h
Outdated
void send(Supla::WebSender* sender) { | ||
sender->send("<span>"); | ||
sender->send("<br>I2C: "); | ||
for(byte address = 1; address < 127; address++ ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use "uint8_t" instead of "byte" ( include <stdint.h>)
src/supla/network/html/i2cscanner.h
Outdated
char buffer[2]; | ||
if (error == 0) { | ||
sender->send("0x"); | ||
sprintf(buffer, "%2x", address); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use snprintf instead. Current version will add 3 charcters to buffer which size is only 2 B.
namespace Supla { | ||
namespace Html { | ||
|
||
class I2Cscanner : public Supla::HtmlElement { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a description what is this class doing in Doxygen format
src/supla/network/html/i2cscanner.h
Outdated
}; // namespace Html | ||
}; // namespace Supla |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove not needed ;
DeviceInfo I2C scanner for WebInterface
list addresses of all detected i2c devices