Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

Récupérer l'adresse MAC la plus proche en Bluetooth

Solved! Go to Solution.

Bonjour, je suis actuellement en projet ou je dois pouvoir récupérer l'adresse MAC la plus proche reçu avec une HC-05, j'arrive à recevoir toutes les adresses Bluetooth environnante mais rien sur internet ne peux m'aider sur comment récupérer la plus proche, je code en Arduino . J'aurai besoin d'aide pour pouvoir récupéré l'adresse la plus proche après de nombreuses recherches je ne trouves rien pouvant m'aider pour cela, merci d'avance

#include <SoftwareSerial.h>                         // Software Serial Port
#define RxD         2
#define TxD         3
SoftwareSerial blueToothSerial(RxD,TxD);

void BT_com(String com)
{  blueToothSerial.print(com);
   Serial.println(com);
   delay(1000);
   while (blueToothSerial.available())
   {  char c = blueToothSerial.read();
      Serial.print(c);
   }
   Serial.println("");
   delay(1000);
}

void setup()
{
  Serial.begin(9600);
  pinMode(RxD, INPUT);
  pinMode(TxD, OUTPUT);
    
	blueToothSerial.begin(38400);
  BT_com("AT+ORGL\r\n");
  BT_com("AT+NAME=RSSI\r\n");
  BT_com("AT+ROLE=1\r\n");
	BT_com("AT+INIT\r\n");
	BT_com("AT+IAC=9e8b33\r\n");
  BT_com("AT+CLASS=0\r\n");
  BT_com("AT+INQM=1,9,48\r\n");
blueToothSerial.print("AT+INQ\r\n");
}

void loop()
{  
  char c;
  if (blueToothSerial.available())
  { c = blueToothSerial.read();
    Serial.print(c);
  }
}

 

1 Reply
Solution
Community Manager
Message 2 of 2

Re: Récupérer l'adresse MAC la plus proche en Bluetooth

Thanks for participating!

 

We take our Code of Conduct very seriously and want to help ensure that everyone has a good experience free of antagonism and harassment. Unfortunately, we don't currently have moderators for languages other than English. What this means is that, until that changes, we need to ask that everyone use English here in the GitHub Community Forum when posting. We'll be locking any posts in languages other than English for now, including this one.

 

Thanks for meeting us halfway 😀

Be sure to click Accept as Solution to mark helpful posts to help other users locate important info. Also, don't forget to give Kudos for great content!