Author Topic: GSD ETHERNET  (Read 575 times)

gonesurfing

  • Veteran
  • ***
  • Posts: 61
    • View Profile
GSD ETHERNET
« on: September 19, 2009, 04:44:23 am »
Hi,  I am after some information.  I have searched all the wiki and Google and read all the posts on GSD and ruby codes.  I have also read Learn to Program by Chris Pine.

I have decided that "GSD to Drive a Weeder I/O WTDIO-M LinuxMCE wiki" would be ideal for my lighting interface and have set up the GSD template and created child devices for my lights which all seem to be working on my floor plan layout using #192 #193 #184.  The wiki outlines a serial interface however I am trying to use the ethernet and have searched everywhere however I cannot find an example of how to add the IP and port number in the ruby code so LinuxMCE will forward my ruby snippets.

My interface is listening to incoming UDP packets on port 52737 (0xCE01).  The IP address of the interface is 192.168.80.129.

Can someone please post an example or point me in the direction of an example in the wiki?  Many thanks.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5495
  • DOES work for LinuxMCE.
    • View Profile
Re: GSD ETHERNET
« Reply #1 on: September 19, 2009, 05:06:56 am »
GSD can not handle UDP. TCP only.

You will need to write a C++ driver.

To do this, use the device template as usual, delete the launch command "Generic_Serial_Device" .. and use DCEGen (there is a page on the wiki) to create a C++ stubbed device that you can fill in an implementation for.

You will also need to do a checkout of the source code, and set up development packages needed to compile C++ code.

If you wish to pursue this further, come by the #linuxmce-devel channel, and we can help.

I know you probably didn't expect to hear this, but at least it is possible, and not too difficult if you understand the programming. :)

-Thom

gonesurfing

  • Veteran
  • ***
  • Posts: 61
    • View Profile
Re: GSD ETHERNET
« Reply #2 on: September 19, 2009, 05:57:03 am »
Hi,  Many thanks for your quick response.  I have been stumbling around with this for a couple of weeks.  It looks like I have a bit of reading to do in a different direction.  I will come over to the development channel when I have a better understanding of c++.  Can you recommend any beginners' guidebooks?
steve

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5495
  • DOES work for LinuxMCE.
    • View Profile
Re: GSD ETHERNET
« Reply #3 on: September 19, 2009, 06:24:37 am »
* Practical C programming,
* Practical C++ Programming

lots of C++ tutorials all over. Our classes are primarily built atop the Standard Template Library (STL), and are very portable.

-Thom

You will need to be patient, because you do have a lot to learn, however it is very rewarding to see something you've created function.

Once the code has been created, you can attach a patch, and check in the relevant database portions into the dce repository. We can create a package for it so that the system will automatically install the driver in response to finding the device.

Is there a definite MAC address range for the device? Is there a definite way to detect the device? If so, the pnp section of the device template can be filled out, and the device can automatically be installed when it appears on the network.

-Thom