Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #16 from obastemur/false_fix
Browse files Browse the repository at this point in the history
improvements and bug fixes
  • Loading branch information
obastemur authored Jul 16, 2018
2 parents 8bde679 + 9760678 commit 4e9c466
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 27 deletions.
12 changes: 0 additions & 12 deletions AZ3166/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion AZ3166/inc/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct Globals
#define IOT_CENTRAL_MAX_LEN STRING_BUFFER_128
#define AZIOTC_FW_MAJOR_VERSION 1
#define AZIOTC_FW_MINOR_VERSION 4
#define AZIOTC_FW_PATCH_VERSION 1
#define AZIOTC_FW_PATCH_VERSION 2
#define AZIOTC_FW_VERSION TO_STRING(AZIOTC_FW_MAJOR_VERSION AZIOTC_FW_MINOR_VERSION AZIOTC_FW_PATCH_VERSION) "-MSIOTC"

#include "definitions.h"
Expand Down
7 changes: 0 additions & 7 deletions AZ3166/iotc.json

This file was deleted.

3 changes: 1 addition & 2 deletions AZ3166/iotz.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"name": "iot central firmware example for AZ3166",
"toolchain": "arduino",
"target": "AZ3166:stm32f4:MXCHIP_AZ3166",
"filename": "iotCentral.ino",
"has_libs": false
"filename": "iotCentral.ino"
}
6 changes: 5 additions & 1 deletion AZ3166/src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ void ConfigController::storeWiFi(AutoString &ssid, AutoString &password) {
EEPROMInterface eeprom;

eeprom.write((uint8_t*) *ssid, ssid.getLength(), WIFI_SSID_ZONE_IDX);
eeprom.write((uint8_t*) *password, password.getLength(), WIFI_PWD_ZONE_IDX);
if (password.getLength()) {
eeprom.write((uint8_t*) *password, password.getLength(), WIFI_PWD_ZONE_IDX);
} else {
eeprom.write((uint8_t*) "", 0, WIFI_PWD_ZONE_IDX);
}
}

void ConfigController::storeConnectionString(AutoString &connectionString) {
Expand Down
6 changes: 3 additions & 3 deletions AZ3166/src/onboarding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ void OnboardingController::processResultRequest(WiFiClient &client, String &requ
pch = strtok(NULL, "&");
}

if (ssid.getLength() == 0 || password.getLength() == 0 || connStr.getLength() == 0) {
LOG_ERROR("Missing ssid, password or connStr. Responsed with START page");
if (ssid.getLength() == 0 || connStr.getLength() == 0) {
LOG_ERROR("Missing ssid or connStr. Responsed with START page");
processStartRequest(client);
return;
} else if (!pincodePasses) {
Expand All @@ -254,7 +254,7 @@ void OnboardingController::processResultRequest(WiFiClient &client, String &requ
}

// store the settings in EEPROM
assert(ssid.getLength() != 0 && password.getLength() != 0);
assert(ssid.getLength() != 0);
ConfigController::storeWiFi(ssid, password);

assert(connStr.getLength() != 0);
Expand Down
2 changes: 1 addition & 1 deletion AZ3166/src/telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void TelemetryController::loop() {

// SEND EVENT example
// build the event payload
const char * eventString = "{\"ButtonBPressed\": 1}";
const char * eventString = "{\"ButtonBPressed\": \"occurred\"}";
if (iothubClient->sendTelemetry(eventString)) {
LOG_VERBOSE("Event successfully sent");
StatsController::incrementReportedCount();
Expand Down

0 comments on commit 4e9c466

Please sign in to comment.