Exemple #1
0
static void manager (struct plc * plc, signed count, signed pause)

{
	while (count--)
	{
		if (_anyset (plc->flags, PLC_VERSION))
		{
			VersionInfo1 (plc);
		}
		if (_anyset (plc->flags, PLC_ATTRIBUTES))
		{
			Attributes1 (plc);
		}
		if (_anyset (plc->flags, PLC_WATCHDOG_REPORT))
		{
			WatchdogReport (plc);
		}
		if (_anyset (plc->flags, PLC_NVRAM_INFO))
		{
			NVRAMInfo (plc);
		}
		if (_anyset (plc->flags, PLC_SDRAM_INFO))
		{
			SDRAMInfo (plc);
		}
		if (_anyset (plc->flags, PLC_READ_IDENTITY))
		{
			Identity1 (plc);
		}
		if (_anyset (plc->flags, PLC_NETWORK))
		{
			NetInfo1 (plc);
		}
		if (_anyset (plc->flags, PLC_SDRAM_CONFIG))
		{
			WriteCFG (plc);
		}
		if (_anyset (plc->flags, PLC_WRITE_MAC))
		{
			WriteNVM (plc);
		}
		if (_anyset (plc->flags, PLC_READ_MAC))
		{
			ReadFirmware1 (plc);
		}
		if (_anyset (plc->flags, PLC_WRITE_PIB))
		{
			WritePIB (plc);
		}
		if (_anyset (plc->flags, PLC_READ_PIB))
		{
			ReadParameters1 (plc);
		}
		if (_anyset (plc->flags, PLC_HOST_ACTION))
		{
			HostActionResponse (plc);
		}
		if (_anyset (plc->flags, PLC_PUSH_BUTTON))
		{
			PushButton (plc);
		}
		if (_anyset (plc->flags, (PLC_SETLOCALKEY | PLC_SETREMOTEKEY)))
		{
			SetNMK (plc);
		}
		if (_anyset (plc->flags, PLC_FACTORY_DEFAULTS))
		{
			FactoryDefaults (plc);
		}
		if (_anyset (plc->flags, PLC_FLASH_DEVICE))
		{
			FlashNVM (plc);
			WaitForRestart (plc);
		}
		if (_anyset (plc->flags, PLC_RESET_DEVICE))
		{
			ResetDevice (plc);
		}
		sleep (pause);
	}
	return;
}
Exemple #2
0
static void manager (struct plc * plc, signed count, signed pause) 

{
	while (count--) 
	{
		if (_anyset (plc->flags, PLC_VERSION)) 
		{
			VersionInfo2 (plc);
		}
		if (_anyset (plc->flags, PLC_ATTRIBUTES)) 
		{
			Attributes2 (plc);
		}
		if (_anyset (plc->flags, PLC_WATCHDOG_REPORT)) 
		{
			WatchdogReport (plc);
		}
		if (_anyset (plc->flags, PLC_NVRAM_INFO)) 
		{
			NVRAMInfo (plc);
		}
		if (_anyset (plc->flags, PLC_READ_IDENTITY)) 
		{
			Identity2 (plc);
		}
		if (_anyset (plc->flags, PLC_REMOTEHOSTS)) 
		{
			RemoteHosts (plc);
		}
		if (_anyset (plc->flags, PLC_NETWORK)) 
		{
			NetInfo2 (plc);
		}
		if (_anyset (plc->flags, PLC_READ_PIB)) 
		{
			ModuleRead (plc, &plc->pib, PLC_MOD_OP_READ_MEMORY, PLC_MODULEID_PARAMETERS, 0);
		}
		if (_anyset (plc->flags, PLC_READ_MAC)) 
		{
			ModuleRead (plc, &plc->nvm, PLC_MOD_OP_READ_MEMORY, PLC_MODULEID_FIRMWARE, 0);
		}
		if (_anyset (plc->flags, PLC_HOST_ACTION)) 
		{
			HostActionResponse (plc);
		}
		if (_anyset (plc->flags, PLC_PUSH_BUTTON)) 
		{
			PushButton (plc);
		}
		if (_anyset (plc->flags, PLC_FACTORY_DEFAULTS)) 
		{
			FactoryDefaults (plc);
		}
		if (_anyset (plc->flags, (PLC_SETLOCALKEY | PLC_SETREMOTEKEY))) 
		{
			SetNMK (plc);
		}
		if (_anyset (plc->flags, PLC_FLASH_DEVICE)) 
		{
			FlashDevice2 (plc);
		}
		if (_anyset (plc->flags, PLC_RESET_DEVICE)) 
		{
			ResetDevice (plc);
		}
		sleep (pause);
	}
	return;
}