Update printer's type (MMU/non-MMU) at runtime

+ reformat utils.cpp
This commit is contained in:
D.R.racer 2022-05-27 07:27:57 +02:00
parent 5082da78d2
commit f04d83fc4c
2 changed files with 181 additions and 200 deletions

View File

@ -1621,7 +1621,6 @@ void setup()
#endif //UVLO_SUPPORT #endif //UVLO_SUPPORT
fCheckModeInit(); fCheckModeInit();
fSetMmuMode(MMU2::mmu2.Enabled());
KEEPALIVE_STATE(NOT_BUSY); KEEPALIVE_STATE(NOT_BUSY);
#ifdef WATCHDOG #ifdef WATCHDOG
wdt_enable(WDTO_4S); wdt_enable(WDTO_4S);
@ -8140,6 +8139,8 @@ Sigma_Exit:
{ {
uint16_t nPrinterModel; uint16_t nPrinterModel;
nPrinterModel=(uint16_t)code_value_long(); nPrinterModel=(uint16_t)code_value_long();
// based on current state of MMU (active/stopped/connecting) perform a runtime update of the printer type
fSetMmuMode(MMU2::mmu2.Enabled());
printer_model_check(nPrinterModel); printer_model_check(nPrinterModel);
} }
else if(code_seen('Q')) else if(code_seen('Q'))

View File

@ -227,7 +227,6 @@ void update_current_firmware_version_to_eeprom()
} }
//-//
#define MSG_PRINT_CHECKING_FAILED_TIMEOUT 30 #define MSG_PRINT_CHECKING_FAILED_TIMEOUT 30
ClNozzleDiameter oNozzleDiameter=ClNozzleDiameter::_Diameter_400; ClNozzleDiameter oNozzleDiameter=ClNozzleDiameter::_Diameter_400;
@ -236,207 +235,192 @@ ClCheckModel oCheckModel=ClCheckModel::_None;
ClCheckVersion oCheckVersion=ClCheckVersion::_None; ClCheckVersion oCheckVersion=ClCheckVersion::_None;
ClCheckGcode oCheckGcode=ClCheckGcode::_None; ClCheckGcode oCheckGcode=ClCheckGcode::_None;
void fCheckModeInit() void fCheckModeInit() {
{ oCheckMode = (ClCheckMode)eeprom_read_byte((uint8_t *)EEPROM_CHECK_MODE);
oCheckMode=(ClCheckMode)eeprom_read_byte((uint8_t*)EEPROM_CHECK_MODE); if (oCheckMode == ClCheckMode::_Undef) {
if(oCheckMode==ClCheckMode::_Undef) oCheckMode = ClCheckMode::_Warn;
{ eeprom_update_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)oCheckMode);
oCheckMode=ClCheckMode::_Warn; }
eeprom_update_byte((uint8_t*)EEPROM_CHECK_MODE,(uint8_t)oCheckMode); if (farm_mode) {
} oCheckMode = ClCheckMode::_Strict;
if(farm_mode) if (eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM) == EEPROM_EMPTY_VALUE16)
{ eeprom_update_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT);
oCheckMode=ClCheckMode::_Strict; }
if(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)==EEPROM_EMPTY_VALUE16) oNozzleDiameter = (ClNozzleDiameter)eeprom_read_byte((uint8_t *)EEPROM_NOZZLE_DIAMETER);
eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); if ((oNozzleDiameter == ClNozzleDiameter::_Diameter_Undef) && !farm_mode) {
} oNozzleDiameter = ClNozzleDiameter::_Diameter_400;
oNozzleDiameter=(ClNozzleDiameter)eeprom_read_byte((uint8_t*)EEPROM_NOZZLE_DIAMETER); eeprom_update_byte((uint8_t *)EEPROM_NOZZLE_DIAMETER, (uint8_t)oNozzleDiameter);
if((oNozzleDiameter==ClNozzleDiameter::_Diameter_Undef)&& !farm_mode) eeprom_update_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT);
{ }
oNozzleDiameter=ClNozzleDiameter::_Diameter_400; oCheckModel = (ClCheckModel)eeprom_read_byte((uint8_t *)EEPROM_CHECK_MODEL);
eeprom_update_byte((uint8_t*)EEPROM_NOZZLE_DIAMETER,(uint8_t)oNozzleDiameter); if (oCheckModel == ClCheckModel::_Undef) {
eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); oCheckModel = ClCheckModel::_Warn;
} eeprom_update_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)oCheckModel);
oCheckModel=(ClCheckModel)eeprom_read_byte((uint8_t*)EEPROM_CHECK_MODEL); }
if(oCheckModel==ClCheckModel::_Undef) oCheckVersion = (ClCheckVersion)eeprom_read_byte((uint8_t *)EEPROM_CHECK_VERSION);
{ if (oCheckVersion == ClCheckVersion::_Undef) {
oCheckModel=ClCheckModel::_Warn; oCheckVersion = ClCheckVersion::_Warn;
eeprom_update_byte((uint8_t*)EEPROM_CHECK_MODEL,(uint8_t)oCheckModel); eeprom_update_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)oCheckVersion);
} }
oCheckVersion=(ClCheckVersion)eeprom_read_byte((uint8_t*)EEPROM_CHECK_VERSION); oCheckGcode = (ClCheckGcode)eeprom_read_byte((uint8_t *)EEPROM_CHECK_GCODE);
if(oCheckVersion==ClCheckVersion::_Undef) if (oCheckGcode == ClCheckGcode::_Undef) {
{ oCheckGcode = ClCheckGcode::_Warn;
oCheckVersion=ClCheckVersion::_Warn; eeprom_update_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)oCheckGcode);
eeprom_update_byte((uint8_t*)EEPROM_CHECK_VERSION,(uint8_t)oCheckVersion); }
}
oCheckGcode=(ClCheckGcode)eeprom_read_byte((uint8_t*)EEPROM_CHECK_GCODE);
if(oCheckGcode==ClCheckGcode::_Undef)
{
oCheckGcode=ClCheckGcode::_Warn;
eeprom_update_byte((uint8_t*)EEPROM_CHECK_GCODE,(uint8_t)oCheckGcode);
}
} }
void nozzle_diameter_check(uint16_t nDiameter) void nozzle_diameter_check(uint16_t nDiameter) {
{ uint16_t nDiameter_um;
uint16_t nDiameter_um;
if(oCheckMode==ClCheckMode::_None) if (oCheckMode == ClCheckMode::_None)
return; return;
nDiameter_um=eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM);
if(nDiameter==nDiameter_um) if (nDiameter == nDiameter_um)
return; return;
//SERIAL_ECHO_START; // SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("Printer nozzle diameter differs from the G-code ..."); // SERIAL_ECHOLNPGM("Printer nozzle diameter differs from the G-code ...");
//SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0));
//SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOPGM("expected: ");
//SERIAL_ECHOLN((float)(nDiameter/1000.0)); // SERIAL_ECHOLN((float)(nDiameter/1000.0));
switch(oCheckMode) switch (oCheckMode) {
{ case ClCheckMode::_Warn:
case ClCheckMode::_Warn: // lcd_show_fullscreen_message_and_wait_P(_i("Printer nozzle diameter differs from the G-code. Continue?"));
// lcd_show_fullscreen_message_and_wait_P(_i("Printer nozzle diameter differs from the G-code. Continue?")); lcd_display_message_fullscreen_P(_i("Printer nozzle diameter differs from the G-code. Continue?")); ////MSG_NOZZLE_DIFFERS_CONTINUE c=20 r=5
lcd_display_message_fullscreen_P(_i("Printer nozzle diameter differs from the G-code. Continue?"));////MSG_NOZZLE_DIFFERS_CONTINUE c=20 r=5 lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT); //???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery lcd_update_enable(true); // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery break;
break; case ClCheckMode::_Strict:
case ClCheckMode::_Strict: lcd_show_fullscreen_message_and_wait_P(_i(
lcd_show_fullscreen_message_and_wait_P(_i("Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled."));////MSG_NOZZLE_DIFFERS_CANCELLED c=20 r=9 "Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled.")); ////MSG_NOZZLE_DIFFERS_CANCELLED c=20 r=9
lcd_print_stop(); lcd_print_stop();
break; break;
case ClCheckMode::_None: case ClCheckMode::_None:
case ClCheckMode::_Undef: case ClCheckMode::_Undef:
break; break;
} }
if(!farm_mode) if (!farm_mode) {
{ bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function
bSettings=false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function menu_submenu(lcd_hw_setup_menu);
menu_submenu(lcd_hw_setup_menu); }
}
} }
void printer_model_check(uint16_t nPrinterModel) void printer_model_check(uint16_t nPrinterModel) {
{ if (oCheckModel == ClCheckModel::_None)
if(oCheckModel==ClCheckModel::_None) return;
return; if (nPrinterModel == nPrinterType)
if(nPrinterModel==nPrinterType) return;
return; // SERIAL_ECHO_START;
//SERIAL_ECHO_START; // SERIAL_ECHOLNPGM("Printer model differs from the G-code ...");
//SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(nPrinterType);
//SERIAL_ECHOLN(nPrinterType); // SERIAL_ECHOPGM("expected: ");
//SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel);
//SERIAL_ECHOLN(nPrinterModel); switch (oCheckModel) {
switch(oCheckModel) case ClCheckModel::_Warn:
{ // lcd_show_fullscreen_message_and_wait_P(_i("Printer model differs from the G-code. Continue?"));
case ClCheckModel::_Warn: lcd_display_message_fullscreen_P(_T(MSG_GCODE_DIFF_PRINTER_CONTINUE));
// lcd_show_fullscreen_message_and_wait_P(_i("Printer model differs from the G-code. Continue?")); lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
lcd_display_message_fullscreen_P(_T(MSG_GCODE_DIFF_PRINTER_CONTINUE)); //???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT); lcd_update_enable(true); // display / status-line recovery
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery break;
lcd_update_enable(true); // display / status-line recovery case ClCheckModel::_Strict:
break; lcd_show_fullscreen_message_and_wait_P(_T(MSG_GCODE_DIFF_PRINTER_CANCELLED));
case ClCheckModel::_Strict: lcd_print_stop();
lcd_show_fullscreen_message_and_wait_P(_T(MSG_GCODE_DIFF_PRINTER_CANCELLED)); break;
lcd_print_stop(); case ClCheckModel::_None:
break; case ClCheckModel::_Undef:
case ClCheckModel::_None: break;
case ClCheckModel::_Undef: }
break;
}
} }
uint8_t mCompareValue(uint16_t nX,uint16_t nY) uint8_t mCompareValue(uint16_t nX, uint16_t nY) {
{ if (nX > nY)
if(nX>nY) return ((uint8_t)ClCompareValue::_Greater);
return((uint8_t)ClCompareValue::_Greater); if (nX < nY)
if(nX<nY) return ((uint8_t)ClCompareValue::_Less);
return((uint8_t)ClCompareValue::_Less); return ((uint8_t)ClCompareValue::_Equal);
return((uint8_t)ClCompareValue::_Equal);
} }
void fw_version_check(const char *pVersion) void fw_version_check(const char *pVersion) {
{ uint16_t aVersion[4];
uint16_t aVersion[4]; uint8_t nCompareValueResult;
uint8_t nCompareValueResult;
if(oCheckVersion==ClCheckVersion::_None) if (oCheckVersion == ClCheckVersion::_None)
return; return;
parse_version(pVersion,aVersion); parse_version(pVersion, aVersion);
nCompareValueResult=mCompareValue(aVersion[0],eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR))<<6; nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6;
nCompareValueResult+=mCompareValue(aVersion[1],eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR))<<4; nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4;
nCompareValueResult+=mCompareValue(aVersion[2],eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION))<<2; nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2;
nCompareValueResult+=mCompareValue(aVersion[3],eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR)); nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR));
if(nCompareValueResult==COMPARE_VALUE_EQUAL) if (nCompareValueResult == COMPARE_VALUE_EQUAL)
return; return;
if((nCompareValueResult<COMPARE_VALUE_EQUAL)&&oCheckVersion==ClCheckVersion::_Warn) if ((nCompareValueResult < COMPARE_VALUE_EQUAL) && oCheckVersion == ClCheckVersion::_Warn)
return; return;
//SERIAL_ECHO_START; // SERIAL_ECHO_START;
//SERIAL_ECHOLNPGM("Printer FW version differs from the G-code ..."); // SERIAL_ECHOLNPGM("Printer FW version differs from the G-code ...");
//SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOLN(FW_VERSION); // SERIAL_ECHOLN(FW_VERSION);
//SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOPGM("expected: ");
//SERIAL_ECHOLN(pVersion); // SERIAL_ECHOLN(pVersion);
switch(oCheckVersion) switch (oCheckVersion) {
{ case ClCheckVersion::_Warn:
case ClCheckVersion::_Warn: // lcd_show_fullscreen_message_and_wait_P(_i("Printer FW version differs from the G-code. Continue?"));
// lcd_show_fullscreen_message_and_wait_P(_i("Printer FW version differs from the G-code. Continue?")); lcd_display_message_fullscreen_P(_i("G-code sliced for a newer firmware. Continue?")); ////MSG_GCODE_NEWER_FIRMWARE_CONTINUE c=20 r=5
lcd_display_message_fullscreen_P(_i("G-code sliced for a newer firmware. Continue?"));////MSG_GCODE_NEWER_FIRMWARE_CONTINUE c=20 r=5 lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT); //???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery lcd_update_enable(true); // display / status-line recovery
lcd_update_enable(true); // display / status-line recovery break;
break; case ClCheckVersion::_Strict:
case ClCheckVersion::_Strict: lcd_show_fullscreen_message_and_wait_P(
lcd_show_fullscreen_message_and_wait_P(_i("G-code sliced for a newer firmware. Please update the firmware. Print cancelled."));////MSG_GCODE_NEWER_FIRMWARE_CANCELLED c=20 r=8 _i("G-code sliced for a newer firmware. Please update the firmware. Print cancelled.")); ////MSG_GCODE_NEWER_FIRMWARE_CANCELLED c=20 r=8
lcd_print_stop(); lcd_print_stop();
break; break;
case ClCheckVersion::_None: case ClCheckVersion::_None:
case ClCheckVersion::_Undef: case ClCheckVersion::_Undef:
break; break;
} }
} }
void gcode_level_check(uint16_t nGcodeLevel) void gcode_level_check(uint16_t nGcodeLevel) {
{ if (oCheckGcode == ClCheckGcode::_None)
if(oCheckGcode==ClCheckGcode::_None) return;
return; if (nGcodeLevel == (uint16_t)GCODE_LEVEL)
if(nGcodeLevel==(uint16_t)GCODE_LEVEL) return;
return; if ((nGcodeLevel < (uint16_t)GCODE_LEVEL) && (oCheckGcode == ClCheckGcode::_Warn))
if((nGcodeLevel<(uint16_t)GCODE_LEVEL)&&(oCheckGcode==ClCheckGcode::_Warn)) return;
return; // SERIAL_ECHO_START;
//SERIAL_ECHO_START; // SERIAL_ECHOLNPGM("Printer G-code level differs from the G-code ...");
//SERIAL_ECHOLNPGM("Printer G-code level differs from the G-code ..."); // SERIAL_ECHOPGM("actual : ");
//SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL);
//SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: ");
//SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel);
//SERIAL_ECHOLN(nGcodeLevel); switch (oCheckGcode) {
switch(oCheckGcode) case ClCheckGcode::_Warn:
{ // lcd_show_fullscreen_message_and_wait_P(_i("Printer G-code level differs from the G-code. Continue?"));
case ClCheckGcode::_Warn: lcd_display_message_fullscreen_P(_i("G-code sliced for a different level. Continue?")); ////MSG_GCODE_DIFF_CONTINUE c=20 r=4
// lcd_show_fullscreen_message_and_wait_P(_i("Printer G-code level differs from the G-code. Continue?")); lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
lcd_display_message_fullscreen_P(_i("G-code sliced for a different level. Continue?"));////MSG_GCODE_DIFF_CONTINUE c=20 r=4 //???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT); lcd_update_enable(true); // display / status-line recovery
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery break;
lcd_update_enable(true); // display / status-line recovery case ClCheckGcode::_Strict:
break; lcd_show_fullscreen_message_and_wait_P(
case ClCheckGcode::_Strict: _i("G-code sliced for a different level. Please re-slice the model again. Print cancelled.")); ////MSG_GCODE_DIFF_CANCELLED c=20 r=7
lcd_show_fullscreen_message_and_wait_P(_i("G-code sliced for a different level. Please re-slice the model again. Print cancelled."));////MSG_GCODE_DIFF_CANCELLED c=20 r=7 lcd_print_stop();
lcd_print_stop(); break;
break; case ClCheckGcode::_None:
case ClCheckGcode::_None: case ClCheckGcode::_Undef:
case ClCheckGcode::_Undef: break;
break; }
}
} }
//-// -> cmdqueue ??? //-// -> cmdqueue ???
#define PRINTER_NAME_LENGTH ((sizeof(PRINTER_MMU_NAME)>sizeof(PRINTER_NAME))?(sizeof(PRINTER_MMU_NAME)-1):(sizeof(PRINTER_NAME)-1)) #define PRINTER_NAME_LENGTH ((sizeof(PRINTER_MMU_NAME) > sizeof(PRINTER_NAME)) ? (sizeof(PRINTER_MMU_NAME) - 1) : (sizeof(PRINTER_NAME) - 1))
#define GCODE_DELIMITER '"' #define GCODE_DELIMITER '"'
#define ELLIPSIS "..." #define ELLIPSIS "..."
char* code_string(const char* pStr,size_t* nLength) char *code_string(char *pStr, size_t *nLength) {
{
char* pStrBegin; char* pStrBegin;
char* pStrEnd; char* pStrEnd;
@ -448,16 +432,16 @@ pStrEnd=strchr(pStrBegin,GCODE_DELIMITER);
if(!pStrEnd) if(!pStrEnd)
return(NULL); return(NULL);
*nLength=pStrEnd-pStrBegin; *nLength=pStrEnd-pStrBegin;
pStrBegin[*nLength] = '\0';
return pStrBegin; return pStrBegin;
} }
void printer_smodel_check(const char* pStrPos) void printer_smodel_check(char *pStrPos) {
{
char* pResult; char* pResult;
size_t nLength,nPrinterNameLength; size_t nLength,nPrinterNameLength;
nPrinterNameLength = strlen_P(sPrinterName); nPrinterNameLength = strlen_P(sPrinterName);
pResult = code_string(pStrPos,&nLength); pResult=code_string(pStrPos,&nLength);
if(pResult != NULL && nLength == nPrinterNameLength) { if(pResult != NULL && nLength == nPrinterNameLength) {
// Only compare them if the lengths match // Only compare them if the lengths match
@ -483,20 +467,16 @@ lcd_update_enable(true); // display / status-line recovery
} }
} }
void fSetMmuMode(bool bMMu) void fSetMmuMode(bool bMMu) {
{ if (bMMu) {
if(bMMu) nPrinterType = pgm_read_word(&_nPrinterMmuType);
{ sPrinterName = _sPrinterMmuName;
nPrinterType=pgm_read_word(&_nPrinterMmuType); } else {
sPrinterName=_sPrinterMmuName; nPrinterType = pgm_read_word(&_nPrinterType);
} sPrinterName = _sPrinterName;
else { }
nPrinterType=pgm_read_word(&_nPrinterType);
sPrinterName=_sPrinterName;
}
} }
void ip4_to_str(char* dest, uint8_t* IP) void ip4_to_str(char* dest, uint8_t* IP)
{ {
sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]);