// Send data message to the all nodes on the channel. public boolean sendDataToAll(String toChannel, byte[] buf) { if (mChord == null) { Log.v(TAG, "sendDataToAll : mChord IS NULL !!"); return false; } // Request the channel interface for the specific channel name. IChordChannel channel = mChord.getJoinedChannel(toChannel); if (null == channel) { Log.e(TAG, TAGClass + "sendDataToAll : invalid channel instance"); return false; } byte[][] payload = new byte[1][]; payload[0] = buf; Log.v(TAG, TAGClass + "sendDataToAll : " + new String(buf)); /* * @param payloadType User defined message type. It is mandatory. * @param payload The package of data to send * @return Returns true when file transfer is success. Otherwise, false * is returned. */ if (false == channel.sendDataToAll(CHORD_APITEST_MESSAGE_TYPE, payload)) { Log.e(TAG, TAGClass + "sendDataToAll : fail to sendDataToAll"); return false; } return true; }