Author Topic: noob wants to know a b c's of building divers for hardware  (Read 19116 times)

mhorst

  • Veteran
  • ***
  • Posts: 72
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #15 on: April 11, 2010, 07:32:12 pm »
Ok, done.

Trac Ticket number is #671 (http://svn.linuxmce.org/trac.cgi/ticket/671).

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #16 on: April 11, 2010, 07:43:24 pm »
did you do an sqlCVS checkin of DCE and IR referencing the trac ticket?

-Thom

mhorst

  • Veteran
  • ***
  • Posts: 72
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #17 on: April 11, 2010, 07:53:28 pm »
Yep. Did something go wrong?
« Last Edit: April 11, 2010, 07:55:11 pm by mhorst »

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #18 on: April 11, 2010, 08:13:17 pm »
Everything was checked in, and I have verified that it is in the master database. This has been added as device template #2127

Thank you so much for your contribution :)

-Thom

mhorst

  • Veteran
  • ***
  • Posts: 72
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #19 on: April 12, 2010, 10:14:34 am »
You're welcome :)

It was actually quite fun, I'm planning on contributing more in the future.

Kooma

  • Veteran
  • ***
  • Posts: 102
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #20 on: April 12, 2010, 03:14:44 pm »
Now that you succeeded so well and fast with the driver, would it be possible to document the whole process in wiki?

I know there are pages referenced already in this thread, but still, that would be a mega contribution.

I'm sure there a bunch of others like me that would like to compose some drivers or support for new devices, yet, it's too complicated (at least to me) with diffused and distributed information.

grind

  • Veteran
  • ***
  • Posts: 54
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #21 on: April 12, 2010, 10:19:38 pm »
Kooma is totally right. A short How-To to create new Templates would be very usefull.

mhorst

  • Veteran
  • ***
  • Posts: 72
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #22 on: April 13, 2010, 09:25:46 am »
I've already updated the http://wiki.linuxmce.org/index.php/How_to_add_your_own_GSD_device page, but the http://wiki.linuxmce.org/index.php/Edit_Device_Template page I reference there can still use some work.
I'll see what I can do.

BTW: I've only made an ethernet based driver, and have only added ethernet based examples to the wiki page. If somebody has experience with writing drivers for the other communication methods (RS232, USB, etc.), feel free to add the drivers you wrote to the examples section of the page, and note any differences in creation. (For RS232 drivers the device data probably has to contain the COM port to be used by the core, instead of the TCP port, but I have no idea which id that field has.)
« Last Edit: April 13, 2010, 09:34:29 am by mhorst »

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #23 on: April 13, 2010, 04:15:52 pm »
TCP is used when the TCP Port device data is specified. Serial Port is used when COM Port on PC device data is specified.

gonesurfing

  • Veteran
  • ***
  • Posts: 61
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #24 on: April 18, 2010, 06:05:48 am »
hi
can you point me in the right direction of a c++ interface driver using udp as an example
steve

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #25 on: April 18, 2010, 06:31:48 am »
Look at the VistaICM2 driver in src/VistaICM2 of the source tree. Los93sol and I wrote it.

-Thom

mhorst

  • Veteran
  • ***
  • Posts: 72
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #26 on: May 17, 2010, 07:29:55 pm »
I updated my system yesterday and it stopped working.

Took me a while to track it down; the id of the device template for my Proliphix driver had changed, during the update, but the template id referenced by already installed devices was not updated. Is this supposed to happen?

I had to do a manual mysql query to fix it, because according to the web-admin there was no such device (despite the fact that my thermostat was there in the list of devices :) ).

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #27 on: May 17, 2010, 08:53:01 pm »
AIGH!

DO NOT DO MANUAL QUERIES TO MODIFY PRIMARY KEYS!

Put it back, and change your code to reference the new template #.

-Thom

mhorst

  • Veteran
  • ***
  • Posts: 72
    • View Profile
Re: noob wants to know a b c's of building divers for hardware
« Reply #28 on: May 17, 2010, 11:05:03 pm »
No, I did NOT change the primary key. Upon re-reading my previous post, however, I can see how you can interpret it that way :)

I changed the foreign key in the Device table of the pluto_main database. My device with PK_Device=78 now has FK_DeviceTemplate=2127 (instead of FK_DeviceTemplate=2190). That's the only thing I changed, and I kinda considered that the obvious thing to do (I'll try express myself better next time :))

I was just surprised that the foreign keys in other tables do not change automatically when the primary key is changed.