jdunmire / HC05

Arduino Library for the HC-05 bluetooth transciever
MIT License
125 stars 62 forks source link

Retrieve data from HC05 via AT commands #2

Closed smigielski closed 9 years ago

smigielski commented 11 years ago

It will be good to have method for retrieving data via AT commands. For example AT+STATE? should allow to easily retrieve INITIALIZED string or whatever status of the module is.

the method could be: int get(const char* cmd, char& result, unsigned long timeout=100); result will contain either param from AT command or eerorn number coded as hex.

I will also add result vector to cmd function in order to have a possibility to retrieve error number from module.

jdunmire commented 10 years ago

If you have a patch that implements the get() method I would be happy to add it.

Saishdhuri commented 10 years ago

Hey, i am an engineering student.. i want to to access my HC05 status for my project. Did u implement that patch ? Can u help ?

jdunmire commented 10 years ago

I have not received a patch for the get() method and I have not implemented it.

Saishdhuri commented 10 years ago

I am working on a project using HC05 and arduino uno board where i wish to see if a device is connected to HC05 or not.. i am to understand that the state pin of hc05 returns the current state of the bluetooth module.. can anyone help me out?

jdunmire commented 10 years ago

That is correct. See lines 165-169 of HC05.cpp for an example of using it for just that purpose.