This is Webservice SDK for mbed. LPCXpresso1769/LPC1768/FRDM-K64F/LPC4088

Dependents:   MbedFileServer_1768MiniDK2 RedWireBridge IssueDebug_gcc MiMicRemoteMCU-for-Mbed ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers IpAddr.h Source File

IpAddr.h

00001 #pragma once
00002 ////////////////////////////////////////////////////////////////////////////////
00003 // TcpSocket.h
00004 ////////////////////////////////////////////////////////////////////////////////
00005 
00006 #include "NyLPC_net.h"
00007 
00008 namespace MiMic
00009 {
00010     /**
00011      * This class hold IP address.
00012      */
00013     class IpAddr
00014     {
00015     public:
00016         union TAddrs{
00017             struct NyLPC_TIPv4Addr v4;
00018         }addr;
00019     public:
00020         IpAddr()
00021         {this->setIPv4(0,0,0,0);}  
00022         IpAddr(unsigned char p4,unsigned char p3,unsigned char p2,unsigned char p1)
00023         {this->setIPv4(p4,p3,p2,p1);}
00024         
00025         void setIPv4(unsigned char p4,unsigned char p3,unsigned char p2,unsigned char p1)
00026         {NyLPC_TIPv4Addr_set(&this->addr.v4,p4,p3,p2,p1);}        
00027         void setIPv4(const struct NyLPC_TIPv4Addr& v4)
00028         {this->addr.v4=v4;}
00029     };
00030 }