BLE
BLE Manager
Header File -
quick_dev/app_ref/mngr_api/ble_mngr_api.h
API List -
Functions -
Opl_Ble_Init_Req
- Prototype
T_OplErr Opl_Ble_Init_Req(uint8_t u8AutoAdvEn);
- Description
Ble manager initiate function
- Return
Reference to opl_err
- Parameters
u8AutoAdvEn:
true -> will enable auto-advertise while disconnect (also will enable advertise after init)
false -> will not enable auto-advertise while disconnect (also won't enable advertise after init)
Opl_Ble_Start_Req
- Prototype
T_OplErr Opl_Ble_Start_Req(uint8_t u8AutoAdvEn);
- Description
Start ble advertising
- Return
Reference to opl_err
- Parameters
U8AutoAdvEn: enable auto-advertise while disconnect
Opl_Ble_Stop_Req
- Prototype
T_OplErr Opl_Ble_Stop_Req(void);
- Description
Stop ble advertising
- Return
Reference to opl_err
- Parameters
None
Opl_Ble_Uslctd_CB_Reg
- Prototype
T_OplErr Opl_Ble_Uslctd_CB_Reg(T_BmUslctedCbFp fpUslctdCb);
- Description
Register unsolicited callback for ble manager
- Return
Reference to opl_err
- Parameters
fpUslctdCb: unsolicited callback function pointer
Opl_Ble_Send_Message
- Prototype
T_OplErr Opl_Ble_Send_Message(uint16_t u16Event, uint8_t *u8Data, uint32_t u32DataLen, uint32_t u32DelayMs);
- Description
Send message to task
- Return
Reference to opl_err
- Parameters
u16Event: event id (define by user)
u8Data: data send to ble manager
u32DataLen: data lens send to ble manager
u32DelayMs: delay time to trigger event
Opl_Ble_Service_Assign
- Prototype
T_OplErr Opl_Ble_Service_Assign(T_BmSvcHandle *ptBmSvcHandle);
- Description
Register ble service
- Return
Reference to opl_err
- Parameters
ptBmSvcHandle: ble service structure
Opl_Ble_Advertise_Data_Set
- Prototype
T_OplErr Opl_Ble_Advertise_Data_Set(uint8_t *pau8AdvData, uint8_t u8AdvDataLen);
- Description
Setting ble advertise data
- Return
Reference to opl_err
- Parameters
pau8AdvData: advertise data
u8AdvDataLen: advertise data Len
Opl_Ble_ScanRsp_Data_Set
- Prototype
T_OplErr Opl_Ble_ScanRsp_Data_Set(uint8_t *pau8ScanRspData, uint8_t u8ScanRspDataLen);
- Description
Setting ble scan respone data
- Return
Reference to opl_err
- Parameters
pau8ScanRspData: scan response data
u8ScanRspDataLen: scan response data len
Opl_Ble_EntityGet
- Prototype
BLE_APP_DATA_T *Opl_Ble_EntityGet(void);
- Description
Get ble task entity
- Return
G_tTheBle – success, Other – failed
- Parameters
None
Opl_Ble_MacAddr_Write
- Prototype
T_OplErr Opl_Ble_MacAddr_Write(uint8_t *pau8Data);
- Description
Write ble mac address
- Return
Reference to opl_err
- Parameters
Pau8Data: mac address array
Opl_Ble_MacAddr_Read
- Prototype
T_OplErr Opl_Ble_MacAddr_Read(uint8_t *pau8Data);
- Description
Read ble mac address
- Return
Reference to opl_err
- Parameters
Pau8Data: mac address array