int eth32cfg_set_config(eth32cfg_ip_t *bcastaddr, eth32cfg_data_t *dataptr);
This function is used to store new configuration settings into an ETH32 device. The device's Allow Config switch must be set to Yes, or the new configuration will be rejected.
bcastaddr - Broadcast address to which the configuration packet should be sent. Passing in NULL will use 255.255.255.255, which is suitable for most situations.
dataptr - Pointer to the structure containing the new configuration data and product identification information.
This function returns zero on success and a negative error code on failure. Please see the Error Codes section for possible error codes. Under normal circumstances, the device will accept the configuration and return a confirmation packet, which will cause the function to immediately return without an error. If the device's Allow Config switch is set to No, it will return a rejection packet, which will cause the function to return the ETH_CFG_REJECT error. If no response is received from the device, the function will return the ETH_CFG_NOACK error after a short timeout.
The MAC address and serial number information members of the eth32cfg_data_t Structure identify which device is to be configured. If those members are not set correctly, the device will simply ignore the settings, or worst-case, if they match a different device you were not intending to configure, that device will accept the new configuration. Therefore, in most cases, although it is not required, it is best to take the eth32cfg_data_t Structure from the eth32cfg_get_config function, modify as needed, and then provide that to this function.