Skip to content

Commit 1d594bf

Browse files
author
Adrian Freed
committed
Bluetooth Support
1 parent 4b6d8f5 commit 1d594bf

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

SLIPEncodedSerial.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ class _SLIPSerial: public Stream{
220220
void begin(unsigned long baudrate){
221221
serial->begin(baudrate);
222222
}
223+
// for bluetooth
224+
void begin(char *name){
225+
serial->begin(name);
226+
}
223227
//SLIP specific method which begins a transmitted packet
224228
void beginPacket() { serial->write(eot); }
225229

@@ -264,8 +268,25 @@ typedef decltype(Serial) actualUSBtype;
264268
using SLIPEncodedUSBSerial = _SLIPSerial<actualUSBtype>;
265269
template <> void _SLIPSerial<actualUSBtype>::endPacket(){
266270
serial->write(eot);
271+
#if defined(CORE_TEENSY)
267272
serial->send_now();
273+
#endif
268274
}
269275
#endif
270276

277+
// Bluetooth Example
278+
// #include "BluetoothSerial.h"
279+
// #if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
280+
// BluetoothSerial bluetoothserialinstance;
281+
// SLIPEncodedBluetoothSerial SLIPSerial(bluetoothserialinstance);
282+
// #endif
283+
284+
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
285+
#include "BluetoothSerial.h"
286+
using SLIPEncodedBluetoothSerial = _SLIPSerial<BluetoothSerial>;
287+
template <> void _SLIPSerial<BluetoothSerial>::endPacket(){
288+
serial->write(eot);
289+
290+
}
291+
#endif
271292
#endif

0 commit comments

Comments
 (0)