Hi guys,
I'm not sure where is the problem....
I have a communication between my Arduino Uno and my Samsung S7 using a HM-10 BLE.
I have modified the Erel's sample. A Timer is sending data from Arduino to cellphone and the cellphone replies with another value.
Everything is ok to this point. Since everything is working in a service (StartForeground), every time the cell phone sleeps, communication is maintained, the same when the APP is swipe. So far everything is normal.
When I turn off the bluetooth sensor and then turn it on, the service is always runnig (I can see a Log() in Timer) but the communication between cellphone and Arduino does not restart.
The instruction "manager.Scan" starts when the bluetooth service is on again (manager.STATE_POWERED_ON) but the event Manager_DeviceFound never fires.
May be this is not correct but, I'm trying to understand wha's happening.
I have put a button in the main activity and in its Click event, I execute StartService (Me) and the event Manager_DeviceFound works, restarting the communication.
Anybody knows what's happening?, why Manager_DeviceFound doesn't work automatically?
I'm not sure where is the problem....
I have a communication between my Arduino Uno and my Samsung S7 using a HM-10 BLE.
I have modified the Erel's sample. A Timer is sending data from Arduino to cellphone and the cellphone replies with another value.
Everything is ok to this point. Since everything is working in a service (StartForeground), every time the cell phone sleeps, communication is maintained, the same when the APP is swipe. So far everything is normal.
When I turn off the bluetooth sensor and then turn it on, the service is always runnig (I can see a Log() in Timer) but the communication between cellphone and Arduino does not restart.
The instruction "manager.Scan" starts when the bluetooth service is on again (manager.STATE_POWERED_ON) but the event Manager_DeviceFound never fires.
May be this is not correct but, I'm trying to understand wha's happening.
I have put a button in the main activity and in its Click event, I execute StartService (Me) and the event Manager_DeviceFound works, restarting the communication.
Anybody knows what's happening?, why Manager_DeviceFound doesn't work automatically?