Skip to content

Commit

Permalink
Call published event after subscribe, resolved #12
Browse files Browse the repository at this point in the history
  • Loading branch information
tuanpmt committed Jan 4, 2015
1 parent f837152 commit 34a3ea4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,11 @@ void MQTT_Publish( MQTT_Client *client,
```

**Default configuration**

See: *include/user_config.h* and *include/config.c*

If you want to load new default configurations, just change the value of CFG_HOLDER in ***include/user_config.h***

Now in the Makefile, it will erase section hold the user configuration at 0x3C000

```bash
Expand Down
5 changes: 3 additions & 2 deletions user/mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ mqtt_tcpclient_recv(void *arg, char *pdata, unsigned short len)

} else {
INFO("MQTT: Connected to %s:%d\r\n", client->host, client->port);
if(client->connectedCb)
client->connectedCb((uint32_t*)client);

client->connState = MQTT_SUBSCIBE_SEND;
}
break;
Expand All @@ -185,6 +184,8 @@ mqtt_tcpclient_recv(void *arg, char *pdata, unsigned short len)
} else {
if(QUEUE_IsEmpty(&client->topicQueue)){
client->connState = MQTT_DATA;
if(client->connectedCb)
client->connectedCb((uint32_t*)client);
} else {
client->connState = MQTT_SUBSCIBE_SEND;
}
Expand Down

0 comments on commit 34a3ea4

Please sign in to comment.