change to support changed IRuffyService
This commit is contained in:
parent
17b0e7d71a
commit
5e845e37f7
|
@ -6,9 +6,22 @@ import org.monkey.d.ruffy.ruffy.driver.IRTHandler;
|
|||
|
||||
interface IRuffyService {
|
||||
|
||||
void setHandler(IRTHandler handler);
|
||||
void addHandler(IRTHandler handler);
|
||||
void removeHandler(IRTHandler handler);
|
||||
|
||||
/** Connect to the pump
|
||||
*
|
||||
* @return 0 if successful, -1 otherwise
|
||||
*/
|
||||
int doRTConnect();
|
||||
|
||||
/** Disconnect from the pump */
|
||||
void doRTDisconnect();
|
||||
|
||||
/*What's the meaning of 'changed'?
|
||||
* changed means if a button state has been changed, like btton pressed is a change and button release another*/
|
||||
void rtSendKey(byte keyCode, boolean changed);
|
||||
void resetPairing();
|
||||
boolean isConnected();
|
||||
boolean isBoundToPump();
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class RuffyScripter {
|
|||
public RuffyScripter(final IRuffyService ruffyService) {
|
||||
this.ruffyService = ruffyService;
|
||||
try {
|
||||
ruffyService.setHandler(mHandler);
|
||||
ruffyService.addHandler(mHandler);
|
||||
idleDisconnectMonitorThread.start();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
Loading…
Reference in a new issue