WE310F5  39.00.000
m2mb_ble_util.h File Reference

BLE utilities. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "m2mb_types.h"
#include "m2mb_socket.h"
#include "m2mb_status.h"
#include "m2mb_ble_driver.h"

Go to the source code of this file.

Functions

VOID m2mb_ble_bdaddr_to_str (M2MB_BLE_BD_ADDR_T board_address, M2MB_BLE_BOARDSTR_T board_str)
 Convert BD address into string format. More...
 
M2MB_STATUS_T m2mb_ble_str_to_bdaddr (char *board_str, M2MB_BLE_BD_ADDR_T *board_address)
 Convert BD address into M2MB_BLE_BD_ADDR_T structure format. More...
 
M2MB_STATUS_T m2mb_ble_check_hex_string (INT8 *str)
 Checks the input HEX string is valid or not. More...
 
VOID m2mb_ble_hexStrToByteArray (UINT16 *len, UINT8 *hexStr, UINT8 *byteArray)
 Converts HEX string to byte array. More...
 
VOID m2mb_ble_ByteArrayToHexStr (UINT8 *byteArray, UINT16 byteArrayLen, UINT8 *hexStr)
 Converts byte array to HEX string. More...
 
VOID m2mb_ble_uuid16_StrToByteArray (char *hexstring, M2MB_BLE_UUID_16_T *uuid)
 Converts 16 bit UUID HEX string to byte array. More...
 
VOID m2mb_ble_uuid128_StrToByteArray (char *hexstring, M2MB_BLE_UUID_128_T *uuid)
 Converts 128 bit UUID HEX string to byte array. More...
 

Detailed Description

BLE utilities.

epl/inc/wireless/ble/m2mb_ble_util.h

This file contains the BLE utility APIs.

Note
<Notes, dependencies mandatory> Dependencies: m2mb_ble_driver.h
Author
Jyothi Swaroop
Date
25/02/2021

Definition in file m2mb_ble_util.h.

Function Documentation

◆ m2mb_ble_bdaddr_to_str()

VOID m2mb_ble_bdaddr_to_str ( M2MB_BLE_BD_ADDR_T  board_address,
M2MB_BLE_BOARDSTR_T  board_str 
)

Convert BD address into string format.

This API is used to convert BD address into string format.

Parameters
[in]board_addressBLE address in M2MB_BLE_BD_ADDR_T format
[out]board_strBLE address in string format
Returns
None

m2mb_ble_bdaddr_to_str(bd_addr, bd_addr_str);

◆ m2mb_ble_ByteArrayToHexStr()

VOID m2mb_ble_ByteArrayToHexStr ( UINT8 byteArray,
UINT16  byteArrayLen,
UINT8 hexStr 
)

Converts byte array to HEX string.

This API is used to convert byte array to HEX string.

Parameters
[in]byteArraybyte array
[in]byteArrayLennumber of bytes in byte array to be converted to HEX string
[out]hexStrHEX string
Returns
None

m2mb_ble_ByteArrayToHexStr(byte_array, length, hex_str);

◆ m2mb_ble_check_hex_string()

M2MB_STATUS_T m2mb_ble_check_hex_string ( INT8 str)

Checks the input HEX string is valid or not.

This API is used to checks the input HEX string is valid or not.

Parameters
[in]strHEX string
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error

m2mb_ble_check_hex_string(hex_str);

◆ m2mb_ble_hexStrToByteArray()

VOID m2mb_ble_hexStrToByteArray ( UINT16 len,
UINT8 hexStr,
UINT8 byteArray 
)

Converts HEX string to byte array.

This API is used to convert HEX string to byte array.

Parameters
[out]lennumber of bytes converted into byte array from HEX string
[in]hexStrHEX string
[out]byteArraybyte array
Returns
None

m2mb_ble_hexStrToByteArray(&length, hex_str, byte_array);

◆ m2mb_ble_str_to_bdaddr()

M2MB_STATUS_T m2mb_ble_str_to_bdaddr ( char *  board_str,
M2MB_BLE_BD_ADDR_T board_address 
)

Convert BD address into M2MB_BLE_BD_ADDR_T structure format.

This API is used to convert BD address into M2MB_BLE_BD_ADDR_T structure format.

Parameters
[in]board_strBLE address in string format
[out]board_addressBLE address in M2MB_BLE_BD_ADDR_T format
Returns
Returns M2MB_BLE_STATUS_SUCCESS_E on success / M2MB_BLE_STATUS_FAILURE_E on error

m2mb_ble_str_to_bdaddr(bd_addr_str, &bd_addr);

◆ m2mb_ble_uuid128_StrToByteArray()

VOID m2mb_ble_uuid128_StrToByteArray ( char *  hexstring,
M2MB_BLE_UUID_128_T uuid 
)

Converts 128 bit UUID HEX string to byte array.

This API is used to convert 128 bit UUID HEX string to byte array.

Parameters
[in]hexstringHEX string
[out]uuiduuid of strcut type M2MB_BLE_UUID_128_T
Returns
None

m2mb_ble_uuid16_StrToByteArray(hex_str, &uuid);

◆ m2mb_ble_uuid16_StrToByteArray()

VOID m2mb_ble_uuid16_StrToByteArray ( char *  hexstring,
M2MB_BLE_UUID_16_T uuid 
)

Converts 16 bit UUID HEX string to byte array.

This API is used to convert 16 bit UUID HEX string to byte array.

Parameters
[in]hexstringHEX string
[out]uuiduuid of strcut type M2MB_BLE_UUID_16_T
Returns
None

m2mb_ble_uuid16_StrToByteArray(hex_str, &uuid);