FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
STM32duinoBLE/src/utility/keyDistribution.cpp at main · stm32duino/STM32duinoBLE · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
stm32duino
/
STM32duinoBLE
Public
forked from
arduino-libraries/ArduinoBLE
Notifications
You must be signed in to change notification settings
Fork
23
Star
21
Code
Issues
3
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
STM32duinoBLE
/
src
/
utility
/
keyDistribution.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (21 loc) · 1.24 KB
Breadcrumbs
STM32duinoBLE
/
src
/
utility
/
keyDistribution.cpp
Copy path
File metadata and controls
24 lines (21 loc) · 1.24 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
include
"
keyDistribution.h
"
KeyDistribution::KeyDistribution
():_octet(
0
){}
KeyDistribution::KeyDistribution
(
uint8_t
octet):_octet(octet){}
#
define
ENCKEY
0b00000001
#
define
IDKEY
0b00000010
#
define
SIGNKEY
0b00000100
#
define
LINKKEY
0b00001000
void
KeyDistribution::setOctet
(
uint8_t
octet){_octet = octet;}
uint8_t
KeyDistribution::getOctet
() {
return
_octet;}
//
Ignored when SMP is on LE transport
bool
KeyDistribution::EncKey
(){
return
(_octet &
ENCKEY
)>
0
;}
//
Device shall distribute IRK using Identity information command followed by its address using Identity address information
bool
KeyDistribution::IdKey
(){
return
(_octet &
IDKEY
)>
0
;}
//
Device shall distribute CSRK using signing information command
bool
KeyDistribution::SignKey
(){
return
(_octet &
SIGNKEY
)>
0
;}
//
Device would like to derive BR/EDR from LTK
bool
KeyDistribution::LinkKey
(){
return
(_octet &
LINKKEY
)>
0
;}
void
KeyDistribution::setEncKey
(
bool
state) { _octet= state? _octet|
ENCKEY
: _octet&~
ENCKEY
;}
void
KeyDistribution::setIdKey
(
bool
state) { _octet= state? _octet|
IDKEY
: _octet&~
IDKEY
;}
void
KeyDistribution::setSignKey
(
bool
state){ _octet= state? _octet|
SIGNKEY
: _octet&~
SIGNKEY
;}
void
KeyDistribution::setLinkKey
(
bool
state){ _octet= state? _octet|
LINKKEY
: _octet&~
LINKKEY
;}
Back
|
FazBrowse Home
|
New Git URL