Use a random id for MQTT and change the order of some startup messages.

This commit is contained in:
Jonathan Naylor
2025-03-12 13:25:26 +00:00
parent 886c999e64
commit 088a62789f
2 changed files with 6 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2015-2021,2023,2024 by Jonathan Naylor G4KLX * Copyright (C) 2015-2021,2023,2024,2025 by Jonathan Naylor G4KLX
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -76,7 +76,7 @@ static CMMDVMHost* host = NULL;
const char* HEADER1 = "This software is for use on amateur radio networks only,"; const char* HEADER1 = "This software is for use on amateur radio networks only,";
const char* HEADER2 = "it is to be used for educational purposes only. Its use on"; const char* HEADER2 = "it is to be used for educational purposes only. Its use on";
const char* HEADER3 = "commercial networks is strictly prohibited."; const char* HEADER3 = "commercial networks is strictly prohibited.";
const char* HEADER4 = "Copyright(C) 2015-2024 by Jonathan Naylor, G4KLX and others"; const char* HEADER4 = "Copyright(C) 2015-2025 by Jonathan Naylor, G4KLX and others";
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
@@ -391,6 +391,8 @@ int CMMDVMHost::run()
LogInfo("MMDVMHost-%s is starting", VERSION); LogInfo("MMDVMHost-%s is starting", VERSION);
LogInfo("Built %s %s (GitID #%.7s)", __TIME__, __DATE__, gitversion); LogInfo("Built %s %s (GitID #%.7s)", __TIME__, __DATE__, gitversion);
writeJSONMessage("MMDVMHost is starting");
readParams(); readParams();
ret = createModem(); ret = createModem();
@@ -902,11 +904,6 @@ int CMMDVMHost::run()
setMode(MODE_IDLE); setMode(MODE_IDLE);
LogInfo("MMDVMHost-%s is starting", VERSION);
LogInfo("Built %s %s (GitID #%.7s)", __TIME__, __DATE__, gitversion);
writeJSONMessage("MMDVMHost is starting");
while (!m_killed) { while (!m_killed) {
bool lockout = m_modem->hasLockout(); bool lockout = m_modem->hasLockout();

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022,2023 by Jonathan Naylor G4KLX * Copyright (C) 2022,2023,2025 by Jonathan Naylor G4KLX
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -51,7 +51,7 @@ CMQTTConnection::~CMQTTConnection()
bool CMQTTConnection::open() bool CMQTTConnection::open()
{ {
m_mosq = ::mosquitto_new(m_name.c_str(), true, this); m_mosq = ::mosquitto_new(NULL, true, this);
if (m_mosq == NULL) { if (m_mosq == NULL) {
::fprintf(stderr, "MQTT Error newing: Out of memory.\n"); ::fprintf(stderr, "MQTT Error newing: Out of memory.\n");
return false; return false;