Hi!

niahoo osef wrote:
[...]
> With a friend, we are trying to implement the protocol of sending commands to
> xmms2 via TCP in Elixir (or Erlang). We feel it's hard to find the appropriate
> documentation but I eventually managed to gather some information on the wiki,
> hence the title of this email.

When I was implementing a client library  in Scheme¹, I was faced with a
similar problem.  I have been  making a couple  of notes² along  the way
that may be helpful.

> At the moment, we are able to send a hello command to the server. We figured
> how to do this by looking at the code of a javascript client.
>
> I would like to know where is the more fiable source that says that a "hello"
> command is "32", that an error type is "1", integer is "2" and must be 64bits,
> how to properly encode payload and what to expect in return, …

Most of  the server's API is  actually documented in a  machine readable
file³, which  you should use to  generate most of your  library. This is
true for constants (like what command id is correct for HELLO?) as well.

There are only a  couple of constants I couldn't find  in that spec, and
those are the identifiers for the protocol's types.

> I don't mind reading any code but I'm far from good at C. I can't find the
> python source code for a module named "xmmsapi" that xmmsclient depends on.

If Scheme makes you happier, feel free to  take a look at what I got⁴. I
think the first  ability you need is  to read data from  the server. For
that you  need to  be able to  parse a message's  header. Then  you need
serialisation and deserialisation  of the protocol's data  types to deal
with building and reading payload to and from the server. And after that
you can generate the actual API from ipc.xml.


Regards, Frank

¹ https://github.com/ft/xmms2-guile

² https://github.com/ft/xmms2-guile/blob/master/doc/xmms2-protocol.mdwn
  If you  clone the repository  and have pandoc installed,  this renders
  into  a PDF  as well  — I  don't know  if github's  Markdown rendering
  understands all the markup.

³ https://github.com/xmms2/xmms2-devel/blob/master/src/ipc.xmlhttps://github.com/ft/xmms2-guile/tree/master/tests

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925

--
_______________________________________________
Xmms2-devel mailing list
Xmms2-devel@lists.xmms2.org
https://lists.xmms2.org/cgi-bin/mailman/listinfo/xmms2-devel

Reply via email to