20 assert(maxSize >= 16);
41 int32_t numReadParams;
51 numReadParams = sscanf(pBuffer,
"%d.%d.%d.%d", &ipAddrA, &ipAddrB, &ipAddrC, &ipAddrD);
56 if ((numReadParams == 4) && (ipAddrA >= 0) && (ipAddrA <= 255) && (ipAddrB >= 0) && (ipAddrB <= 255) && (ipAddrC >= 0) && (ipAddrC <= 255) && (ipAddrD >= 0) && (ipAddrD <= 255))
61 return sbgIpAddr((uint8_t)ipAddrA, (uint8_t)ipAddrB, (uint8_t)ipAddrC, (uint8_t)ipAddrD);
95 #if SBG_CONFIG_BIG_ENDIAN == 0 SBG_COMMON_LIB_API bool sbgIpNetMaskValid(sbgIpAddress netmask)
#define SBG_COMMON_LIB_API
SBG_COMMON_LIB_API void sbgNetworkIpToString(sbgIpAddress ipAddr, char *pBuffer, size_t maxSize)
SBG_INLINE uint8_t sbgIpAddrGetC(sbgIpAddress ipAddr)
SBG_INLINE sbgIpAddress sbgIpAddr(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
Useful methods for Network handling such as ip addresses.
#define SBG_UNUSED_PARAMETER(x)
SBG_COMMON_LIB_API sbgIpAddress sbgNetworkIpFromString(const char *pBuffer)
SBG_INLINE uint8_t sbgIpAddrGetD(sbgIpAddress ipAddr)
SBG_INLINE uint32_t sbgSwap32(uint32_t x)
SBG_INLINE uint8_t sbgIpAddrGetA(sbgIpAddress ipAddr)
Set of functions used to swap numbers.
SBG_INLINE uint8_t sbgIpAddrGetB(sbgIpAddress ipAddr)