blob: be1f952c652221b1614303041bdf7a6586fbbbb4 (
plain)
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
31
32
33
34
35
36
37
38
39
|
#include "project.h"
void
dfu (const char *bdaddr, const char *type, const char *version, uint8_t * dat,
size_t dat_sz, uint8_t * bin, size_t bin_sz)
{
BLE *b;
uint8_t buf[32];
ble_init();
do {
b=ble_open (bdaddr);
if (!b)
break;
if (ble_register_notify(b)) break;
ble_send_cp(
ble_close (b);
return;
} while (0);
ble_close (b);
exit(EXIT_FAILURE);
}
|