Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
François Revol
firmware
Commits
b3eec4e7
Verified
Commit
b3eec4e7
authored
Aug 04, 2019
by
schneider
Committed by
Rahix
Aug 06, 2019
Browse files
fix(ble): Remove app callback to set BT MAC
parent
f5f2d972
Changes
1
Hide whitespace changes
Inline
Side-by-side
epicardium/ble/ble.c
View file @
b3eec4e7
...
...
@@ -91,37 +91,25 @@ static void WsfInit(void)
WsfTraceEnable
(
TRUE
);
}
/* TODO: We need a source of MACs */
/*
* In two-chip solutions, setting the address must wait until the HCI interface is initialized.
* This handler can also catch other Application events, but none are currently implemented.
* See ble-profiles/sources/apps/app/common/app_ui.c for further details.
*
*/
void
SetAddress
(
uint8_t
event
)
static
void
setAddress
(
void
)
{
uint8_t
bdAddr
[
6
]
=
{
0x02
,
0x02
,
0x44
,
0x8B
,
0x05
,
0x00
};
char
buf
[
32
];
switch
(
event
)
{
case
APP_UI_RESET_CMPL
:
fs_read_text_file
(
"mac.txt"
,
buf
,
sizeof
(
buf
));
printf
(
"mac file: %s
\n
"
,
buf
);
int
a
,
b
,
c
,
d
,
e
,
f
;
if
(
sscanf
(
buf
,
"%x:%x:%x:%x:%x:%x"
,
&
a
,
&
b
,
&
c
,
&
d
,
&
e
,
&
f
)
==
6
)
{
bdAddr
[
0
]
=
f
;
bdAddr
[
1
]
=
e
;
bdAddr
[
2
]
=
d
;
bdAddr
[
3
]
=
c
;
bdAddr
[
4
]
=
b
;
bdAddr
[
5
]
=
a
;
}
printf
(
"Setting address -- MAC %02X:%02X:%02X:%02X:%02X:%02X
\n
"
,
bdAddr
[
5
],
bdAddr
[
4
],
bdAddr
[
3
],
bdAddr
[
2
],
bdAddr
[
1
],
bdAddr
[
0
]);
HciVsSetBdAddr
(
bdAddr
);
break
;
default:
break
;
fs_read_text_file
(
"mac.txt"
,
buf
,
sizeof
(
buf
));
printf
(
"mac file: %s
\n
"
,
buf
);
int
a
,
b
,
c
,
d
,
e
,
f
;
if
(
sscanf
(
buf
,
"%x:%x:%x:%x:%x:%x"
,
&
a
,
&
b
,
&
c
,
&
d
,
&
e
,
&
f
)
==
6
)
{
bdAddr
[
0
]
=
f
;
bdAddr
[
1
]
=
e
;
bdAddr
[
2
]
=
d
;
bdAddr
[
3
]
=
c
;
bdAddr
[
4
]
=
b
;
bdAddr
[
5
]
=
a
;
}
printf
(
"Setting address -- MAC %02X:%02X:%02X:%02X:%02X:%02X
\n
"
,
bdAddr
[
5
],
bdAddr
[
4
],
bdAddr
[
3
],
bdAddr
[
2
],
bdAddr
[
1
],
bdAddr
[
0
]);
HciVsSetBdAddr
(
bdAddr
);
}
static
StaticTimer_t
x
;
...
...
@@ -329,6 +317,7 @@ static void ble_init(void)
{
WsfInit
();
StackInitFit
();
setAddress
();
NVIC_SetPriority
(
BTLE_SFD_TO_IRQn
,
2
);
NVIC_SetPriority
(
BTLE_TX_DONE_IRQn
,
2
);
NVIC_SetPriority
(
BTLE_RX_RCVD_IRQn
,
2
);
...
...
@@ -341,10 +330,6 @@ static void ble_init(void)
AttsDynRegister
(
pSHdl
,
UARTReadCback
,
UARTWriteCback
);
//AttsDynRegister(pSHdl, NULL, UARTWriteCback);
/* Register a handler for Application events */
AppUiActionRegister
(
SetAddress
);
lasttick
=
xTaskGetTickCount
();
timerWakeup
=
xTimerCreateStatic
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment