Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
DHCPInfoResponse.cpp
00001 #include "DHCPInfoResponse.h" 00002 00003 using namespace SmartLabMuRata; 00004 00005 DHCPInfoResponse::DHCPInfoResponse(Payload * payload) 00006 : Payload(payload) 00007 { } 00008 00009 SNICCode DHCPInfoResponse::GetStatus() 00010 { 00011 return (SNICCode)GetData()[2]; 00012 } 00013 00014 const char * DHCPInfoResponse::GetLocalMAC() 00015 { 00016 if (GetStatus() != SNIC_SUCCESS) 00017 return NULL; 00018 00019 return GetData() + 3; 00020 } 00021 00022 IPAddress DHCPInfoResponse::GetLocalIP() 00023 { 00024 IPAddress ip; 00025 00026 if (GetStatus() != SNIC_SUCCESS) 00027 return ip; 00028 00029 ip.SetValue(GetData(), 9); 00030 return ip; 00031 } 00032 00033 IPAddress DHCPInfoResponse::GetGatewayIP() 00034 { 00035 IPAddress ip; 00036 00037 if (GetStatus() != SNIC_SUCCESS) 00038 return ip; 00039 00040 ip.SetValue(GetData(), 13); 00041 return ip; 00042 } 00043 00044 IPAddress DHCPInfoResponse::GetSubnetMask() 00045 { 00046 IPAddress ip; 00047 00048 if (GetStatus() != SNIC_SUCCESS) 00049 return ip; 00050 00051 ip.SetValue(GetData(), 17); 00052 return ip; 00053 } 00054 00055 DHCPMode DHCPInfoResponse::GetDHCPMode() 00056 { 00057 return (DHCPMode)GetData()[21]; 00058 }
Generated on Fri Jul 15 2022 01:02:11 by
1.7.2