DJMFix.cpp
branchv_0
changeset 22 de678a266ab8
parent 19 4ed672cecc25
     1.1 --- a/DJMFix.cpp	Sun Jun 01 13:18:29 2025 +0200
     1.2 +++ b/DJMFix.cpp	Sat Sep 06 23:49:23 2025 +0200
     1.3 @@ -68,17 +68,19 @@
     1.4  	void run() {
     1.5  		while (!stopped) {
     1.6  			logger->log(L::FINE, "DJMFixImpl::run()");
     1.7 -			if (sendKeepAlive) send({
     1.8 +			if (sendKeepAlive) {
     1.9 +				send({
    1.10  					0xf0, 0x00, 0x40, 0x05,
    1.11  					0x00, 0x00, 0x00, model,
    1.12  					0x00, 0x50, 0x01, 0xf7
    1.13  				});
    1.14 +				keepAliveCounter++;
    1.15 +				if (keepAliveCounter % (60 * 1000 / keepAliveInterval) == 0)
    1.16 +					logger->log(L::INFO,
    1.17 +						"Still sending periodic keep-alive messages "
    1.18 +						"(each " + std::to_string(keepAliveInterval) + " ms).");
    1.19 +			}
    1.20  			std::this_thread::sleep_for(chro::milliseconds(keepAliveInterval));
    1.21 -			keepAliveCounter++;
    1.22 -			if (keepAliveCounter % (60 * 1000 / keepAliveInterval) == 0)
    1.23 -				logger->log(L::INFO,
    1.24 -					"Still sending periodic keep-alive messages "
    1.25 -					"(each " + std::to_string(keepAliveInterval) + " ms).");
    1.26  		}
    1.27  	}
    1.28  
    1.29 @@ -193,10 +195,9 @@
    1.30  			// DJM-450:
    1.31  			// DJM-450 - not tested yet:
    1.32  			model = 0x13;
    1.33 -			seed0 = {0x8c, 0x5b, 0x3f, 0x5d};
    1.34  			seed3 = {
    1.35 -				0x08, 0xef, 0x3f, 0x2f, 0x1e,
    1.36 -				0x7a, 0x90, 0x17, 0xf6, 0xaf
    1.37 +				0x99, 0xd5, 0x55, 0x43, 0x2c,
    1.38 +				0x70, 0x53, 0x7a, 0x6f, 0x02
    1.39  			};
    1.40  			logger->log(L::FINE, "Switched to DJM-450 mode");
    1.41  		} else {