![](/media/cache/profiles/37f5bdb3a2a1159584d0a30e9a1e71bf.jpg.50x50_q85.jpg)
Change to wifi AP mode. SSID "GR-PEACH_1", PSK "12345"
Dependencies: DhcpServer EthernetInterface FATFileSystem GR-PEACH_WlanBP3595AP GR-PEACH_video GraphicsFramework HttpServer_snapshot R_BSP mbed-rpc mbed-rtos mbed
Fork of GR-Boards_WebCamera by
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); + } } } }