mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-13 15:36:51 +01:00
Update: Create param.conf and key files automatically.
BugFix: change parameter name BroadcastIp and BroadcastPortNo to MulticastIP and MulticastPortNo, respectively. Update: Makefile to copy param.conf and build Log monitor. Update: README Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
@@ -62,6 +62,11 @@ void Gateway::initialize(int argc, char** argv)
|
||||
throw Exception( "Gateway::initialize: invalid Gateway Id");
|
||||
}
|
||||
|
||||
if (getParam("GatewayName", param) == 0)
|
||||
{
|
||||
_params.gatewayName = (uint8_t*) strdup(param);
|
||||
}
|
||||
|
||||
_params.mqttVersion = DEFAULT_MQTT_VERSION;
|
||||
if (getParam("MQTTVersion", param) == 0)
|
||||
{
|
||||
@@ -100,7 +105,9 @@ void Gateway::initialize(int argc, char** argv)
|
||||
{
|
||||
if (!strcasecmp(param, "YES"))
|
||||
{
|
||||
if (!_clientList.authorize(MQTTSNGW_CLIENT_LIST))
|
||||
string fileName = string(MQTTSNGW_CONFIG_DIRECTORY) + string(MQTTSNGW_CLIENT_LIST);
|
||||
|
||||
if (!_clientList.authorize(fileName.c_str()))
|
||||
{
|
||||
throw Exception("Gateway::initialize: can't authorize clients.");
|
||||
}
|
||||
@@ -113,7 +120,7 @@ void Gateway::initialize(int argc, char** argv)
|
||||
void Gateway::run(void)
|
||||
{
|
||||
_lightIndicator.redLight(true);
|
||||
WRITELOG("%s MQTT-SN Gateway has been started. %s %s\n", currentDateTime(), _sensorNetwork.getType(), GATEWAY_VERSION);
|
||||
WRITELOG("%s %s has been started. %s %s\n", currentDateTime(), _params.gatewayName, _sensorNetwork.getType(), GATEWAY_VERSION);
|
||||
if ( getClientList()->isAuthorized() )
|
||||
{
|
||||
WRITELOG("\n Client authentication is required by the configuration settings.\n");
|
||||
|
||||
Reference in New Issue
Block a user