InPlay API
BLE GATT

BLE GATT. More...

Data Structures

struct  ble_gatt_sdp_t
 Service Discovery Procedure (SDP) More...
 
struct  ble_gatt_disc_t
 Attributes Discovery Structure. More...
 
struct  ble_gatt_read_simple_t
 Simple Read (GATT_READ or GATT_READ_LONG) More...
 
struct  ble_gatt_read_by_uuid_t
 
struct  ble_gatt_read_multiple_t
 Read Multiple short characteristic (GATT_READ_MULTIPLE) More...
 
union  ble_gatt_read_t
 request union according to read type More...
 
struct  ble_gatt_read_req_t
 Read command (Simple, Long, Multiple, or by UUID) More...
 
struct  ble_gatt_write_t
 Write peer attribute value. More...
 
struct  ble_gatt_att_desc_t
 Attribute Description. More...
 
struct  ble_gatt_svc_desc_t
 Service description. More...
 
struct  ble_att_val_t
 attribute value More...
 
struct  ble_att_perm_t
 attribute permission More...
 

Enumerations

enum  ble_gatt_sdp_att_type {
  IN_BLE_GATT_SDP_NONE, IN_BLE_GATT_SDP_INC_SVC, IN_BLE_GATT_SDP_ATT_CHAR, IN_BLE_GATT_SDP_ATT_VAL,
  IN_BLE_GATT_SDP_ATT_DESC
}
 Service Discovery Attribute type. More...
 
enum  ble_gatt_sdp_type { GATT_SDP_DISC_SVC, GATT_SDP_DISC_SVC_ALL, GATT_SDP_DISC_CANCEL }
 Gatt SDP type. More...
 
enum  ble_gatt_disc_type {
  GATT_DISC_ALL_SVC, GATT_DISC_BY_UUID_SVC, GATT_DISC_INCLUDED_SVC, GATT_DISC_ALL_CHAR,
  GATT_DISC_BY_UUID_CHAR, GATT_DISC_DESC_CHAR
}
 Gatt discovery type. More...
 
enum  ble_gatt_read_type { GATT_READ, GATT_READ_LONG, GATT_READ_BY_UUID, GATT_READ_MULTIPLE }
 Gatt read type. More...
 
enum  ble_gatt_write_type { GATT_WRITE, GATT_WRITE_NO_RESPONSE, GATT_WRITE_SIGNED, GATT_EXEC_WRITE }
 Gatt write type. More...
 

Functions

int in_ble_gatt_exc_mtu (void *hdl, int conidx, uint16_t *p_mtu, comp_cb callback)
 Exchange MTU request. More...
 
int in_ble_gatt_sdp (void *hdl, int conidx, int sdp_type, ble_gatt_sdp_t *p_sdp, comp_cb callback)
 Service Discovery Procedure. More...
 
int in_ble_gatt_discovery (void *hdl, int conidx, int disc_type, ble_gatt_disc_t *p_disc, comp_cb callback)
 Attributes Discovery. More...
 
int in_ble_gatt_read (void *hdl, int conidx, int read_type, ble_gatt_read_req_t *p_req, comp_cb callback)
 Read Attribute. More...
 
int in_ble_gatt_write (void *hdl, int conidx, int wrt_type, ble_gatt_write_t *p_write, comp_cb callback)
 Write Attribute. More...
 
int in_ble_gatt_excute_write (void *hdl, int conidx, bool execute, comp_cb callback)
 Execute Write command for queue writes. More...
 
int in_ble_gatt_register_ind_ntf_event (void *hdl, int conidx, bool reg, uint32_t start_hdl, uint32_t end_hdl, comp_cb callback)
 Registration to peer device events (Indication/Notification) More...
 
int in_ble_gatt_indication_cfm (void *hdl, int conidx, uint16_t handle)
 Confirm receive Indication. More...
 
int in_ble_gatt_send_ind (void *hdl, int conidx, uint32_t handle, uint32_t length, uint8_t *value, comp_cb callback)
 Send indication. More...
 
int in_ble_gatt_send_ntf (void *hdl, int conidx, uint32_t handle, uint32_t length, uint8_t *value, comp_cb callback)
 Send notification. More...
 
int in_ble_gatt_send_svc_changed (void *hdl, int conidx, uint32_t svc_shdl, uint32_t svc_ehdl, comp_cb callback)
 Inform Service changed. More...
 
int in_ble_gatt_add_svc (void *hdl, ble_gatt_svc_desc_t *p_svc, uint16_t *p_hdl, comp_cb callback)
 Add a new Service
More...
 
int in_ble_gatt_get_svc_perm (void *hdl, uint16_t start_hdl, uint8_t *p_perm, comp_cb callback)
 Retrieve service attribute permission
More...
 
int in_ble_gatt_set_svc_perm (void *hdl, uint16_t start_hdl, uint8_t perm, comp_cb callback)
 Set service attribute permission
More...
 
int in_ble_gatt_get_att_perm (void *hdl, uint16_t handle, ble_att_perm_t *p_perm, comp_cb callback)
 Retrieve attribute permission
More...
 
int in_ble_gatt_set_att_perm (void *hdl, uint16_t handle, uint16_t perm, uint16_t ext_perm, comp_cb callback)
 Set attribute permission
More...
 
int in_ble_gatt_get_att_value (void *hdl, uint16_t handle, ble_att_val_t *p_att_val, comp_cb callback)
 Retrieve attribute value
More...
 
int in_ble_gatt_set_att_value (void *hdl, uint16_t handle, uint16_t length, uint8_t *value, comp_cb callback)
 Set attribute value
More...
 
int in_ble_gatt_att_info_req_cfm (void *hdl, int conidx, uint16_t handle, uint16_t length, uint8_t status)
 Confirm attribute prepare write reqeust
More...
 
int in_ble_gatt_write_req_cfm (void *hdl, uint8_t conidx, uint16_t handle, uint8_t status)
 Confirm attribute write reqeust
More...
 
int in_ble_gatt_read_req_cfm (void *hdl, uint8_t conidx, uint16_t handle, uint8_t status, uint16_t length, uint8_t *value)
 Confirm attribute read reqeust
More...
 

Detailed Description

BLE GATT.

Enumeration Type Documentation

◆ ble_gatt_disc_type

Gatt discovery type.

Enumerator
GATT_DISC_ALL_SVC 

Discover all services.

GATT_DISC_BY_UUID_SVC 

Discover services by UUID.

GATT_DISC_INCLUDED_SVC 

Discover included services.

GATT_DISC_ALL_CHAR 

Discover all characteristics.

GATT_DISC_BY_UUID_CHAR 

Discover characteristic by UUID.

GATT_DISC_DESC_CHAR 

Discover characteristic descriptor.

◆ ble_gatt_read_type

Gatt read type.

Enumerator
GATT_READ 

Read attribute.

GATT_READ_LONG 

Read long attribute.

GATT_READ_BY_UUID 

Read attribute by UUID.

GATT_READ_MULTIPLE 

Read multiple attribute.

◆ ble_gatt_sdp_att_type

Service Discovery Attribute type.

Enumerator
IN_BLE_GATT_SDP_NONE 

No Attribute Information.

IN_BLE_GATT_SDP_INC_SVC 

Included Service Information.

IN_BLE_GATT_SDP_ATT_CHAR 

Characteristic Declaration.

IN_BLE_GATT_SDP_ATT_VAL 

Attribute Value.

IN_BLE_GATT_SDP_ATT_DESC 

Attribute Descriptor.

◆ ble_gatt_sdp_type

Gatt SDP type.

Enumerator
GATT_SDP_DISC_SVC 

Search specific service.

GATT_SDP_DISC_SVC_ALL 

Search for all services.

GATT_SDP_DISC_CANCEL 

Cancel Service Discovery Procedure.

◆ ble_gatt_write_type

Gatt write type.

Enumerator
GATT_WRITE 

Write attribute.

GATT_WRITE_NO_RESPONSE 

Write no response.

GATT_WRITE_SIGNED 

Write signed.

GATT_EXEC_WRITE 

Execute write.

Function Documentation

◆ in_ble_gatt_add_svc()

int in_ble_gatt_add_svc ( void *  hdl,
ble_gatt_svc_desc_t p_svc,
uint16_t *  p_hdl,
comp_cb  callback 
)

Add a new Service

Note
This can only issue by the Server.
Parameters
[in]p_svcPointer to service data structure
[out]p_hdlService handle
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_att_info_req_cfm()

int in_ble_gatt_att_info_req_cfm ( void *  hdl,
int  conidx,
uint16_t  handle,
uint16_t  length,
uint8_t  status 
)

Confirm attribute prepare write reqeust

Note
This can only issue by the Server.
Parameters
[in]conidxConnection index
[in]handleAttribute handle
[in]lengthWrite length
[in]statusWrite status
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_discovery()

int in_ble_gatt_discovery ( void *  hdl,
int  conidx,
int  disc_type,
ble_gatt_disc_t p_disc,
comp_cb  callback 
)

Attributes Discovery.

Note
This can only issue by the Client.
Parameters
[in]conidxConnection index
[in]disc_typeAttribute discovery type,
See also
enum in_ble_gatt_disc_type
Parameters
[in]p_discPointer to attribute discovery paramters
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_exc_mtu()

int in_ble_gatt_exc_mtu ( void *  hdl,
int  conidx,
uint16_t *  p_mtu,
comp_cb  callback 
)

Exchange MTU request.

Note
This can only issue by the Client.
Parameters
[in]conidxConnection index
[out]p_mtuPointer to the server's max MTU size
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_excute_write()

int in_ble_gatt_excute_write ( void *  hdl,
int  conidx,
bool  execute,
comp_cb  callback 
)

Execute Write command for queue writes.

Note
This can only issue by the Client.
Parameters
[in]conidxConnection index
[in]executeTrue: execute, false: cancel
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_get_att_perm()

int in_ble_gatt_get_att_perm ( void *  hdl,
uint16_t  handle,
ble_att_perm_t p_perm,
comp_cb  callback 
)

Retrieve attribute permission

Note
This can only issue by the Server.
Parameters
[in]handleAttribute handle
[out]p_permPointer to return attribute permission
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_get_att_value()

int in_ble_gatt_get_att_value ( void *  hdl,
uint16_t  handle,
ble_att_val_t p_att_val,
comp_cb  callback 
)

Retrieve attribute value

Note
This can only issue by the Server.
Parameters
[in]handleAttribute handle
[out]p_att_valPointer to return attribute value
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_get_svc_perm()

int in_ble_gatt_get_svc_perm ( void *  hdl,
uint16_t  start_hdl,
uint8_t *  p_perm,
comp_cb  callback 
)

Retrieve service attribute permission

Note
This can only issue by the Server.
Parameters
[in]start_hdlService attribute handle
[out]p_permService attribute permission,
See also
enum in_ble_att_svc_perm_mask
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_indication_cfm()

int in_ble_gatt_indication_cfm ( void *  hdl,
int  conidx,
uint16_t  handle 
)

Confirm receive Indication.

Note
This can only issue by the Client.
Parameters
[in]conidxConnection index
[in]handlePeer attribute handle
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_read()

int in_ble_gatt_read ( void *  hdl,
int  conidx,
int  read_type,
ble_gatt_read_req_t p_req,
comp_cb  callback 
)

Read Attribute.

Note
This can only issue by the Client.
Parameters
[in]conidxConnection index
[in]read_typeAttribute read type,
See also
enum in_ble_gatt_read_type
Parameters
[in]p_reqPointer to attribute read paramters
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_read_req_cfm()

int in_ble_gatt_read_req_cfm ( void *  hdl,
uint8_t  conidx,
uint16_t  handle,
uint8_t  status,
uint16_t  length,
uint8_t *  value 
)

Confirm attribute read reqeust

Note
This can only issue by the Server.
Parameters
[in]conidxConnection index
[in]handleAttribute handle
[in]statusAttribute Read status
[in]lengthAttribute Read value length
[in]valueAttribute Read value
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_register_ind_ntf_event()

int in_ble_gatt_register_ind_ntf_event ( void *  hdl,
int  conidx,
bool  reg,
uint32_t  start_hdl,
uint32_t  end_hdl,
comp_cb  callback 
)

Registration to peer device events (Indication/Notification)

Note
This can only issue by the Client.
Parameters
[in]conidxConnection index
[in]regTrue: regiter, false: unregister
[in]start_hdlPeer attribute start handle
[in]end_hdlPeer attribute end handle
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_sdp()

int in_ble_gatt_sdp ( void *  hdl,
int  conidx,
int  sdp_type,
ble_gatt_sdp_t p_sdp,
comp_cb  callback 
)

Service Discovery Procedure.

Note
This can only issue by the Client.
Parameters
[in]conidxConnection index
[in]sdp_typeService Discovery Type,
See also
enum in_ble_gatt_sdp_type
Parameters
[in]p_sdpPointer to service discovery paramters
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_send_ind()

int in_ble_gatt_send_ind ( void *  hdl,
int  conidx,
uint32_t  handle,
uint32_t  length,
uint8_t *  value,
comp_cb  callback 
)

Send indication.

Note
This can only issue by the Server.
Parameters
[in]conidxConnection index
[in]handleInidcation attribute handle
[in]lengthInidcation attribute value length
[in]valueInidcation attribute value
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_send_ntf()

int in_ble_gatt_send_ntf ( void *  hdl,
int  conidx,
uint32_t  handle,
uint32_t  length,
uint8_t *  value,
comp_cb  callback 
)

Send notification.

Note
This can only issue by the Server.
Parameters
[in]conidxConnection index
[in]handleNotification attribute handle
[in]lengthNotification attribute value length
[in]valueNotification attribute value
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_send_svc_changed()

int in_ble_gatt_send_svc_changed ( void *  hdl,
int  conidx,
uint32_t  svc_shdl,
uint32_t  svc_ehdl,
comp_cb  callback 
)

Inform Service changed.

Note
This can only issue by the Server.
Parameters
[in]conidxConnection index
[in]svc_shdlService start handle
[in]svc_ehdlService end handle
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_set_att_perm()

int in_ble_gatt_set_att_perm ( void *  hdl,
uint16_t  handle,
uint16_t  perm,
uint16_t  ext_perm,
comp_cb  callback 
)

Set attribute permission

Note
This can only issue by the Server.
Parameters
[in]handleAttribute handle
[in]permAttribute permission,
See also
enum in_ble_att_perm_mask
Parameters
[in]ext_permAttribute extended permission,
See also
enum in_ble_att_value_perm_mask
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_set_att_value()

int in_ble_gatt_set_att_value ( void *  hdl,
uint16_t  handle,
uint16_t  length,
uint8_t *  value,
comp_cb  callback 
)

Set attribute value

Note
This can only issue by the Server.
Parameters
[in]handleAttribute handle
[in]lengthAttribute value length
[in]valuePointer to the attribute value
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_set_svc_perm()

int in_ble_gatt_set_svc_perm ( void *  hdl,
uint16_t  start_hdl,
uint8_t  perm,
comp_cb  callback 
)

Set service attribute permission

Note
This can only issue by the Server.
Parameters
[in]start_hdlService attribute handle
[in]permService attribute permission,
See also
enum in_ble_att_svc_perm_mask
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_write()

int in_ble_gatt_write ( void *  hdl,
int  conidx,
int  wrt_type,
ble_gatt_write_t p_write,
comp_cb  callback 
)

Write Attribute.

Note
This can only issue by the Client.
Parameters
[in]conidxConnection index
[in]wrt_typeAttribute write type,
See also
enum in_ble_gatt_write_type
Parameters
[in]p_writePointer to attribute write paramters
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t

◆ in_ble_gatt_write_req_cfm()

int in_ble_gatt_write_req_cfm ( void *  hdl,
uint8_t  conidx,
uint16_t  handle,
uint8_t  status 
)

Confirm attribute write reqeust

Note
This can only issue by the Server.
Parameters
[in]conidxConnection index
[in]handleAttribute handle
[in]statusWrite status
Returns
IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
See also
enum in_ble_err_t