Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions

Functions

sint8 hexstr_2_bytes (uint8 *pu8Out, uint8 *pu8In, uint8 u8SizeOut)
 Converts a string of hex characters to bytes. More...
 
uint8 m2m_checksum (uint8 *buf, int sz)
 Calculates checksum for the specified number of data bytes in specified data buffer. More...
 
sint8 m2m_memcmp (uint8 *pu8Buff1, uint8 *pu8Buff2, uint32 u32Size)
 Compare specified number of data bytes in pu8Buff1 and pu8Buff2 and decide if they all match. More...
 
void m2m_memcpy (uint8 *pDst, uint8 *pSrc, uint32 sz)
 Copy specified number of bytes from source buffer to destination buffer. More...
 
void m2m_memset (uint8 *pBuf, uint8 val, uint32 sz)
 Set specified number of data bytes in specified data buffer to specified value. More...
 
uint16 m2m_strlen (uint8 *pcStr)
 Returns the length of a null terminated string buffer. More...
 
uint8 m2m_strncmp (uint8 *pcS1, uint8 *pcS2, uint16 u16Len)
 Compare specified number of data bytes in string buffers pcS1 and pcS2. More...
 
uint8m2m_strstr (uint8 *pcIn, uint8 *pcStr)
 Find the occurrence of pcStr string in pcIn string. More...
 

Variables

NMI_API void(* at_sb_printf )(const char *_format,...)
 Chooses which function to use in order to output debug. More...
 

sint8 hexstr_2_bytes ( uint8 pu8Out,
uint8 pu8In,
uint8  u8SizeOut 
)

Converts a string of hex characters to bytes.

Parameters
[out]pu8OutOutput buffer (eg {0x11, 0x12, 0x13,...})
[in]pu8InInput buffer (eg {0x31, 0x31, 0x31, 0x32, 0x31, 0x33, ...})
[in]u8SizeOutLength of output buffer (should be half of the length of the input buffer).
Returns
M2M_SUCCESS if successful, M2M_ERR_INVALID_ARG otherwise (eg unrecognised hexchar in input).

References hexchar_2_val(), M2M_ERR_INVALID_ARG, and M2M_SUCCESS.

Referenced by m2m_wifi_connect_psk(), and m2m_wifi_connect_wep().

uint8 m2m_checksum ( uint8 buf,
int  sz 
)

Calculates checksum for the specified number of data bytes in specified data buffer.

Parameters
[in]szNumber of data bytes used in the checksum calculation.
[in]bufThe specified data buffer (whose data bytes will be used to calculate the checksum).
Returns
The calculated checksum.
sint8 m2m_memcmp ( uint8 pu8Buff1,
uint8 pu8Buff2,
uint32  u32Size 
)

Compare specified number of data bytes in pu8Buff1 and pu8Buff2 and decide if they all match.

Parameters
[in]u32SizeNumber of data bytes to compare.
[in]pu8Buff1One of two data buffers for the comparison.
[in]pu8Buff2One of two data buffers for the comparison.
Returns
Zero if matched, one if not matched.

References i.

Referenced by GetResponseCode(), ReadServerX509Chain(), and UpdateRootList().

void m2m_memset ( uint8 pBuf,
uint8  val,
uint32  sz 
)

Set specified number of data bytes in specified data buffer to specified value.

Parameters
[in]szNumber of data bytes (in specified data buffer whose values are to be set to the specified value).
[in]valThe specified value (to which data bytes in data buffer will be set).
[out]pBufThe specified data buffer (whose data bytes will be set to the specified value).
Returns
None

Referenced by close(), hif_deinit(), hif_init(), m2m_ota_cb(), m2m_wifi_1x_set_option(), m2m_wifi_cb(), m2m_wifi_connect_1x_mschap2(), m2m_wifi_connect_1x_tls(), m2m_wifi_connect_prepare_msg(), m2m_wifi_connect_psk(), m2m_wifi_delete_sc(), nm_get_firmware_full_info(), nm_get_ota_firmware_info(), nmi_get_otp_mac_address(), NMI_GrowldeInit(), NMI_GrowlInit(), post_main_page(), sendto(), socket(), socketDeinit(), socketInit(), and writeRootCertEntry().

uint16 m2m_strlen ( uint8 pcStr)

Returns the length of a null terminated string buffer.

Parameters
[in]pcStrNull terminated string buffer.
Returns
Length of the string in the specified string buffer.

Referenced by gethostbyname(), m2m_ota_host_file_get(), m2m_ota_notif_set_url(), m2m_ota_start_update(), m2m_strstr(), m2m_validate_ap_parameters(), m2m_wifi_connect_sc(), m2m_wifi_start_provision_mode_ext(), main(), NMI_GrowlSendNotification(), set_alpn_list(), set_dev_name_to_mac(), wifi_ap_connect(), and wifi_cb().

uint8 m2m_strncmp ( uint8 pcS1,
uint8 pcS2,
uint16  u16Len 
)

Compare specified number of data bytes in string buffers pcS1 and pcS2.

Parameters
[in]u16LenNumber of data bytes to compare.
[in]pcS1First of two string buffers for the comparison.
[in]pcS2Second of two string buffers for the comparison.
Returns
0 if matched, -1 if the first non-matching byte in pcS1 is smaller than that in pcS2, +1 if it is bigger.

Referenced by m2m_strstr(), and TlsSrvSecFopen().

uint8 * m2m_strstr ( uint8 pcIn,
uint8 pcStr 
)

Find the occurrence of pcStr string in pcIn string.

Parameters
[in]pcStrOne of two string buffers.
[in]pcInOne of two string buffers.
Returns
If pcStr string is part of pcIn string return a valid pointer to the start of pcStr within pcIn. If not, a NULL Pointer is returned.

References m2m_strlen(), and m2m_strncmp().

Referenced by AppServerCb().

void(* at_sb_printf)(const char *_format,...)

Chooses which function to use in order to output debug.