Author Topic: "Use dhcp" setting should be in NETWORK_PARAMETERS?  (Read 7546 times)

Offline aaronlawrence

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
"Use dhcp" setting should be in NETWORK_PARAMETERS?
« on: March 18, 2010, 04:53:31 AM »
Is there a reason why the "use DHCP" setting is in the ucServers part of the main parameters, instead of being a part of the network parameters?

Offline aaronlawrence

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: "Use dhcp" setting should be in NETWORK_PARAMETERS?
« Reply #1 on: March 18, 2010, 05:32:49 AM »
Also related, what is the difference between the "temporary" parameter block and the "swap" block???
Surely the temp block is not used unless the swap block is being used?
So shouldn't a lot more of the code in the parameter block handling, be dependent on USE_PAR_SWAP_BLOCK?

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: "Use dhcp" setting should be in NETWORK_PARAMETERS?
« Reply #2 on: March 18, 2010, 10:30:20 PM »
Hi Aaron

The network settings are the IP configuration and physical Ethernet mode (whether originating from fixed values for from those negotiated from a DHCP server).

The server settings (including clients) controls the servers (and clients) that are actually started. The DHCP setting is a client setting (grouped with servers).

I find this logical (but I understand that not everyone thinks the same and uses the same logic) - personally I don't see that the DHCP setting should be a part of the the network setting, even though it controls where the settings are taken from.

Regards

Mark


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: "Use dhcp" setting should be in NETWORK_PARAMETERS?
« Reply #3 on: March 18, 2010, 10:44:02 PM »
Hi Aaron

Quote
Also related, what is the difference between the "temporary" parameter block and the "swap" block???
Surely the temp block is not used unless the swap block is being used?
So shouldn't a lot more of the code in the parameter block handling, be dependent on USE_PAR_SWAP_BLOCK?

There are in fact two subjects here. The first think to realise is that there are parameters and temporary parameters. This is not a requirement but just how the demo project does it. The reason is to show how it is possible to make parameter changes of a temporary nature (some may be immediately used and some displayed but not yet be committed to use - like most IP changes). It allows changes to be made and checked before actually committing then, and also the changes to be reverted (i.e. canceled). A reference project needed this and that is where the base came from - if not needed it can all be done with one set of parameters.

The second is the saving in FLASH so that the values are permanent. Here there are temporary and validated blocks, but this is only the case when the uParameterSystem is configured to use a swap block. If there is no swap block there is only a single valid set at any time. There are then two advantages of the swap block:

1) It is possible to make changes which are then really used (also after a reset or power down), but it is also possible to return to the previous set of parameters. The demo uses this technique to allow new IP settings to be tested for a period of 3 minutes. If these are not 'validated' the temporary set will be deleted so that the original set becomes used again., The main reason is to ensure that no IP settings are changed which perminently leave a device unreachable (eg. when they are changed incorrectly) - the tutorial also describes this in some detail.
Again it is am application demonstration (although often used like this) and it is free to do it any other way.

2) A swap block ensures that even if the power to the board were removed in the instant that new parameters are being programmed it is not possible to lose previous ones. When not working with a swap block there will always be a short period of time where old parameters are deleted and, if power happens to fail in this instance, the new ones are also not available. The result is that all setting revert back to factory settings.
If this is not a big deal there is no reason to use a swap block. However in many cases it could be a problem when parameters are lost and so that is why the swap block option is available and also usually used.

This should explain that the temporary parameters are not directly related to the swap block. Some projects may want a temporary set but not a swap block; others may want a swap block but not temporary parameters, etc.

Regards

Mark