xvcv

Dependencies:   BLE_API mbed nRF51822

Fork of MEDRON_SNIFFER_ABCD-KIMLIKLI-OLANLARI-TARAMA-YAPAR_30062016 by HAKAN AYDIN

Revision:
13:5f87b9cdeb6f
Parent:
12:f4b869da449c
Child:
14:59ba4a2a17c7
--- a/main.cpp	Fri Mar 18 15:30:12 2016 +0000
+++ b/main.cpp	Wed Mar 23 14:45:07 2016 +0000
@@ -13,12 +13,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #include "mbed.h"
 #include "toolchain.h"
 #include "ble/BLE.h"
 
-//ABCD bir kimlik olarak belirlenir ve şifre vazifsedi görür herhangi bir bluetooth modülü ABCD içerirse burada görülecektir.
+//ABCD bir kimlik olarak belirlenir ve şifre vazifedi görür herhangi bir bluetooth modülü ABCD içerirse burada görülecektir.
+//Yayın okuyan program
 
 DigitalOut alivenessLED(LED1, 1);
 Ticker     ticker;
@@ -47,7 +47,7 @@
     } PACKED;
 
     static const uint16_t MED_KIMLIK = 0xABCD;
-
+    
     /* Search for the manufacturer specific data with matching application-ID */
     AdvertisingData_t *pAdvData;
     size_t index = 0;
@@ -55,21 +55,22 @@
         pAdvData = (AdvertisingData_t *)&params->advertisingData[index];
         if (pAdvData->dataType == GapAdvertisingData::MANUFACTURER_SPECIFIC_DATA) {
             ApplicationData_t *pAppData = (ApplicationData_t *)pAdvData->data;
-            if (pAppData->applicationSpecificId == MED_KIMLIK) {
+            if (pAppData->applicationSpecificId == MED_KIMLIK ) {
                 /* dump information on the console. */
-                
+                  
+                pc.printf("&name=aysegul&pass=123&sender=sniffer1&temparaturedata=");// Birinci Sniffer
                 pc.printf("%02x%02x",0xFA,0xCC);//BASLANGIC BİTLERİ
                 //MAC adresi, RSSI 
-                pc.printf("%02x%02x%02x%02x%02x%02x%d",
-                params->peerAddr[5], params->peerAddr[4], params->peerAddr[3], params->peerAddr[2], params->peerAddr[1], params->peerAddr[0],params->rssi); 
+                pc.printf("%02x%02x%02x%02x%02x%02x%x",
+                params->peerAddr[5], params->peerAddr[4], params->peerAddr[3], params->peerAddr[2], params->peerAddr[1], params->peerAddr[0],((params->rssi)*-1)); 
                 pc.printf("%02x",  params->advertisingDataLen);// AdvDATA UZUNLUGU
-                for (unsigned index = 0; index < params->advertisingDataLen; index++) {
+                /* RSSI DEĞERİNİ DECİMALE ÇEVİRDİKTEN SONRA -1 İLE ÇARPILMALIDIR.  */
+                for (unsigned index = 0; index < params->advertisingDataLen; index++) 
+                {
                         pc.printf("%02x", params->advertisingData[index]);
                 }
-                 pc.printf("%02x\r",0xFF);// BITIS
+                pc.printf("%02x\r",0xFF);// BITIS
                 
-                //printf("From [%02x %02x %02x], ", params->peerAddr[2], params->peerAddr[1], params->peerAddr[0]);
-                //printf("Temp is %f\r\n", (TMP_nrf51::TempSensorValue_t)pAppData->tmpSensorValue);
                 break;
             }
         }
@@ -117,7 +118,9 @@
     for(uint8_t say=0; say<5; say++ )
     { 
         wait(1);
-        pc.printf("wifi_id=AndroidAP|<>|pass=duqy0286");
+         pc.printf("wifi_id=MedronTeknoloji|<>|pass=medron2011");
+       
+        //pc.printf("wifi_id=AndroidAP|<>|pass=duqy0286"); //Ayşegülün telefonuna bağlanırken kullanıyorduk
         pc.printf("\r");
         
     }