@@ -5,7 +5,8 @@ const char *hardwareVersion = "1.0.0";
5
5
const char *EAProtocol = " com.sparkfun.rtk" ;
6
6
const char *BTTransportName = " com.sparkfun.bt" ;
7
7
const char *LIComponentName = " com.sparkfun.li" ;
8
- const char *productPlanUID = " 0123456789ABCDEF" ; // This comes from the MFi Portal, when you register the product with Apple
8
+ const char *productPlanUID =
9
+ " 0123456789ABCDEF" ; // This comes from the MFi Portal, when you register the product with Apple
9
10
10
11
extern BTSerialInterface *bluetoothSerialSpp;
11
12
@@ -28,7 +29,7 @@ void beginAuthCoPro(TwoWire *i2cBus)
28
29
29
30
appleAccessory->usePSRAM (online.psram );
30
31
31
- if (!appleAccessory->begin (*i2cBus))
32
+ if (!appleAccessory->begin (*i2cBus))
32
33
{
33
34
systemPrintln (" Could not initialize the authentication coprocessor" );
34
35
return ;
@@ -64,14 +65,16 @@ void beginAuthCoPro(TwoWire *i2cBus)
64
65
systemPrintln (" Authentication coprocessor online" );
65
66
}
66
67
67
- static char *bda2str (esp_bd_addr_t bda, char *str, size_t size) {
68
- if (bda == NULL || str == NULL || size < 18 ) {
69
- return NULL ;
70
- }
68
+ static char *bda2str (esp_bd_addr_t bda, char *str, size_t size)
69
+ {
70
+ if (bda == NULL || str == NULL || size < 18 )
71
+ {
72
+ return NULL ;
73
+ }
71
74
72
- uint8_t *p = bda;
73
- snprintf (str, size, " %02x:%02x:%02x:%02x:%02x:%02x" , p[0 ], p[1 ], p[2 ], p[3 ], p[4 ], p[5 ]);
74
- return str;
75
+ uint8_t *p = bda;
76
+ snprintf (str, size, " %02x:%02x:%02x:%02x:%02x:%02x" , p[0 ], p[1 ], p[2 ], p[3 ], p[4 ], p[5 ]);
77
+ return str;
75
78
}
76
79
77
80
void updateAuthCoPro ()
@@ -88,8 +91,10 @@ void updateAuthCoPro()
88
91
// Check for a new device connection
89
92
if (bluetoothSerialSpp->aclConnected () == true )
90
93
{
91
- // // https://github.com/espressif/arduino-esp32/blob/master/libraries/BluetoothSerial/examples/DiscoverConnect/DiscoverConnect.ino
92
- // std::map<int, std::string> channels = bluetoothSerialSpp->getChannels(bluetoothSerialSpp->aclGetAddress());
94
+ // //
95
+ // https://github.com/espressif/arduino-esp32/blob/master/libraries/BluetoothSerial/examples/DiscoverConnect/DiscoverConnect.ino
96
+ // std::map<int, std::string> channels =
97
+ // bluetoothSerialSpp->getChannels(bluetoothSerialSpp->aclGetAddress());
93
98
94
99
// int channel = 0; // Channel 0 for auto-detect
95
100
// if (channels.size() > 0)
@@ -100,8 +105,7 @@ void updateAuthCoPro()
100
105
char bda_str[18 ];
101
106
bda2str (bluetoothSerialSpp->aclGetAddress (), bda_str, 18 );
102
107
103
- systemPrintf (" Apple Device %s found, connecting on channel %d\r\n " ,
104
- bda_str, channel);
108
+ systemPrintf (" Apple Device %s found, connecting on channel %d\r\n " , bda_str, channel);
105
109
106
110
bluetoothSerialSpp->connect (bluetoothSerialSpp->aclGetAddress (), channel);
107
111
0 commit comments