Skip to content

Conversation

@cptkoolbeenz
Copy link

Description

This PR fixes the DHCP callback handler to properly extract all network configuration fields from the DHCP response, not just the IP address.

Problem

The WINC driver's DHCP callback handler (M2M_WIFI_REQ_DHCP_CONF) incorrectly casts the message content to uint8_t* and only extracts 4 bytes (IP address), even though the WINC firmware provides complete network configuration in the tstrM2MIPConfig structure.

Solution

  • Properly cast the message content to tstrM2MIPConfig*
  • Extract all network configuration fields:
    • IP address (u32StaticIP)
    • Subnet mask (u32SubnetMask)
    • Gateway (u32Gateway)
    • DNS server (u32DNS)

Technical Details

The control structure already has fields for these values (netMask, gatewayAddress, dnsServerAddress) but they were never populated from the DHCP response. This change ensures applications can access complete network configuration obtained via DHCP.

Testing

  • Connect to a network using DHCP
  • Verify that subnet mask, gateway, and DNS are correctly extracted
  • Compare values with those assigned by the DHCP server

Fixes #4

References

… and DNS

The WINC driver's DHCP callback handler (M2M_WIFI_REQ_DHCP_CONF) was only
extracting the IP address from the DHCP response, even though the WINC
firmware provides complete network configuration in tstrM2MIPConfig.

This fix properly casts the message to tstrM2MIPConfig* and extracts all
network configuration fields:
- IP address (u32StaticIP)
- Subnet mask (u32SubnetMask)
- Gateway (u32Gateway)
- DNS server (u32DNS)

The control structure already has fields for these values (netMask,
gatewayAddress, dnsServerAddress) but they were never populated from
the DHCP response.

Fixes Microchip-MPLAB-Harmony#4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

fix(winc): extract full DHCP configuration including subnet, gateway, and DNS

1 participant