24 #define RFCOMM_SABM 0x2F
25 #define RFCOMM_UA 0x63
26 #define RFCOMM_UIH 0xEF
28 #define RFCOMM_DISC 0x43
30 #define extendAddress 0x01
33 #define BT_RFCOMM_PN_CMD 0x83
34 #define BT_RFCOMM_PN_RSP 0x81
35 #define BT_RFCOMM_MSC_CMD 0xE3
36 #define BT_RFCOMM_MSC_RSP 0xE1
37 #define BT_RFCOMM_RPN_CMD 0x93
38 #define BT_RFCOMM_RPN_RSP 0x91
63 SPP(
BTD *p,
const char *name =
"Arduino",
const char *pin =
"0000");
102 #if defined(ARDUINO) && ARDUINO >=100
108 size_t write(uint8_t data);
115 size_t write(
const uint8_t* data,
size_t size);
117 #if !defined(RBL_NRF51822) && !defined(NRF52_SERIES)
125 void write(uint8_t data);
131 void write(
const uint8_t* data,
size_t size);
166 bool RFCOMMConnected;
169 uint8_t l2cap_sdp_state;
170 uint8_t l2cap_rfcomm_state;
173 uint8_t rfcommbuf[10];
178 uint8_t rfcomm_scid[2];
179 uint8_t rfcomm_dcid[2];
182 uint8_t rfcommChannel;
183 uint8_t rfcommChannelConnection;
184 uint8_t rfcommDirection;
185 uint8_t rfcommCommandResponse;
186 uint8_t rfcommChannelType;
190 bool waitForLastCommand;
193 uint8_t rfcommDataBuffer[100];
194 uint8_t sppOutputBuffer[100];
196 uint8_t rfcommAvailable;
206 void SDP_Command(uint8_t *data, uint8_t nbytes);
207 void serviceNotSupported(uint8_t transactionIDHigh, uint8_t transactionIDLow);
208 void serialPortResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow);
209 void serialPortResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow);
210 void l2capResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow);
211 void l2capResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow);
214 void RFCOMM_Command(uint8_t *data, uint8_t nbytes);
215 void sendRfcomm(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t *data, uint8_t length);
216 void sendRfcommCredit(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t credit);
217 uint8_t calcFcs(uint8_t *data);
218 bool checkFcs(uint8_t *data, uint8_t fcs);
219 uint8_t crc(uint8_t *data);
SPP(BTD *p, const char *name="Arduino", const char *pin="0000")
size_t write(uint8_t data)
void ACLData(uint8_t *ACLData)