components/bt/host/bluedroid/stack/btm/btm_sec.c
/*******************************************************************************
**
** Function         BTM_SetSecurityLevel
**
** Description      Register service security level with Security Manager
**
** Parameters:      is_originator - TRUE if originating the connection, FALSE if not
**                  p_name      - Name of the service relevant only if
**                                authorization will show this name to user. ignored
**                                if BTM_SEC_SERVICE_NAME_LEN is 0.
**                  service_id  - service ID for the service passed to authorization callback
**                  sec_level   - bit mask of the security features
**                  psm         - L2CAP PSM
**                  mx_proto_id - protocol ID of multiplexing proto below
**                  mx_chan_id  - channel ID of multiplexing proto below
**
** Returns          TRUE if registered OK, else FALSE
**
*******************************************************************************/
Function         BTM_SetSecurityLevel
Description      Register service security level with Security Manager

TRUE if originating the connection, FALSE if not
p_name      - Name of the service relevant only if
authorization will show this name to user. ignored
if BTM_SEC_SERVICE_NAME_LEN is 0.

Returns          TRUE if registered OK, else FALSE
Function BTM_SetSecurityLevel Description Register service security level with Security Manager TRUE if originating the connection FALSE if not p_name - Name of the service relevant only if authorization will show this name to user . ignored if BTM_SEC_SERVICE_NAME_LEN is 0 . Returns TRUE if registered OK else FALSE
BOOLEAN BTM_SetSecurityLevel (BOOLEAN is_originator, const char *p_name, UINT8 service_id,
                              UINT16 sec_level, UINT16 psm, UINT32 mx_proto_id,
                              UINT32 mx_chan_id)
{
#if (L2CAP_UCD_INCLUDED == TRUE)
    CONNECTION_TYPE conn_type;
    if (is_originator) {
        conn_type = CONN_ORIENT_ORIG;
    } else {
        conn_type = CONN_ORIENT_TERM;
    }
    return (btm_sec_set_security_level (conn_type, p_name, service_id,
                                        sec_level, psm, mx_proto_id, mx_chan_id));
#else
    return (btm_sec_set_security_level (is_originator, p_name, service_id,
                                        sec_level, psm, mx_proto_id, mx_chan_id));
#endif
}
BOOLEAN BTM_SetSecurityLevel ( BOOLEAN is_originator , const char * p_name , UINT8 service_id , UINT16 sec_level , UINT16 psm , UINT32 mx_proto_id , UINT32 mx_chan_id ) { #if ( L2CAP_UCD_INCLUDED == TRUE ) CONNECTION_TYPE conn_type ; if ( is_originator ) { conn_type = CONN_ORIENT_ORIG ; } else { conn_type = CONN_ORIENT_TERM ; } return ( btm_sec_set_security_level ( conn_type , p_name , service_id , sec_level , psm , mx_proto_id , mx_chan_id ) ) ; #else return ( btm_sec_set_security_level ( is_originator , p_name , service_id , sec_level , psm , mx_proto_id , mx_chan_id ) ) ; #endif }
Function         BTM_SetSecurityLevel
Description      Register service security level with Security Manager
Function BTM_SetSecurityLevel Description Register service security level with Security Manager