Bluetooth: Move security related code to bluetooth.h

Also rename bt_conn_security function to bt_security and
bt_conn_security_t to bt__security_t.

Change-Id: I543c7b97241c4389ef0eb491b6869f93105ae533
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2015-06-26 19:24:50 +02:00 committed by Anas Nashif
commit a14314e913
4 changed files with 36 additions and 34 deletions

View file

@ -93,34 +93,4 @@ struct bt_conn_cb {
*/
void bt_conn_cb_register(struct bt_conn_cb *cb);
typedef enum {
BT_CONN_SEC_LOW,
BT_CONN_SEC_MEDIUM,
BT_CONN_SEC_HIGH,
BT_CONN_SEC_FIPS,
} bt_conn_security_t;
/*! @brief Set security level for a connection.
*
* This function enable security (encryption) for a connection. If device is
* already paired with sufficiently strong key encryption will be enabled. If
* link is already encrypted with sufficiently strong key this function does
* nothing.
*
* If device is not paired pairing will be initiated. If device is paired and
* keys are too weak but input output capabilities allow for strong enough keys
* pairing will be initiated.
*
* This function may return error if required level of security is not possible
* to achieve due to local or remote device limitation (eg input output
* capabilities).
*
* @param conn Connection object.
* @param sec Requested security level.
*
* @return 0 on success or negative error
*/
int bt_conn_security(struct bt_conn *conn, bt_conn_security_t sec);
#endif /* __BT_CONN_H */