and the content of the conf file matched with the sample program


Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2018-07-31 06:57:13 +09:00
parent 79f6aef8e4
commit e942ee451d
9 changed files with 29 additions and 15 deletions

View File

@@ -52,10 +52,10 @@ extern LScreen* theScreen;
* UDP Configuration (theNetcon) * UDP Configuration (theNetcon)
*------------------------------------------------------*/ *------------------------------------------------------*/
UDPCONF = { UDPCONF = {
"GatewayTestPubClient", // ClientId "ClientPUB", // ClientId
{225,1,1,1}, // Multicast group IP {225,1,1,1}, // Multicast group IP
1883, // Multicast group Port 1883, // Multicast group Port
20001, // Local PortNo 20010, // Local PortNo
}; };
/*------------------------------------------------------ /*------------------------------------------------------
@@ -159,7 +159,7 @@ TASK_LIST = {// e.g. TASK( task, executing duration in second),
*------------------------------------------------------*/ *------------------------------------------------------*/
void setup(void) void setup(void)
{ {
SetForwarderMode(false);
} }

View File

@@ -52,7 +52,7 @@ extern LScreen* theScreen;
* UDP Configuration (theNetcon) * UDP Configuration (theNetcon)
*------------------------------------------------------*/ *------------------------------------------------------*/
UDPCONF = { UDPCONF = {
"GatewayTestPubClient", // ClientId "QoS-1_Client01", // ClientId
{225,1,1,1}, // Multicast group IP {225,1,1,1}, // Multicast group IP
1883, // Multicast group Port 1883, // Multicast group Port
20001, // Local PortNo 20001, // Local PortNo

View File

@@ -52,10 +52,10 @@ extern LScreen* theScreen;
* UDP Configuration (theNetcon) * UDP Configuration (theNetcon)
*------------------------------------------------------*/ *------------------------------------------------------*/
UDPCONF = { UDPCONF = {
"ty4twGatewaySubClient", // ClientId "ClientSUB", // ClientId
{225,1,1,1}, // Multicast group IP {225,1,1,1}, // Multicast group IP
1883, // Multicast group Port 1883, // Multicast group Port
20002, // Local PortNo 20011, // Local PortNo
}; };
/*------------------------------------------------------ /*------------------------------------------------------
@@ -199,7 +199,7 @@ TASK_LIST = {// e.g. TASK( task, executing duration in second),
*------------------------------------------------------*/ *------------------------------------------------------*/
void setup(void) void setup(void)
{ {
SetForwarderMode(false);
} }

View File

@@ -55,7 +55,7 @@ UDPCONF = {
"GatewayTestClient", // ClientId "GatewayTestClient", // ClientId
{225,1,1,1}, // Multicast group IP {225,1,1,1}, // Multicast group IP
1883, // Multicast group Port 1883, // Multicast group Port
20001, // Local PortNo 20020, // Local PortNo
}; };
/*------------------------------------------------------ /*------------------------------------------------------

View File

@@ -36,3 +36,12 @@ ClientProxy, ty4tw/proxy/predefTopic3, 3
GatewayTestClient,ty4tw/predefinedTopic1, 1 GatewayTestClient,ty4tw/predefinedTopic1, 1
GatewayTestClient,ty4tw/predefinedTopic2, 2 GatewayTestClient,ty4tw/predefinedTopic2, 2
GatewayTestClient,ty4tw/predefinedTopic3, 3 GatewayTestClient,ty4tw/predefinedTopic3, 3
ClientPUB,ty4tw/predefinedTopic1, 1
ClientPUB,ty4tw/predefinedTopic2, 2
ClientPUB,ty4tw/predefinedTopic3, 3
ClientSUB,ty4tw/predefinedTopic1, 1
ClientSUB,ty4tw/predefinedTopic2, 2
ClientSUB,ty4tw/predefinedTopic3, 3

View File

@@ -23,5 +23,8 @@
# #
# #
QoS-1_Client,172.16.1.7:12002 QoS-1_Client01,172.16.1.11:20001
QoS-1_Clien02t,172.16.1.11:20002
QoS-1_Client03,172.16.1.11:20003
QoS-1_Client04,172.16.1.11:20004
QoS-1_Client05,172.16.1.11:20005

View File

@@ -402,7 +402,6 @@ Client::Client(bool secure)
_connAck = 0; _connAck = 0;
_waitWillMsgFlg = false; _waitWillMsgFlg = false;
_sessionStatus = false; _sessionStatus = false;
_otaClient = 0;
_prevClient = 0; _prevClient = 0;
_nextClient = 0; _nextClient = 0;
_clientSleepPacketQue.setMaxSize(MAX_SAVED_PUBLISH); _clientSleepPacketQue.setMaxSize(MAX_SAVED_PUBLISH);
@@ -570,7 +569,7 @@ void Client::setSessionStatus(bool status)
bool Client::erasable(void) bool Client::erasable(void)
{ {
return _sessionStatus || !_hasPredefTopic; return _sessionStatus && !_hasPredefTopic && _forwarder == 0;
} }
void Client::updateStatus(MQTTSNPacket* packet) void Client::updateStatus(MQTTSNPacket* packet)

View File

@@ -363,7 +363,6 @@ private:
Client* _nextClient; Client* _nextClient;
Client* _prevClient; Client* _prevClient;
Client* _otaClient;
}; };
/*===================================== /*=====================================

View File

@@ -227,7 +227,7 @@ void ClientProxy::resetPingTimer(void)
void ClientProxy::send(MQTTSNPacket* packet) void ClientProxy::send(MQTTSNPacket* packet)
{ {
if ( packet->getType() == MQTTSN_CONNACK || packet->getType() == MQTTSN_PINGRESP ) if ( packet->getType() == MQTTSN_CONNACK )
{ {
resetPingTimer(); resetPingTimer();
sendStoredPublish(); sendStoredPublish();
@@ -236,6 +236,10 @@ void ClientProxy::send(MQTTSNPacket* packet)
{ {
resetPingTimer(); resetPingTimer();
} }
else if ( packet->getType() == MQTTSN_DISCONNECT )
{
// blank
}
} }
void ClientProxy::sendStoredPublish(void) void ClientProxy::sendStoredPublish(void)