public void sendMessage(String mac,MessageItem item,boolean needResponse,OnSendMessageListener listener){
  if (mCurrStatus != STATUS.CONNECTED)   connectDevice(mac,listener);
  mMessageQueue.add(item);
  WriteRunnable writeRunnable=new WriteRunnable(listener,needResponse);
  mExecutorService.submit(writeRunnable);
}

public void sendMessage ( String mac , MessageItem item , boolean needResponse , OnSendMessageListener listener ) { if ( mCurrStatus != STATUS . CONNECTED ) connectDevice ( mac , listener ) ; mMessageQueue . add ( item ) ; WriteRunnable writeRunnable = new WriteRunnable ( listener , needResponse ) ; mExecutorService . submit ( writeRunnable ) ; }
send a message to a remote device . if the local device did ' t connected to the remote devices , it will call connectdevice ( ) , then send the message . you can obtain a response from the remote device , just as http . however , it will blocked if didn ' t get response from the remote device .
