Go to the documentation of this file.
63 #include "custom_config.h"
72 #define UDS_CONNECTION_MAX 10
73 #define UDS_AGE_VAL_LEN_MAX 2
74 #define UDS_DATE_OF_BIRTH_VAL_LEN_MAX 4
75 #define UDS_FIRST_NAME_VAL_LEN_MAX 50
76 #define UDS_HEIGHT_VAL_LEN_MAX 2
77 #define UDS_GENDER_VAL_LEN_MAX 2
78 #define UDS_DB_CHANGE_INCR_VAL_LEN_MAX 4
79 #define UDS_USER_INDEX_VAL_LEN_MAX 1
80 #define UDS_CTRL_PT_RSP_LEN_MIN 3
81 #define UDS_CTRL_PT_RSP_LEN_MAX 20
82 #define UDS_CTRL_PT_VAL_LEN_MAX 19
83 #define UDS_REGI_USER_DATA_LEN_MAX 19
84 #define UDS_REGI_USER_VAL_LEN_MAX 20
86 #define UDS_ERROR_UD_ACCESS_NOT_PERMIT 0x80
87 #define UDS_ERROR_PROC_IN_PROGRESS 0xFE
88 #define UDS_ERROR_CCCD_INVALID 0xFD
90 #define UDS_DB_CHANGE_INCR_DEFAULT_VAL 0x00
91 #define UDS_UNKNOWN_USER 0xFF
92 #define UDS_CONSENT_CODE_VAL_MAX 0x270F
93 #define UDS_CONSENT_TRY_NUM_MAX 0x04
95 #define UDS_MIDDLE_REGI_USER_SEGM 0x00
96 #define UDS_FIRST_REGI_USER_SEGM 0x01
97 #define UDS_LAST_REGI_USER_SEGM 0x02
98 #define UDS_ONLY_REGI_USER_SEGM 0x03
100 #define UDS_MEAS_FLAG_DEFAULT 0x3E
107 #define UDS_CHAR_MANDATORY 0x000001FF
108 #define UDS_CHAR_AGE_SUP 0x00000600
109 #define UDS_CHAR_DATE_OF_BIRTH_SUP 0x00001800
110 #define UDS_CHAR_FIRST_NAME_SUP 0x00006000
111 #define UDS_CHAR_HEIGHT_SUP 0x00018000
112 #define UDS_CHAR_GENDER_SUP 0x00060000
113 #define UDS_CHAR_REGIST_USER_SUP 0x00380000
114 #define UDS_CHAR_FULL 0x003FFFFF
353 #if defined(PTS_AUTO_TEST)
354 void uds_regist_new_user(uint8_t conn_idx);
@ UDS_CHARS_WEIGHT_PRESENT
Flag bit for Weight Present.
@ UDS_EVT_CTRL_POINT_INDICATION_DISABLE
Indicate that User Control Point indication has been disabled.
@ UDS_CTRL_PT_RSP_RESERVED
Reserved value.
uint16_t length
Length of event data.
@ UDS_EVT_REGIST_NEW_USER
Indicate that User is waiting to be granted access.
uint16_t height
User's height.
uds_chars_val_t uds_chars_val
UDS Characteristics value set by peer.
@ UDS_CTRL_PT_RSP_INVALID_PARAM
Invalid Parameter.
@ UDS_EVT_GENDER_SET_BY_PEER
Gender has been set by peer.
@ UDS_CTRL_PT_OP_REGIST_NEW_USER
Register New User Operation Code.
uint8_t user_index
Initialize the user index.
@ UDS_EVT_HEIGHT_SET_BY_PEER
Height has been set by peer.
@ UDS_CTRL_PT_OP_RSP_CODE
Response code.
uint32_t char_mask
Initialize the mask of supported characteristics, and configured with Characteristics Mask.
uint8_t gender_present
Gender Present.
uint8_t weight_present
Weight Present.
@ UDS_CHARS_HEIGHT_PRESENT
Flag bit for Height Present.
uint8_t regi_user_name_present
Registered User Name Present.
uint8_t user_name_truncated
User Name is truncated.
uint8_t * p_first_name
User's first name.
@ UDS_EVT_DB_CHANGE_INCR_NOTIFICATION_DISABLE
Database Change Increment Notification is disabled.
@ UDS_EVT_CTRL_POINT_INDICATION_ENABLE
Indicate that User Control Point indication has been enabled.
uint8_t gender
User's gender.
UDS Characteristics Flags structure.
uint8_t db_change_incr_val
Initialize the Database Change Increment value.
uds_regi_user_data_flag_t uds_regi_user_data_flag
Initialize the Registered User Data Flags structure.
uint8_t uds_get_cur_user_index(uint8_t conn_idx)
Get current user index.
@ UDS_CTRL_PT_RSP_SUCCESS
Operation Success.
uint16_t length
Length of Registered User Data stream.
uint8_t first_name_present
First Name Present.
@ UDS_CTRL_PT_OP_LIST_ALL_USERS
List All Users Operation Code.
uint8_t conn_idx
The index of the connection.
@ UDS_CTRL_PT_OP_DEL_USERS
Delete User(s) Operation code.
@ UDS_EVT_DB_CHANGE_INCR_SEND_CPLT
Indicate that Database Change Increment has been notified.
@ UDS_EVT_DATE_OF_BIRTH_SET_BY_PEER
Date of Birth has been set by peer.
UDS Registered User Data stream.
uint16_t segm_offset
Offset of Registered User Data segmentations' number.
sdk_err_t uds_ctrl_pt_rsp_send(uint8_t conn_idx, uint8_t *p_data, uint16_t length)
Send User Control Point response if it's indication has been enabled.
uint16_t offset
Offset of Registered User Data stream.
@ UDS_EVT_REGIST_USER_INDICATION_DISABLE
Indicate that Registered User indication has been disabled.
uds_regi_user_data_flag_bits
Registered User Data Flags.
void(* uds_evt_handler_t)(uds_evt_t *p_evt)
User Data Service event handler type.
const uint8_t * p_data
Pointer to event data.
@ UDS_CTRL_PT_OP_DEL_USER_DATA
Delete User Data Operation Code.
@ UDS_CHARS_FIRST_NAME_PRESENT
Flag bit for First Name Present.
@ UDS_CHARS_AGE_PRESENT
Flag bit for Age Present.
@ UDS_CTRL_PT_RSP_NOT_SUP
Operation Code Not Supported.
uds_evt_type_t
User Data Service event type.
uint16_t sdk_err_t
SDK API result type.
@ UDS_CTRL_PT_RSP_FAILED
Operation Failed.
uint8_t reserved
Reserved for Future Use.
uint32_t db_change_incr_val
Database Change Increment value set by peer.
@ UDS_CHARS_BIRTH_DATE_PRESENT
Flag bit for Date of Birth Present.
sdk_err_t uds_db_change_incr_val_send(uint8_t conn_idx, uint8_t user_idx)
Send Database Change Increment Characteristic value if UDS Characteristics value has been changed.
@ UDS_EVT_REGIST_USER_RSP_CPLT
Indicate that Registered User response has been indicated.
uint16_t name_length
Length of User's first name.
uint16_t year
year time element of birth date.
uint16_t weight
User's weight.
uds_evt_type_t evt_type
The UDS event type.
@ UDS_EVT_USER_GRANT_ACCESS
Indicate that User is waiting to be granted access.
uint8_t * p_data
Pointer to Registered User Data stream.
uint8_t age_present
Age Present.
uds_chars_flag_t uds_chars_flag
Initialize the UDS Characteristics Flags structure.
@ UDS_CHARS_GENDER_PRESENT
Flag bit for Gender Present.
@ UDS_EVT_AGE_SET_BY_PEER
Age has been set by peer.
uint16_t segm_num
Registered User Data segmentations' number.
birth_date_t date_of_birth
User's birth date.
@ UDS_EVT_REGIST_USER_INDICATION_ENABLE
Indicate that Registered User indication has been enabled.
sdk_err_t uds_service_init(uds_init_t *p_uds_init)
Initialize a User Data Service instance and add in the DB.
@ UDS_CTRL_PT_OP_CONSENT
Consent Operation Code.
@ UDS_EVT_FIRST_NAME_SET_BY_PEER
First Name has been set by peer.
uds_chars_flag_bits
UDS Characteristics Flags.
@ UDS_EVT_CTRL_POINT_RSP_CPLT
Indicate that User Control Point response has been indicated.
@ UDS_EVT_DB_CHANGE_INCR_SET_BY_PEER
Database Change Increment has been set by peer.
@ UDS_EVT_CTRL_POINT_SET_BY_PEER
User Control Point has been set by peer.
Profile/Service Utilities API.
@ UDS_CTRL_PT_OP_RESERVED
Reserved for future use.
sdk_err_t uds_regi_user_val_send(uint8_t conn_idx)
Send Registered User Characteristic value.
uint8_t height_present
Height Present.
@ UDS_EVT_DB_CHANGE_INCR_NOTIFICATION_ENABLE
Database Change Increment Notification is enabled.
@ UDS_CTRL_PT_RSP_USER_NOT_AUTH
User Not Authorized.
uint8_t day
day time element of birth date.
uint8_t month
month time element of birth date.
uint16_t consent_code
Consent Code data.
uds_ctrl_pt_op_code_t
User Data Service Control Point Operation Code.
uds_ctrl_pt_rsp_t
User Data Service Control Point Response value.
uds_evt_handler_t evt_handler
User Data Service event handler.
UDS Characteristic - birthdate's structure.
Registered User Data Flags structure.
@ UDS_REGI_USER_NAME_PRESENT
Flag bit for Registered User Name Present.
uint16_t * p_segm_length
Pointer to each segmentation length of Registered User Data stream.
@ UDS_USER_NAME_TRUNCATED
Flag bit for User Name is truncated.
uint8_t birth_date_present
Date of Birth Present.
UDS Characteristics value structure.
void uds_set_cur_user_index(uint8_t conn_idx, uint8_t user_index)
Set current user index.
User Data Service init structure.
@ UDS_EVT_INVALID
Invalid event.