Murata RF modules are designed to simplify wireless development and certification by minimizing the amount of RF expertise you need to wirelessly enable a wide range of applications.

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DHCPInfoResponse.cpp Source File

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 }