Mwadime Makokha / Mbed 2 deprecated BlueToothSIM868

Dependencies:   mbed

Revision:
2:83d03d7148a5
Parent:
1:940070f92554
--- a/main.cpp	Thu Nov 14 14:02:32 2019 +0000
+++ b/main.cpp	Thu Nov 14 22:38:08 2019 +0000
@@ -3,6 +3,24 @@
 char modem_response[255];
  int main(){
     //Serial modemSerial(PC_6, PC_7);
+    // BT bt(modemSerial);
+//   // MDB mdb(huart1);
+//    DEBUG_PRINTLN("sTART");
+//      bt.get_bt_status();
+//     bt.power_bt_device(1);
+//     bt.bt_unpair_device(); 
+//     char id = bt.bt_scan(120000);
+//     if(id=='0'){
+//         DEBUG_PRINTLN("Target device not found");
+//     }
+//     else{
+//       ThisThread::sleep_for(4000);
+//        bt.bt_pair_device(id);
+//        ThisThread::sleep_for(2000);
+//        char profile_id = bt.bt_get_profile_id(id);
+//        DEBUG_PRINTLN("%c",profile_id);
+//        bt.bt_connect_device(id,profile_id);
+//        }
     BT bt(modemSerial);
     DEBUG_PRINTLN("PROGRAM START");
     MODEM_PRINTLN("ATE0");
@@ -15,12 +33,9 @@
          return 0;
     }
     DEBUG_PRINTLN("%s",modem_response);
-    MODEM_PRINTLN("AT+BTHOST?");
-    get_response(1000,true);
-    DEBUG_PRINTLN("%s",modem_response);
      bt.get_bt_status();
      bt.power_bt_device(1);
-     char id = bt.bt_scan();
+     char id = bt.bt_scan(120000);
      if(id=='0'){
          DEBUG_PRINTLN("Target device not found");
      }