FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
STM32duinoBLE/src/utility/bitDescriptions.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
/
bitDescriptions.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (21 loc) · 1.08 KB
Breadcrumbs
STM32duinoBLE
/
src
/
utility
/
bitDescriptions.cpp
Copy path
File metadata and controls
30 lines (21 loc) · 1.08 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
25
26
27
28
29
30
#
include
"
bitDescriptions.h
"
#
define
BONDING_BIT
0b00000001
#
define
MITM_BIT
0b00000100
#
define
SC_BIT
0b00001000
#
define
KEYPRESS_BIT
0b00010000
#
define
CT2_BIT
0b00100000
AuthReq::AuthReq
(){}
AuthReq::AuthReq
(
uint8_t
octet):_octet(octet){}
bool
AuthReq::Bonding
(){
return
(_octet &
BONDING_BIT
)>
0
;}
bool
AuthReq::MITM
(){
return
(_octet &
MITM_BIT
)>
0
;}
bool
AuthReq::SC
(){
return
(_octet &
SC_BIT
)>
0
;}
bool
AuthReq::KeyPress
(){
return
(_octet &
KEYPRESS_BIT
)>
0
;}
bool
AuthReq::CT2
(){
return
(_octet &
CT2_BIT
)>
0
;}
void
AuthReq::setBonding
(
bool
state) { _octet= state? _octet|
BONDING_BIT
: _octet&~
BONDING_BIT
;}
void
AuthReq::setMITM
(
bool
state) { _octet= state? _octet|
MITM_BIT
: _octet&~
MITM_BIT
;}
void
AuthReq::setSC
(
bool
state){ _octet= state? _octet|
SC_BIT
: _octet&~
SC_BIT
;}
void
AuthReq::setKeyPress
(
bool
state){ _octet= state? _octet|
KEYPRESS_BIT
: _octet&~
KEYPRESS_BIT
;}
void
AuthReq::setCT2
(
bool
state){ _octet= state? _octet|
CT2_BIT
: _octet&~
CT2_BIT
;}
uint8_t
_octet;
void
AuthReq::setOctet
(
uint8_t
octet){_octet = octet;}
uint8_t
AuthReq::getOctet
() {
return
_octet;}
Back
|
FazBrowse Home
|
New Git URL