Web Camera for mbed-os. When you use this program, we judge you have agreed to the following contents. https://developer.mbed.org/teams/Renesas/wiki/About-LICENSE
Dependencies: HttpServer_snapshot_mbed-os LWIPBP3595Interface_STA_for_mbed-os RomRamBlockDevice mbed-rpc
Fork of GR-Boards_WebCamera by
このサンプルは 「GR-LYCHEE」ではじめる電子工作 で紹介しています。
出版時と内容が異ならないよう、各ライブラリはアップデートせずに使用してください。
このサンプルの最新バージョンは下記から入手できます。最新バージョンは本の内容と一部処理が異なります。
https://github.com/d-kato/GR-Boards_WebCamera
Diff: main.cpp
- Revision:
- 10:3a176dc33f74
- Parent:
- 9:2e3ccd27b4f9
- Child:
- 11:ad8ff26679bb
--- a/main.cpp Tue Dec 15 08:13:55 2015 +0000 +++ b/main.cpp Wed Jan 27 09:05:19 2016 +0000 @@ -312,11 +312,27 @@ } static void SetI2CfromWeb(Arguments* arg, Reply* r) { - if (*(arg->argv[0]) != 0) { - sprintf(i2c_setting_str_buf, "%s,%s", arg->argv[0], arg->argv[1]); + int result = 0; + + if (arg != NULL) { + if (arg->argc >= 2) { + if ((arg->argv[0] != NULL) && (arg->argv[1] != NULL)) { + sprintf(i2c_setting_str_buf, "%s,%s", arg->argv[0], arg->argv[1]); + result = 1; + } + } else if (arg->argc == 1) { + if (arg->argv[0] != NULL) { + sprintf(i2c_setting_str_buf, "%s", arg->argv[0]); + result = 1; + } + } else { + /* Do nothing */ + } /* command analysis and execute */ - if (i2c_setting_exe(i2c_setting_str_buf) != false) { - r->putData<const char*>(i2c_setting_str_buf); + if (result != 0) { + if (i2c_setting_exe(i2c_setting_str_buf) != false) { + r->putData<const char*>(i2c_setting_str_buf); + } } } }