callback rename
This commit is contained in:
1 parent
c322f4c834
commit
a860206275
4 files changed
+12
-12
No files matched your search
@@ -104,10 +104,10 @@ void setup()
|
||||
// For complete mapping of the IO Capabilities to Key Generation Method, check out this article
|
||||
// https://www.bluetooth.com/blog/bluetooth-pairing-part-2-key-generation-methods/
|
||||
Bluefruit.Security.setIOCaps(true, true, false); // display = true, yes/no = true, keyboard = false
|
||||
Bluefruit.Security.setPasskeyCallback(pairing_passkey_callback);
|
||||
Bluefruit.Security.setPairPasskeyCallback(pairing_passkey_callback);
|
||||
|
||||
// Set complete callback to print the pairing result
|
||||
Bluefruit.Security.setCompleteCallback(pairing_complete_callback);
|
||||
Bluefruit.Security.setPairCompleteCallback(pairing_complete_callback);
|
||||
|
||||
// Set connection secured callback, invoked when connection is encrypted
|
||||
Bluefruit.Security.setSecuredCallback(connection_secured_callback);
|
||||
|
||||
@@ -106,10 +106,10 @@ void setup()
|
||||
* https://www.bluetooth.com/blog/bluetooth-pairing-part-2-key-generation-methods/
|
||||
*/
|
||||
Bluefruit.Security.setIOCaps(true, true, false); // display = true, yes/no = true, keyboard = false
|
||||
Bluefruit.Security.setPasskeyCallback(pairing_passkey_callback);
|
||||
Bluefruit.Security.setPairPasskeyCallback(pairing_passkey_callback);
|
||||
|
||||
// Set complete callback to print the pairing result
|
||||
Bluefruit.Security.setCompleteCallback(pairing_complete_callback);
|
||||
Bluefruit.Security.setPairCompleteCallback(pairing_complete_callback);
|
||||
|
||||
// Set connection secured callback, invoked when connection is encrypted
|
||||
Bluefruit.Security.setSecuredCallback(connection_secured_callback);
|
||||
|
||||
@@ -197,7 +197,7 @@ bool BLESecurity::setPIN(const char* pin)
|
||||
}
|
||||
|
||||
// Pairing using LESC with peripheral display
|
||||
bool BLESecurity::setPasskeyCallback(pair_passkey_cb_t fp)
|
||||
bool BLESecurity::setPairPasskeyCallback(pair_passkey_cb_t fp)
|
||||
{
|
||||
_passkey_cb = fp;
|
||||
|
||||
@@ -207,12 +207,12 @@ bool BLESecurity::setPasskeyCallback(pair_passkey_cb_t fp)
|
||||
return true;
|
||||
}
|
||||
|
||||
void BLESecurity::setCompleteCallback(pair_complete_cb_t fp)
|
||||
void BLESecurity::setPairCompleteCallback(pair_complete_cb_t fp)
|
||||
{
|
||||
_complete_cb = fp;
|
||||
}
|
||||
|
||||
void BLESecurity::setSecuredCallback(pair_secured_cb_t fp)
|
||||
void BLESecurity::setSecuredCallback(secured_conn_cb_t fp)
|
||||
{
|
||||
_secured_cb = fp;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class BLESecurity
|
||||
public:
|
||||
typedef bool (*pair_passkey_cb_t ) (uint16_t conn_hdl, uint8_t const passkey[6], bool match_request);
|
||||
typedef void (*pair_complete_cb_t) (uint16_t conn_hdl, uint8_t auth_status);
|
||||
typedef void (*pair_secured_cb_t) (uint16_t conn_hdl);
|
||||
typedef void (*secured_conn_cb_t) (uint16_t conn_hdl);
|
||||
|
||||
BLESecurity(void);
|
||||
|
||||
@@ -56,9 +56,9 @@ class BLESecurity
|
||||
bool resolveAddress(ble_gap_addr_t const * p_addr, ble_gap_irk_t const * irk);
|
||||
|
||||
//------------- Callbacks -------------//
|
||||
bool setPasskeyCallback(pair_passkey_cb_t fp);
|
||||
void setCompleteCallback(pair_complete_cb_t fp);
|
||||
void setSecuredCallback(pair_secured_cb_t fp);
|
||||
bool setPairPasskeyCallback(pair_passkey_cb_t fp);
|
||||
void setPairCompleteCallback(pair_complete_cb_t fp);
|
||||
void setSecuredCallback(secured_conn_cb_t fp);
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* INTERNAL USAGE ONLY
|
||||
@@ -83,7 +83,7 @@ class BLESecurity
|
||||
|
||||
pair_passkey_cb_t _passkey_cb;
|
||||
pair_complete_cb_t _complete_cb;
|
||||
pair_secured_cb_t _secured_cb;
|
||||
secured_conn_cb_t _secured_cb;
|
||||
};
|
||||
|
||||
#endif /* BLESECURITY_H_ */
|
||||
Reference in new issue
Block a user