Cordio Stack and Cordio Profiles  r2p3-02rel0

Typedefs

typedef void(* UdsRspCback_t) (dmConnId_t connId, uint8_t opcode, uint8_t response, uint8_t index)
 UDS Control Point Response Callback. More...
 

Enumerations

enum  {
  UDSC_DBCI_HDL_IDX,
  UDSC_DCBI_CCC_HDL_IDX,
  UDSC_UI_HDL_IDX,
  UDSC_UCP_IDX,
  UDSC_UCP_CCC_HDL_IDX,
  UDSC_HDL_LIST_LEN
}
 UDSC service enumeration of handle indexes of characteristics to be discovered. More...
 

Functions

void UdscDiscover (dmConnId_t connId, uint16_t *pHdlList)
 Perform service and characteristic discovery for User Data service. Parameter pHdlList must point to an array of length UDSC_HDL_LIST_LEN. If discovery is successful the handles of discovered characteristics and descriptors will be set in pHdlList. More...
 
uint8_t UdscValueUpdate (uint16_t *pHdlList, attEvt_t *pMsg)
 Process a value received in an ATT read response, notification, or indication message. Parameter pHdlList must point to an array of length UDSC_HDL_LIST_LEN. If the ATT handle of the message matches a handle in the handle list the value is processed, otherwise it is ignored. More...
 
void UdscReadUserIndex (dmConnId_t connId, uint16_t handle)
 Read the user index characteristic. More...
 
void UdscReadDatabaseChangeIncrement (dmConnId_t connId, uint16_t handle)
 Read the database change increment characteristic. More...
 
void UdscWriteDatabaseChangeIncrement (dmConnId_t connId, uint16_t handle, uint32_t increment)
 Write the database change increment characteristic. More...
 
void UdscRegisterNewUser (dmConnId_t connId, uint16_t handle, uint16_t consentCode)
 Write to the user control point characteristic - Register New User. More...
 
void UdscConsent (dmConnId_t connId, uint16_t handle, uint8_t index, uint16_t consentCode)
 Write to the user control point characteristic - Consent. More...
 
void UdscDeleteUserData (dmConnId_t connId, uint16_t handle)
 Write to the user control point characteristic - Delete User Data. More...
 
void UdscClose (void)
 Called by the application when a connection closes. More...
 
void UdscInit (wsfHandlerId_t handlerId, uint8_t timerEvent, UdsRspCback_t rspCback)
 Initialize User Data Service collector callbacks. More...
 

User Control Point Opcodes

#define UDSC_UCP_OPCODE_RNU   0x01
 Register New User.
 
#define UDSC_UCP_OPCODE_CONSENT   0x02
 Consent.
 
#define UDSC_UCP_OPCODE_DUD   0x03
 Delete User Data.
 
#define UDSC_UCP_OPCODE_RESPONSE   0x20
 Command Response.
 

User Control Point Response Values

#define UDSC_UCP_RSP_SUCCESS   0x01
 Success.
 
#define UDSC_UCP_RSP_OP_NOT_SUPPORTED   0x02
 Opcode not supported.
 
#define UDSC_UCP_RSP_INVALID_PARAMETER   0x03
 Invalid Parameter.
 
#define UDSC_UCP_RSP_OP_FAILED   0x04
 Operation Failed.
 
#define UDSC_UCP_RSP_NOT_AUTHORIZED   0x05
 User Not Authorized.
 

Description

Typedef Documentation

typedef void(* UdsRspCback_t) (dmConnId_t connId, uint8_t opcode, uint8_t response, uint8_t index)

UDS Control Point Response Callback.

Parameters
connIdConnection ID.
opcodeCmd opcode being responded to.
responseResponse code.
indexUser index (only set when opcode is UDSC_UCP_OPCODE_RNU)
Returns
None

Definition at line 83 of file udsc_api.h.

Enumeration Type Documentation

anonymous enum

UDSC service enumeration of handle indexes of characteristics to be discovered.

Enumerator
UDSC_DBCI_HDL_IDX 

Database Change Interval.

UDSC_DCBI_CCC_HDL_IDX 

Database Change Interval CCC descriptor.

UDSC_UI_HDL_IDX 

User Index.

UDSC_UCP_IDX 

User Control Point.

UDSC_UCP_CCC_HDL_IDX 

User Control Point CCC descriptor.

UDSC_HDL_LIST_LEN 

Handle list length.

Definition at line 36 of file udsc_api.h.

37 {
38  UDSC_DBCI_HDL_IDX, /*!< \brief Database Change Interval */
39  UDSC_DCBI_CCC_HDL_IDX, /*!< \brief Database Change Interval CCC descriptor */
40  UDSC_UI_HDL_IDX, /*!< \brief User Index */
41  UDSC_UCP_IDX, /*!< \brief User Control Point */
42  UDSC_UCP_CCC_HDL_IDX, /*!< \brief User Control Point CCC descriptor */
43  UDSC_HDL_LIST_LEN /*!< \brief Handle list length */
44 };
Database Change Interval CCC descriptor.
Definition: udsc_api.h:39
User Control Point CCC descriptor.
Definition: udsc_api.h:42
User Control Point.
Definition: udsc_api.h:41
User Index.
Definition: udsc_api.h:40
Database Change Interval.
Definition: udsc_api.h:38
Handle list length.
Definition: udsc_api.h:43

Function Documentation

void UdscDiscover ( dmConnId_t  connId,
uint16_t pHdlList 
)

Perform service and characteristic discovery for User Data service. Parameter pHdlList must point to an array of length UDSC_HDL_LIST_LEN. If discovery is successful the handles of discovered characteristics and descriptors will be set in pHdlList.

Parameters
connIdConnection identifier.
pHdlListCharacteristic handle list.
Returns
None.
uint8_t UdscValueUpdate ( uint16_t pHdlList,
attEvt_t pMsg 
)

Process a value received in an ATT read response, notification, or indication message. Parameter pHdlList must point to an array of length UDSC_HDL_LIST_LEN. If the ATT handle of the message matches a handle in the handle list the value is processed, otherwise it is ignored.

Parameters
pHdlListCharacteristic handle list.
pMsgATT callback message.
Returns
ATT_SUCCESS if handle is found, ATT_ERR_NOT_FOUND otherwise.
void UdscReadUserIndex ( dmConnId_t  connId,
uint16_t  handle 
)

Read the user index characteristic.

Parameters
connIdConnection identifier.
handleAttribute handle.
Returns
None.
void UdscReadDatabaseChangeIncrement ( dmConnId_t  connId,
uint16_t  handle 
)

Read the database change increment characteristic.

Parameters
connIdConnection identifier.
handleAttribute handle.
Returns
None.
void UdscWriteDatabaseChangeIncrement ( dmConnId_t  connId,
uint16_t  handle,
uint32_t  increment 
)

Write the database change increment characteristic.

Parameters
connIdConnection identifier.
handleAttribute handle.
incrementDB Change Increment
Returns
None.
void UdscRegisterNewUser ( dmConnId_t  connId,
uint16_t  handle,
uint16_t  consentCode 
)

Write to the user control point characteristic - Register New User.

Parameters
connIdConnection identifier.
handleAttribute handle.
consentCodeConsent code (0-9999)
Returns
None.
void UdscConsent ( dmConnId_t  connId,
uint16_t  handle,
uint8_t  index,
uint16_t  consentCode 
)

Write to the user control point characteristic - Consent.

Parameters
connIdConnection identifier.
handleAttribute handle.
indexUser Index
consentCodeConsent code (0-9999 - provided when user was registered)
Returns
None.
void UdscDeleteUserData ( dmConnId_t  connId,
uint16_t  handle 
)

Write to the user control point characteristic - Delete User Data.

Parameters
connIdConnection identifier.
handleAttribute handle.
Returns
None.
void UdscClose ( void  )

Called by the application when a connection closes.

Returns
None.
void UdscInit ( wsfHandlerId_t  handlerId,
uint8_t  timerEvent,
UdsRspCback_t  rspCback 
)

Initialize User Data Service collector callbacks.

Parameters
handlerIdApplication task handler ID.
timerEventApplication timer event for control point timeout.
rspCbackCallback to receive control point response messages.
Returns
None.