24 #define SDP_SERVICE_SEARCH_ATTRIBUTE_REQUEST_PDU 0x06 // See the RFCOMM specs 25 #define SDP_SERVICE_SEARCH_ATTRIBUTE_RESPONSE_PDU 0x07 // See the RFCOMM specs 26 #define SERIALPORT_UUID 0x1101 // See http://www.bluetooth.org/Technical/AssignedNumbers/service_discovery.htm 27 #define L2CAP_UUID 0x0100 30 #define RFCOMM_SABM 0x2F 31 #define RFCOMM_UA 0x63 32 #define RFCOMM_UIH 0xEF 34 #define RFCOMM_DISC 0x43 36 #define extendAddress 0x01 // Always 1 39 #define BT_RFCOMM_PN_CMD 0x83 40 #define BT_RFCOMM_PN_RSP 0x81 41 #define BT_RFCOMM_MSC_CMD 0xE3 42 #define BT_RFCOMM_MSC_RSP 0xE1 43 #define BT_RFCOMM_RPN_CMD 0x93 44 #define BT_RFCOMM_RPN_RSP 0x91 69 SPP(
BTD *p,
const char *name =
"Arduino",
const char *pin =
"0000");
108 #if defined(ARDUINO) && ARDUINO >=100 114 size_t write(uint8_t data);
121 size_t write(
const uint8_t* data,
size_t size);
123 #if !defined(RBL_NRF51822) 131 void write(uint8_t data);
137 void write(
const uint8_t* data,
size_t size);
172 bool RFCOMMConnected;
175 uint8_t l2cap_sdp_state;
176 uint8_t l2cap_rfcomm_state;
179 uint8_t rfcommbuf[10];
184 uint8_t rfcomm_scid[2];
185 uint8_t rfcomm_dcid[2];
188 uint8_t rfcommChannel;
189 uint8_t rfcommChannelConnection;
190 uint8_t rfcommDirection;
191 uint8_t rfcommCommandResponse;
192 uint8_t rfcommChannelType;
196 bool waitForLastCommand;
199 uint8_t rfcommDataBuffer[100];
200 uint8_t sppOutputBuffer[100];
202 uint8_t rfcommAvailable;
212 void SDP_Command(uint8_t *data, uint8_t nbytes);
213 void serviceNotSupported(uint8_t transactionIDHigh, uint8_t transactionIDLow);
214 void serialPortResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow);
215 void serialPortResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow);
216 void l2capResponse1(uint8_t transactionIDHigh, uint8_t transactionIDLow);
217 void l2capResponse2(uint8_t transactionIDHigh, uint8_t transactionIDLow);
220 void RFCOMM_Command(uint8_t *data, uint8_t nbytes);
221 void sendRfcomm(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t *data, uint8_t length);
222 void sendRfcommCredit(uint8_t channel, uint8_t direction, uint8_t CR, uint8_t channelType, uint8_t pfBit, uint8_t credit);
223 uint8_t calcFcs(uint8_t *data);
224 bool checkFcs(uint8_t *data, uint8_t fcs);
225 uint8_t crc(uint8_t *data);
size_t write(uint8_t data)
SPP(BTD *p, const char *name="Arduino", const char *pin="0000")
void ACLData(uint8_t *ACLData)