code: public static GattSerialMessage fromPayload(byte[] payload) {
          Buffer buffer = new Buffer();
          byte[] header = new byte[2];
          header[0] = (byte) (payload.length & 0xff);
          header[1] = 0;
          int crc = computeCRC16(header, 0, header.length);
          crc = computeCRC16(crc, payload, 0, payload.length);
          buffer.write(header);
          buffer.write(payload);
          buffer.writeByte(crc & 0xff);
          buffer.writeByte((crc >> 8) & 0xff);
          return new GattSerialMessage(buffer);
      }
docs: Create a GattSerialMessage from a byte array payload
  
  In this case, "payload" means the properly packed message ID and message payload.
  
  Example: For the message CC_LED_WRITE_ALL (0x2001)
  
  GattSerialMessage.fromPayload(new byte[] {
  0x20, 0x01,                           <--- Message ID big endian
  0x00, 0x00, 0x00,                     <--- Payload data little endian
  });
  
  @param payload    Byte array of the message payload