Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C12832 GPS GSM mbed
Fork of myBlueUSB_localfix by
Diff: TestShell.cpp
- Revision:
- 2:9f25a7fa1a54
- Parent:
- 0:003889bc474f
- Child:
- 3:55a622e3dbb5
--- a/TestShell.cpp Sat Dec 07 14:20:19 2013 +0000
+++ b/TestShell.cpp Sun Dec 08 21:52:09 2013 +0000
@@ -70,7 +70,8 @@
RemoteNameRequest(a);
for (i++; i < count; i++) {//find the next device to open
printfBytes("DEVICE CLASS",devs[i]->_info.dev_class,3);
- if (devs[i]->_handle == 0 && memcmp(devs[i]->_info.dev_class, FtDevClass, 3)==0) {//or some other way to connect to RFCOMM devices
+ //if (devs[i]->_handle == 0 && memcmp(devs[i]->_info.dev_class, FtDevClass, 3)==0) {//or some other way to connect to RFCOMM devices
+ if (devs[i]->_handle == 0) { //
BD_ADDR* bd = &devs[i]->_info.bdaddr;
printf("Connecting to ");
printf(bd);
@@ -256,7 +257,8 @@
printf("Sending CONN_ACK\n");
Socket_Send(socket, connack, sizeof(connack));
} else {
- //Socket_Send(socket, data, len);
+ printf("echo back: len=%d, data[0]=%x\n", len, data[0]);
+ Socket_Send(socket, data, len); // uncomment
printfBytes("echo:", data, len);
}
}
@@ -280,17 +282,17 @@
int sock = OpenFtBtDevice(d);
}
state = 2;
- //comm = Socket_Listen(SOCKET_RFCOM, 1, echo, 0);
+ comm = Socket_Listen(SOCKET_RFCOM, 1, echo, 0); // uncomment
//incoming = new btserial(1);
}
break;
case 2://main loop
- /* if (incoming->readable()>0){
+ /*if (incoming->readable()>0){
int c= incoming->getc();
putc(c, stderr);
incoming->putc(c);
}
- else if (incoming->readable()<0){
+ else if (incoming->readable()<0){
state = 3;
printf("end of session");
delete incoming;
