WE310F5  39.00.000
M2MB BLE Provisioning

This section describes the M2MB APIs for WIP(Wireless(BLE) Interface Provisioning) More...

#define WIP_SERVICE_UUID_CONSTANT   {0x36, 0x11}
 
#define WIP_CHAR_SCAN_TRIGGER_UUID_CONSTANT   {0x37, 0x11}
 
#define WIP_CHAR_SCAN_DATA_UUID_CONSTANT   {0x38, 0x11}
 
#define WIP_CHAR_CONFIG_DATA_UUID_CONSTANT   {0x39, 0x11}
 
#define WIP_CHAR_STATUS_UUID_CONSTANT   {0x40, 0x11}
 
#define WIP_CREDITS_SCAN_TRIGGER_ATTRIBUTE_OFFSET   2
 
#define WIP_CREDITS_SCAN_DATA_ATTRIBUTE_OFFSET   4
 
#define WIP_CREDITS_SCAN_DATA_NOTIFICATION_ATTRIBUTE_OFFSET   5
 
#define WIP_CREDITS_CONIFG_DATA_ATTRIBUTE_OFFSET   7
 
#define WIP_CREDITS_STATUS_ATTRIBUTE_OFFSET   9
 
#define WIP_CREDITS_STATUS_NOTIFICATION_ATTRIBUTE_OFFSET   10
 
INT32 m2mb_wip_service_register (M2MB_BLE_HANDLE ble_handle)
 This function is used to register the WIP(Wireless(BLE) Interface Provisioning) Service. More...
 
VOID m2mb_wip_service_deregister (VOID)
 This function is used to de-register the WIP(Wireless(BLE) Interface Provisioning) Service. More...
 

Detailed Description

This section describes the M2MB APIs for WIP(Wireless(BLE) Interface Provisioning)

Macro Definition Documentation

◆ WIP_CHAR_CONFIG_DATA_UUID_CONSTANT

#define WIP_CHAR_CONFIG_DATA_UUID_CONSTANT   {0x39, 0x11}

Status Characteristics UUID constant

Definition at line 51 of file m2mb_ble_prov.h.

◆ WIP_CHAR_SCAN_DATA_UUID_CONSTANT

#define WIP_CHAR_SCAN_DATA_UUID_CONSTANT   {0x38, 0x11}

Configuration Data Characteristics UUID constant

Definition at line 49 of file m2mb_ble_prov.h.

◆ WIP_CHAR_SCAN_TRIGGER_UUID_CONSTANT

#define WIP_CHAR_SCAN_TRIGGER_UUID_CONSTANT   {0x37, 0x11}

Scan Data Characteristics UUID constant

Definition at line 47 of file m2mb_ble_prov.h.

◆ WIP_CHAR_STATUS_UUID_CONSTANT

#define WIP_CHAR_STATUS_UUID_CONSTANT   {0x40, 0x11}

The following define characteristics attribute offset Scan Trigger Characteristics attribute offset

Definition at line 53 of file m2mb_ble_prov.h.

◆ WIP_CREDITS_CONIFG_DATA_ATTRIBUTE_OFFSET

#define WIP_CREDITS_CONIFG_DATA_ATTRIBUTE_OFFSET   7

Status Characteristics attribute offset

Definition at line 64 of file m2mb_ble_prov.h.

◆ WIP_CREDITS_SCAN_DATA_ATTRIBUTE_OFFSET

#define WIP_CREDITS_SCAN_DATA_ATTRIBUTE_OFFSET   4

Scan Data notifications attribute offset

Definition at line 60 of file m2mb_ble_prov.h.

◆ WIP_CREDITS_SCAN_DATA_NOTIFICATION_ATTRIBUTE_OFFSET

#define WIP_CREDITS_SCAN_DATA_NOTIFICATION_ATTRIBUTE_OFFSET   5

Configuration Data Characteristics attribute offset

Definition at line 62 of file m2mb_ble_prov.h.

◆ WIP_CREDITS_SCAN_TRIGGER_ATTRIBUTE_OFFSET

#define WIP_CREDITS_SCAN_TRIGGER_ATTRIBUTE_OFFSET   2

Scan Data Characteristics attribute offset

Definition at line 58 of file m2mb_ble_prov.h.

◆ WIP_CREDITS_STATUS_ATTRIBUTE_OFFSET

#define WIP_CREDITS_STATUS_ATTRIBUTE_OFFSET   9

Status attribute offset

Definition at line 66 of file m2mb_ble_prov.h.

◆ WIP_CREDITS_STATUS_NOTIFICATION_ATTRIBUTE_OFFSET

#define WIP_CREDITS_STATUS_NOTIFICATION_ATTRIBUTE_OFFSET   10

Definition at line 68 of file m2mb_ble_prov.h.

◆ WIP_SERVICE_UUID_CONSTANT

#define WIP_SERVICE_UUID_CONSTANT   {0x36, 0x11}

< The following define WIP(Wireless(BLE) Interface Provisioning) Services and characteristics UUIDs < The following define service UUID constant Scan Trigger Characteristics UUID constant

Definition at line 45 of file m2mb_ble_prov.h.

Function Documentation

◆ m2mb_wip_service_deregister()

VOID m2mb_wip_service_deregister ( VOID  )

This function is used to de-register the WIP(Wireless(BLE) Interface Provisioning) Service.

This function is used to de-register the WIP(Wireless(BLE) Interface Provisioning) Service.

Returns
None.
Note
<Notes>

Example

int main()
{
M2MB_STATUS_T retVal;
// Call the service registration API
...
if(retVal != 0)
{
M2MB_WIP_DEBUG_PRINTF("WIP registering service failed\r\n");
return M2MB_ERROR;
}
// Call the service de-registration API
return;
}

◆ m2mb_wip_service_register()

INT32 m2mb_wip_service_register ( M2MB_BLE_HANDLE  ble_handle)

This function is used to register the WIP(Wireless(BLE) Interface Provisioning) Service.

This function is used to register the WIP(Wireless(BLE) Interface Provisioning) Service. if this function is successfull,it will rerturn Zero else error.

Returns
Zero if successful.
An error code.
Note
<Notes>

Example

int main()
{
UINT32 advEnable = 1;
M2MB_STATUS_T retVal;
VOID * wipCtx = NULL;
VOID * blePairCtx = NULL;
UINT8 custAdvEnable = 1;
M2MB_BLE_GAP_LE_ADVERTISING_PARAMETERS_T advParam;
// Call the service registration API
...
if(retVal != 0)
{
M2MB_WIP_DEBUG_PRINTF("WIP registering service failed\r\n");
return M2MB_ERROR;
}
advParam.Advertising_Interval_Min = 1280;
advParam.Advertising_Interval_Max = 1280;
m2mb_ble_advParamSet(advParam);
m2mb_ble_advteriseDataInit(custAdvEnable);
m2mb_ble_scanRespDataInit(custAdvEnable);
// Call the advertise enable API
...
retVal = m2mb_ble_advertise(advEnable);
if(retVal != 0)
{
M2MB_WIP_DEBUG_PRINTF("Adrvertise Failed\r\n");
return M2MB_ERROR;
}
m2mb_prov_cfg_nwk_provisioning(cfg);
m2mb_ble_set_get_connection_cb(wipCtx,m2mb_wip_gatt_connection_cb);
m2mb_ble_set_pairing_status_cb(blePairCtx,m2mb_wip_pairing_status_cb);
return M2MB_OK;
}