InPlay API
BLE Alert Notification Service

BLE Alert Notification Service. More...

Data Structures

struct  ble_anp_prf_t
 Category ID Field Keys. More...
 
struct  ble_anps_cfg_t
 Parameters of the ANPS_ENABLE_REQ message. More...
 

Macros

#define BLE_ANS_NEW_ALERT_STRING_INFO_MAX_LEN   (18)
 New Alert Characteristic Value - Text String Information Max Length.
 

Enumerations

enum  ble_anp_ntf_category_id_bits
 Alert Category ID Bit Mask 0 Masks.
 
enum  ble_anp_alert_type { BLE_ANP_NEW_ALERT = 0 }
 Alert codes. More...
 
enum  ble_anp_evt
 Events defines for ANP Services.
 
enum  ble_pasp_ringer_setting { BLE_PASP_RINGER_SILENT = (0) }
 Ringer setting. More...
 
enum  ble_pasp_alert_status { BLE_PASP_RINGER_ACTIVE = (0x01) }
 Alert status. More...
 
enum  ble_pasp_cmd { BLE_PASP_SILENT_MODE_CMD = (1) }
 Command. More...
 
enum  ble_pasp_evt
 Events defines for ANP Services.
 

Functions

int in_ble_anps_add (void *hdl, ble_anp_prf_t *p_prf, comp_cb callback)
 Add ANP Server Service. More...
 
int in_ble_anps_enable (void *hdl, int conidx, struct anps_enable_rsp *p_rsp, comp_cb callback)
 Enable ANP service. More...
 
int in_ble_anps_notify_alert (void *hdl, int conidx, enum ble_anp_alert_type alert_type, ble_anp_notify_alert_value value, struct anps_cmp_evt *p_rsp, comp_cb callback)
 Send new alert notification or indication to peer device. More...
 
int in_ble_anpc_add (void *hdl, ble_anp_prf_t *p_prf, comp_cb callback)
 Add ANP Client Service. More...
 
int in_ble_anpc_enable (void *hdl, int conidx, struct anpc_enable_rsp *p_rsp, comp_cb callback)
 Enable ANP client. More...
 
int in_ble_anpc_get_ntf_supp_categroy (void *hdl, int conidx, enum ble_anp_alert_type alert_type, enum ble_anp_ntf_category_id_bits *p_supp_cat, comp_cb callback)
 Get ANP server supported category. More...
 
int in_ble_anpc_get_ntf_status (void *hdl, int conidx, enum ble_anp_alert_type alert_type, enum ble_ntf_cfg *p_alert_ntf_cfg, comp_cb callback)
 Get ANP server notification status. More...
 
int in_ble_anpc_set_ntf_status (void *hdl, int conidx, enum ble_anp_alert_type alert_type, enum ble_ntf_cfg alert_ntf_cfg, comp_cb callback)
 Get ANP server notification status. More...
 
int in_ble_anpc_set_ntf_cat_status (void *hdl, int conidx, enum ble_anp_alert_type alert_type, enum ble_anp_ntf_category_id_bits cat_id, enum ble_ntf_cfg ntf_cfg, comp_cb callback)
 Set ANP server notification status for individual category. More...
 
int in_ble_anpc_req_ntf_immediately (void *hdl, int conidx, enum ble_anp_alert_type alert_type, enum ble_anp_ntf_category_id_bits cat_id, comp_cb callback)
 Ask ANP server to send notification immediately for individual category. More...
 
int in_ble_pasps_add (void *hdl, ble_pasp_prf_t *p_prf, comp_cb callback)
 Add PASP service. It's the first function called. More...
 
int in_ble_pasps_enable (void *hdl, int conidx, comp_cb callback)
 Enable PASP service. More...
 
int in_ble_pasps_update_alert_status (void *hdl, int conidx, enum ble_pasp_alert_status alert_status, comp_cb callback)
 Update phone alert status in PASP service. More...
 
int in_ble_pasps_update_ringer_setting (void *hdl, int conidx, enum ble_pasp_ringer_setting ringer_setting, comp_cb callback)
 Update phone ringer setting in PASP service. More...
 
int in_ble_paspc_add (void *hdl, ble_pasp_prf_t *p_prf, comp_cb callback)
 Add PASP client. It's the first function called. More...
 
int in_ble_paspc_enable (void *hdl, int conidx, struct paspc_enable_rsp *p_rsp, comp_cb callback)
 Enable PASP client. More...
 
int in_ble_paspc_get_alert_status (void *hdl, int conidx, enum ble_pasp_alert_status *pAlertStatus, comp_cb callback)
 Get PASP server's Alert Status value. More...
 
int in_ble_paspc_get_ringer_setting (void *hdl, int conidx, enum ble_pasp_ringer_setting *pRingerSetting, comp_cb callback)
 Get PASP server's Ringer Settting value. More...
 
int in_ble_paspc_get_alert_status_ntf_cfg (void *hdl, int conidx, enum ble_ntf_cfg *pCfg, comp_cb callback)
 Get PASP server's Alert Status notification config, Started or Stopped. More...
 
int in_ble_paspc_set_alert_status_ntf_cfg (void *hdl, int conidx, enum ble_ntf_cfg cfg, comp_cb callback)
 Set PASP server's Alert Status notification config, Start or Stop. More...
 
int in_ble_paspc_get_ringer_setting_ntf_cfg (void *hdl, int conidx, enum ble_ntf_cfg *pCfg, comp_cb callback)
 Get PASP server's Ringer Setting notification config, Started or Stopped. More...
 
int in_ble_paspc_set_ringer_setting_ntf_cfg (void *hdl, int conidx, enum ble_ntf_cfg cfg, comp_cb callback)
 Set PASP server's Ringer Setting notification config, Start or Stop. More...
 
int in_ble_paspc_ringer_control (void *hdl, int conidx, enum ble_pasp_cmd ctrlCmd, comp_cb callback)
 Set PASP server's Ringer Setting notification config, Start or Stop. More...
 

Detailed Description

BLE Alert Notification Service.

Enumeration Type Documentation

◆ ble_anp_alert_type

Alert codes.

Enumerator
BLE_ANP_NEW_ALERT 

New Alert.

◆ ble_pasp_alert_status

Alert status.

Enumerator
BLE_PASP_RINGER_ACTIVE 

Alert Status Flags.

◆ ble_pasp_cmd

Command.

Enumerator
BLE_PASP_SILENT_MODE_CMD 

Ringer Control Point Keys.

◆ ble_pasp_ringer_setting

Ringer setting.

Enumerator
BLE_PASP_RINGER_SILENT 

Ringer Settings Keys.

Function Documentation

◆ in_ble_anpc_add()

int in_ble_anpc_add ( void *  hdl,
ble_anp_prf_t p_prf,
comp_cb  callback 
)

Add ANP Client Service.

Note
Add it after device configuration, but before any activity starts
Parameters
[in]p_prfPointer to profile attributes,
See also
in_ble_anp_prf_t
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_anpc_enable()

int in_ble_anpc_enable ( void *  hdl,
int  conidx,
struct anpc_enable_rsp *  p_rsp,
comp_cb  callback 
)

Enable ANP client.

Parameters
[in]conidxconnection index
Note
It is called after connection or reconnection with a central device has been established
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_anpc_get_ntf_status()

int in_ble_anpc_get_ntf_status ( void *  hdl,
int  conidx,
enum ble_anp_alert_type  alert_type,
enum ble_ntf_cfg p_alert_ntf_cfg,
comp_cb  callback 
)

Get ANP server notification status.

Parameters
[in]conidxconnection index
[in]alert_typealert type
See also
in_ble_anp_alert_type
Parameters
[in]p_alert_ntf_cfgbutter to receive
See also
in_ble_ntf_cfg
Note
It is called after connection or reconnection with a central device has been established
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_INVALID_PARAM
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_anpc_get_ntf_supp_categroy()

int in_ble_anpc_get_ntf_supp_categroy ( void *  hdl,
int  conidx,
enum ble_anp_alert_type  alert_type,
enum ble_anp_ntf_category_id_bits p_supp_cat,
comp_cb  callback 
)

Get ANP server supported category.

Parameters
[in]conidxconnection index
[in]alert_typealert type
See also
in_ble_anp_alert_type
Parameters
[in]p_supp_catbutter to receive
See also
in_ble_anp_ntf_category_id_bits
Note
It is called after connection or reconnection with a central device has been established
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_INVALID_PARAM
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_anpc_req_ntf_immediately()

int in_ble_anpc_req_ntf_immediately ( void *  hdl,
int  conidx,
enum ble_anp_alert_type  alert_type,
enum ble_anp_ntf_category_id_bits  cat_id,
comp_cb  callback 
)

Ask ANP server to send notification immediately for individual category.

Parameters
[in]conidxconnection index
[in]alert_typealert type
See also
in_ble_anp_alert_type
Parameters
[in]cat_idcontent to send
See also
in_ble_anp_ntf_category_id_bits
Note
It is called after connection or reconnection with a central device has been established
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_INVALID_PARAM
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_anpc_set_ntf_cat_status()

int in_ble_anpc_set_ntf_cat_status ( void *  hdl,
int  conidx,
enum ble_anp_alert_type  alert_type,
enum ble_anp_ntf_category_id_bits  cat_id,
enum ble_ntf_cfg  ntf_cfg,
comp_cb  callback 
)

Set ANP server notification status for individual category.

Parameters
[in]conidxconnection index
[in]alert_typealert type
See also
in_ble_anp_alert_type
Parameters
[in]cat_id
[in]ntf_cfgcontent to send
See also
in_ble_ntf_cfg
Note
It is called after connection or reconnection with a central device has been established
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_INVALID_PARAM
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_anpc_set_ntf_status()

int in_ble_anpc_set_ntf_status ( void *  hdl,
int  conidx,
enum ble_anp_alert_type  alert_type,
enum ble_ntf_cfg  alert_ntf_cfg,
comp_cb  callback 
)

Get ANP server notification status.

Parameters
[in]conidxconnection index
[in]alert_typealert type
See also
in_ble_anp_alert_type
Parameters
[in]alert_ntf_cfgcontent to send
See also
in_ble_ntf_cfg
Note
It is called after connection or reconnection with a central device has been established
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_INVALID_PARAM
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_anps_add()

int in_ble_anps_add ( void *  hdl,
ble_anp_prf_t p_prf,
comp_cb  callback 
)

Add ANP Server Service.

Note
Add it after device configuration, but before any activity starts
Parameters
[in]p_prfPointer to profile attributes,
See also
in_ble_anp_prf_t
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_anps_enable()

int in_ble_anps_enable ( void *  hdl,
int  conidx,
struct anps_enable_rsp *  p_rsp,
comp_cb  callback 
)

Enable ANP service.

Parameters
[in]conidxconnection index
Note
It is called after connection or reconnection with a peer device has been established in order to restore previous config on that connection
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_anps_notify_alert()

int in_ble_anps_notify_alert ( void *  hdl,
int  conidx,
enum ble_anp_alert_type  alert_type,
ble_anp_notify_alert_value  value,
struct anps_cmp_evt *  p_rsp,
comp_cb  callback 
)

Send new alert notification or indication to peer device.

Parameters
[in]conidxconnection index
[in]alert_typealert type
See also
in_ble_anp_alert_type
Parameters
[in]valuenew alert or unread alert content
See also
in_ble_anp_notify_alert_value
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_INVALID_PARAM
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_paspc_add()

int in_ble_paspc_add ( void *  hdl,
ble_pasp_prf_t *  p_prf,
comp_cb  callback 
)

Add PASP client. It's the first function called.

Parameters
[in]p_prfPointer to profile attributes,
See also
in_ble_pasp_prf_t
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_paspc_enable()

int in_ble_paspc_enable ( void *  hdl,
int  conidx,
struct paspc_enable_rsp *  p_rsp,
comp_cb  callback 
)

Enable PASP client.

Parameters
[in]conidxconnection index
Note
It is called after connection or reconnection with a central device has been established
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_paspc_get_alert_status()

int in_ble_paspc_get_alert_status ( void *  hdl,
int  conidx,
enum ble_pasp_alert_status pAlertStatus,
comp_cb  callback 
)

Get PASP server's Alert Status value.

Parameters
[in]conidxconnection index
[in]pAlertStatusbutter to receive
See also
in_ble_pasp_alert_status
Note
It is called after connection or reconnection with a central device has been established
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_INVALID_PARAM
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_paspc_get_alert_status_ntf_cfg()

int in_ble_paspc_get_alert_status_ntf_cfg ( void *  hdl,
int  conidx,
enum ble_ntf_cfg pCfg,
comp_cb  callback 
)

Get PASP server's Alert Status notification config, Started or Stopped.

Parameters
[in]conidxconnection index
[in]pCfgbutter to receive
See also
in_ble_ntf_cfg
Note
It is called after connection or reconnection with a central device has been established
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_INVALID_PARAM
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_paspc_get_ringer_setting()

int in_ble_paspc_get_ringer_setting ( void *  hdl,
int  conidx,
enum ble_pasp_ringer_setting pRingerSetting,
comp_cb  callback 
)

Get PASP server's Ringer Settting value.

Parameters
[in]conidxconnection index
[in]pRingerSettingbutter to receive
See also
in_ble_pasp_ringer_setting
Note
It is called after connection or reconnection with a central device has been established
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_INVALID_PARAM
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_paspc_get_ringer_setting_ntf_cfg()

int in_ble_paspc_get_ringer_setting_ntf_cfg ( void *  hdl,
int  conidx,
enum ble_ntf_cfg pCfg,
comp_cb  callback 
)

Get PASP server's Ringer Setting notification config, Started or Stopped.

Parameters
[in]conidxconnection index
[in]pCfgbutter to receive
See also
in_ble_ntf_cfg
Note
It is called after connection or reconnection with a central device has been established
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_INVALID_PARAM
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_paspc_ringer_control()

int in_ble_paspc_ringer_control ( void *  hdl,
int  conidx,
enum ble_pasp_cmd  ctrlCmd,
comp_cb  callback 
)

Set PASP server's Ringer Setting notification config, Start or Stop.

Parameters
[in]conidxconnection index
[in]ctrlCmdRinger Control Point command
See also
in_ble_pasp_cmd
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_paspc_set_alert_status_ntf_cfg()

int in_ble_paspc_set_alert_status_ntf_cfg ( void *  hdl,
int  conidx,
enum ble_ntf_cfg  cfg,
comp_cb  callback 
)

Set PASP server's Alert Status notification config, Start or Stop.

Parameters
[in]conidxconnection index
[in]cfgStart or Stop notification
See also
in_ble_ntf_cfg
Note
It is called after connection or reconnection with a central device has been established
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_paspc_set_ringer_setting_ntf_cfg()

int in_ble_paspc_set_ringer_setting_ntf_cfg ( void *  hdl,
int  conidx,
enum ble_ntf_cfg  cfg,
comp_cb  callback 
)

Set PASP server's Ringer Setting notification config, Start or Stop.

Parameters
[in]conidxconnection index
[in]cfgStart or Stop notification
See also
in_ble_ntf_cfg
Note
It is called after connection or reconnection with a central device has been established
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_pasps_add()

int in_ble_pasps_add ( void *  hdl,
ble_pasp_prf_t *  p_prf,
comp_cb  callback 
)

Add PASP service. It's the first function called.

Parameters
[in]p_prfPointer to profile attributes,
See also
in_ble_pasp_prf_t
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_pasps_enable()

int in_ble_pasps_enable ( void *  hdl,
int  conidx,
comp_cb  callback 
)

Enable PASP service.

Parameters
[in]conidxconnection index
Note
It is called after connection or reconnection with a peer device has been established in order to restore previous config on that connection
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_pasps_update_alert_status()

int in_ble_pasps_update_alert_status ( void *  hdl,
int  conidx,
enum ble_pasp_alert_status  alert_status,
comp_cb  callback 
)

Update phone alert status in PASP service.

Parameters
[in]conidxconnection index
[in]alert_statusnew phone alert status to update
See also
in_ble_pasp_alert_status
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_NO_MEM

◆ in_ble_pasps_update_ringer_setting()

int in_ble_pasps_update_ringer_setting ( void *  hdl,
int  conidx,
enum ble_pasp_ringer_setting  ringer_setting,
comp_cb  callback 
)

Update phone ringer setting in PASP service.

Parameters
[in]conidxconnection index
[in]ringer_settingnew ringer setting to update
See also
in_ble_pasp_ringer_setting
Returns
See also
IN_BLE_ERR_NO_ERROR
IN_BLE_PLT_ERR_NOT_READY
IN_BLE_PLT_ERR_NO_MEM