Skip to content

Commit f58f2e6

Browse files
committed
disconnection fixes and led fixes
1 parent 5d925c3 commit f58f2e6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Apps/App_Dweet.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void App_DweetConnector(void)
132132
char* animationIndex = animation;
133133

134134
while(1) {
135-
if (!AtLibGs_IsNodeAssociated()) {
135+
if (!AtLibGs_IsNodeAssociated() || !connected) {
136136
DisplayLCD(LCD_LINE8, "connecting.......");
137137
App_aClientConnection();
138138
AtLibGs_SetNodeAssociationFlag();
@@ -170,8 +170,10 @@ void App_DweetConnector(void)
170170
MSTimerDelay(500);
171171
}
172172

173-
AtLibGs_Close(cid);
173+
//AtLibGs_Close(cid);
174+
AtLibsGs_CloseAll();
174175
cid = ATLIBGS_INVALID_CID;
176+
AtLibGs_ClearNodeAssociationFlag();
175177
DisplayLCD(LCD_LINE8, "connecting.......");
176178
MSTimerDelay(5000); //TODO - exponential backoff
177179
}
@@ -266,10 +268,10 @@ ATLIBGS_MSG_ID_E checkData(uint8_t* cid)
266268
val = atoi(body+tokens[ledUpdate].start+3);
267269
if (body[tokens[ledUpdate+1].start] == 't') {
268270
ConsolePrintf("LED %d ON\n", val);
269-
led_on(val);
271+
led_on(val-3);
270272
} else {
271273
ConsolePrintf("LED %d OFF\n", val);
272-
led_off(val);
274+
led_off(val-3);
273275
}
274276
}
275277
}

0 commit comments

Comments
 (0)