hci.c (cbf638a9015ab652ec1d049799f9ea5f10390e2f) hci.c (f1dfbe18c8cb32c606498ebeaa3729d9737a7134)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 4987 unchanged lines hidden (view full) ---

4996
4997int gap_authenticated(hci_con_handle_t con_handle){
4998 sm_connection_t * sm_conn = sm_get_connection_for_handle(con_handle);
4999 if (!sm_conn) return 0; // wrong connection
5000 if (!sm_conn->sm_connection_encrypted) return 0; // unencrypted connection cannot be authenticated
5001 return sm_conn->sm_connection_authenticated;
5002}
5003
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 4987 unchanged lines hidden (view full) ---

4996
4997int gap_authenticated(hci_con_handle_t con_handle){
4998 sm_connection_t * sm_conn = sm_get_connection_for_handle(con_handle);
4999 if (!sm_conn) return 0; // wrong connection
5000 if (!sm_conn->sm_connection_encrypted) return 0; // unencrypted connection cannot be authenticated
5001 return sm_conn->sm_connection_authenticated;
5002}
5003
5004int gap_secure_connection(hci_con_handle_t con_handle){
5005 sm_connection_t * sm_conn = sm_get_connection_for_handle(con_handle);
5006 if (!sm_conn) return 0; // wrong connection
5007 if (!sm_conn->sm_connection_encrypted) return 0; // unencrypted connection cannot be authenticated
5008 return sm_conn->sm_connection_sc;
5009}
5010
5004authorization_state_t gap_authorization_state(hci_con_handle_t con_handle){
5005 sm_connection_t * sm_conn = sm_get_connection_for_handle(con_handle);
5006 if (!sm_conn) return AUTHORIZATION_UNKNOWN; // wrong connection
5007 if (!sm_conn->sm_connection_encrypted) return AUTHORIZATION_UNKNOWN; // unencrypted connection cannot be authorized
5008 if (!sm_conn->sm_connection_authenticated) return AUTHORIZATION_UNKNOWN; // unauthenticatd connection cannot be authorized
5009 return sm_conn->sm_connection_authorization_state;
5010}
5011#endif

--- 38 unchanged lines hidden ---
5011authorization_state_t gap_authorization_state(hci_con_handle_t con_handle){
5012 sm_connection_t * sm_conn = sm_get_connection_for_handle(con_handle);
5013 if (!sm_conn) return AUTHORIZATION_UNKNOWN; // wrong connection
5014 if (!sm_conn->sm_connection_encrypted) return AUTHORIZATION_UNKNOWN; // unencrypted connection cannot be authorized
5015 if (!sm_conn->sm_connection_authenticated) return AUTHORIZATION_UNKNOWN; // unauthenticatd connection cannot be authorized
5016 return sm_conn->sm_connection_authorization_state;
5017}
5018#endif

--- 38 unchanged lines hidden ---