Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions driver/winc/wdrv_winc.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,18 +866,19 @@ static void _WDRV_WINC_WifiCallback(uint8_t msgType, const void *const pMsgConte
/* The IP address of the connection has been updated due to DHCP. */
case M2M_WIFI_REQ_DHCP_CONF:
{
const uint8_t *const pIP = (const uint8_t *const)pMsgContent;
const tstrM2MIPConfig *const pIPConfig = (const tstrM2MIPConfig *const)pMsgContent;

if (false == pDcpt->pCtrl->isAP)
{
/* For a STA signal that an IP address has now been assigned. */
pDcpt->pCtrl->haveIPAddress = true;
}

pDcpt->pCtrl->ipAddress = ( (uint32_t)pIP[3] << 24) |
( (uint32_t)pIP[2] << 16) |
( (uint32_t)pIP[1] << 8 ) |
( (uint32_t)pIP[0]);
/* Extract complete network configuration from DHCP response */
pDcpt->pCtrl->ipAddress = pIPConfig->u32StaticIP;
pDcpt->pCtrl->netMask = pIPConfig->u32SubnetMask;
pDcpt->pCtrl->gatewayAddress = pIPConfig->u32Gateway;
pDcpt->pCtrl->dnsServerAddress = pIPConfig->u32DNS;

if (NULL != pDcpt->pCtrl->pfDHCPAddressEventCB)
{
Expand Down