code: private void sendMessage(BeanMessageID type, Buffer payload) {
          Buffer buffer = new Buffer();
          buffer.writeByte((type.getRawValue() >> 8) & 0xff);
          buffer.writeByte(type.getRawValue() & 0xff);
          if (payload != null) {
              try {
                  buffer.writeAll(payload);
              } catch (IOException e) {
                  throw new RuntimeException(e);
              }
          }
          GattSerialMessage serialMessage = GattSerialMessage.fromPayload(buffer.readByteArray());
          gattClient.getSerialProfile().sendMessage(serialMessage.getBuffer());
      }
docs: Send a message to Bean with a payload.
  @param type      The {@link com.punchthrough.bean.sdk.internal.BeanMessageID} for the message
  @param payload   The message payload to send