News:

Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com

Main Menu

noob wants to know a b c's of building divers for hardware

Started by deathbellstar, January 27, 2010, 01:04:32 AM

Previous topic - Next topic

tschak909

did you do an sqlCVS checkin of DCE and IR referencing the trac ticket?

-Thom

mhorst

Yep. Did something go wrong?

tschak909

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

You're welcome :)

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

Kooma

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

Kooma is totally right. A short How-To to create new Templates would be very usefull.

mhorst

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.)

tschak909

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

hi
can you point me in the right direction of a c++ interface driver using udp as an example
steve

tschak909

Look at the VistaICM2 driver in src/VistaICM2 of the source tree. Los93sol and I wrote it.

-Thom

mhorst

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

AIGH!

DO NOT DO MANUAL QUERIES TO MODIFY PRIMARY KEYS!

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

-Thom

mhorst

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.