|
28 | 28 |
|
29 | 29 | /** |
30 | 30 | * advertising interval in milliseconds |
| 31 | + * |
| 32 | + * According to power profiler https://devzone.nordicsemi.com/power/w/opp/2/online-power-profiler-for-bluetooth-le |
| 33 | + * average current is 11 µA with a 3000msec interval on a nRF52810 |
| 34 | + * so life expectancy of a CR2032 coin-cell (the one used on Moko M1) would be about 1.5 year |
| 35 | + * and life expectancy of a CR2477 coin-cell (the one used on Moko M2) would be about 6 years |
31 | 36 | */ |
32 | | -#define ADVERTISING_INTERVAL 500 |
| 37 | +#define ADVERTISING_INTERVAL 3000 |
33 | 38 |
|
34 | | -//static char public_key[28] = "OFFLINEFINDINGPUBLICKEYHERE!"; |
| 39 | +static char public_key[28] = "OFFLINEFINDINGPUBLICKEYHERE!"; |
| 40 | + |
| 41 | +//Test1 |
| 42 | +/* |
35 | 43 | static char public_key[28] = {0x4e, 0xe3, 0xf3, 0xc5, 0xbf, 0x2f, 0xcb, 0x61, |
36 | 44 | 0x06, 0xc2, 0xb5, 0x1d, 0x80, 0xff, 0x60, 0xb8, |
37 | 45 | 0x77, 0x77, 0x2b, 0xe5, 0xc5, 0xe5, 0x4b, 0x03, |
38 | 46 | 0xaf, 0x76, 0xd5, 0xe1}; |
39 | | - |
| 47 | +*/ |
| 48 | +//Test2 |
| 49 | +/* |
| 50 | +static char public_key[28] = {0x60, 0x52, 0x77, 0xfe, 0xdc, 0x80, 0xb1, 0x64, |
| 51 | + 0x4f, 0x9e, 0x16, 0xdf, 0xde, 0x38, 0xeb, 0x4c, |
| 52 | + 0xd6, 0xaa, 0xf4, 0xee, 0xb3, 0xf6, 0xd5, 0x70, |
| 53 | + 0x57, 0x3, 0x1, 0x9f}; |
| 54 | +*/ |
40 | 55 |
|
41 | 56 | /**@brief Function for the Timer initialization. |
42 | 57 | * |
@@ -107,7 +122,17 @@ int main(void) { |
107 | 122 | advertising_init(ADVERTISING_INTERVAL); |
108 | 123 |
|
109 | 124 | // Set advertisement data |
110 | | - setAdvertisementData(raw_data, data_len); |
| 125 | + if (public_key[0] == 'O' && |
| 126 | + public_key[1] == 'F' && |
| 127 | + public_key[2] == 'F' && |
| 128 | + public_key[3] == 'L' && |
| 129 | + public_key[4] == 'I' && |
| 130 | + public_key[5] == 'N' && |
| 131 | + public_key[6] == 'E') { |
| 132 | + // Leave unconfigured |
| 133 | + } else { |
| 134 | + setAdvertisementData(raw_data, data_len); |
| 135 | + } |
111 | 136 |
|
112 | 137 | // Enable services |
113 | 138 | services_init(); |
|
0 commit comments