Author Topic: creating CM19A device  (Read 2478 times)

rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
creating CM19A device
« on: August 30, 2010, 02:34:45 am »
ok need a little help please...

Created a device template for the CM19A, set whatever option were necessary for detection of the device, device gets found..... great. now the rest

Ran DCEGen -d 2149 for the device which created the desired c++ files, put in some simple commands just to test if it would work..

Next would be to compile the project and make sure it registers with DCERouter when i run it......

Compiling is were the problems start (well actually not sure if it is a problem)

I just ran make all and got the following errors which i'm not sure why, because i didn't change or add/remove any code. in any of the files that have the errors.

Quote
dcerouter_1012443:/home/src/CM19A# make all      
Computing dependencies for ../Gen_Devices/CM19ABase.cpp done
Computing dependencies for CM19A.cpp done
Computing dependencies for Main.cpp done
g++ -c -I.. -I../DCE -I/usr/include/mysql -DKDE_LMCE -DDEBUG -DTHREAD_LOG -DLOG_ALL_QUERIES  -Wall -fPIC -ggdb3  Main.cpp -o Main.o
In file included from ../db_wrapper/db_wrapper.h:112,
                 from ../PlutoUtils/DBHelper.h:23,
                 from ../pluto_main/Database_pluto_main.h:3,
                 from ../pluto_main/Table_Device.h:21,
                 from ../DCE/DeviceData_Router.h:25,
                 from ../DCE/DCERouter.h:28,
                 from Main.cpp:23:
../db_wrapper/db_wrapper_mysql.h:7:25: error: mysql/mysql.h: No such file or directory
In file included from ../pluto_main/Database_pluto_main.h:3,
                 from ../pluto_main/Table_Device.h:21,
                 from ../DCE/DeviceData_Router.h:25,
                 from ../DCE/DCERouter.h:28,
                 from Main.cpp:23:
../PlutoUtils/DBHelper.h:36: error: ISO C++ forbids declaration of ‘MYSQL_RES’ with no type
../PlutoUtils/DBHelper.h:36: error: expected ‘;’ before ‘*’ token
../PlutoUtils/DBHelper.h: In constructor ‘PlutoSqlResult::PlutoSqlResult()’:
../PlutoUtils/DBHelper.h:37: error: class ‘PlutoSqlResult’ does not have any field named ‘r’
../PlutoUtils/DBHelper.h: In member function ‘void PlutoSqlResult::ClearResults()’:
../PlutoUtils/DBHelper.h:44: error: ‘r’ was not declared in this scope
../PlutoUtils/DBHelper.h:46: error: ‘mysql_free_result’ was not declared in this scope
../PlutoUtils/DBHelper.h: At global scope:
../PlutoUtils/DBHelper.h:64: error: ISO C++ forbids declaration of ‘MYSQL’ with no type
../PlutoUtils/DBHelper.h:64: error: expected ‘;’ before ‘*’ token
../PlutoUtils/DBHelper.h:164: error: ‘MYSQL’ has not been declared
../PlutoUtils/DBHelper.h:180: error: ISO C++ forbids declaration of ‘MYSQL_RES’ with no type
../PlutoUtils/DBHelper.h:180: error: expected ‘;’ before ‘*’ token
Main.cpp:258: error: expected `;' at end of input
Main.cpp:258: error: expected `}' at end of input
../PlutoUtils/DBHelper.h: In constructor ‘DBHelper::DBHelper()’:
../PlutoUtils/DBHelper.h:74: error: ‘m_pDB’ was not declared in this scope
../PlutoUtils/DBHelper.h: In constructor ‘DBHelper::DBHelper(std::string, std::string, std::string, std::string, int)’:
../PlutoUtils/DBHelper.h:97: error: ‘m_pDB’ was not declared in this scope
../PlutoUtils/DBHelper.h: In destructor ‘virtual DBHelper::~DBHelper()’:
../PlutoUtils/DBHelper.h:111: error: ‘m_pDB’ was not declared in this scope
../PlutoUtils/DBHelper.h:112: error: ‘mysql_close’ was not declared in this scope
../PlutoUtils/DBHelper.h:113: error: ‘m_pDB’ was not declared in this scope
../PlutoUtils/DBHelper.h: In member function ‘bool DBHelper::DBConnect(bool)’:
../PlutoUtils/DBHelper.h:133: error: ‘m_pDB’ was not declared in this scope
../PlutoUtils/DBHelper.h:137: error: ‘mysql_close’ was not declared in this scope
../PlutoUtils/DBHelper.h:140: error: ‘m_pDB’ was not declared in this scope
../PlutoUtils/DBHelper.h:142: error: ‘mysql_init’ was not declared in this scope
../PlutoUtils/DBHelper.h:151: error: ‘m_pDB’ was not declared in this scope
../PlutoUtils/DBHelper.h:151: error: ‘mysql_real_connect’ was not declared in this scope
../PlutoUtils/DBHelper.h:154: error: ‘mysql_error’ was not declared in this scope
../PlutoUtils/DBHelper.h: In member function ‘void DBHelper::SetConnection(int*)’:
../PlutoUtils/DBHelper.h:166: error: ‘m_pDB’ was not declared in this scope
../PlutoUtils/DBHelper.h: In member function ‘std::string DBHelper::md5(std::string)’:
../PlutoUtils/DBHelper.h:173: error: ‘MYSQL_ROW’ was not declared in this scope
../PlutoUtils/DBHelper.h:173: error: expected `;' before ‘row’
../PlutoUtils/DBHelper.h:174: error: ‘class PlutoSqlResult’ has no member named ‘r’
../PlutoUtils/DBHelper.h:174: error: ‘db_wrapper_query_result’ was not declared in this scope
../PlutoUtils/DBHelper.h:174: error: ‘row’ was not declared in this scope
../PlutoUtils/DBHelper.h:174: error: ‘class PlutoSqlResult’ has no member named ‘r’
../PlutoUtils/DBHelper.h:174: error: ‘mysql_fetch_row’ was not declared in this scope
../PlutoUtils/DBHelper.h:177: error: ‘row’ was not declared in this scope
../PlutoUtils/DBHelper.h: At global scope:
../PlutoUtils/DBHelper.h:178: error: expected unqualified-id at end of input
make: *** [Main.o] Error 1

Any pointers from the all knowing? thank you very much..

Richard
« Last Edit: August 30, 2010, 05:59:49 am by rperre »

rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
Re: creating simple c++ device
« Reply #1 on: August 30, 2010, 04:27:28 am »
ok figured out you need to have libmysqlclient15-dev installed before trying to compile, awesome. another step closer.

Richard

rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
Re: creating simple c++ device
« Reply #2 on: August 30, 2010, 05:59:03 am »
This is awesome, i have succesfully created the commands and they are firing when selecting the send commands from webadmin.

I had to make the serializedclass, plutoutils and dce before compiling was succesfull, is this normal?

I'm starting to like this :)

Ok now i have to implement all commands the right way and make the package so it's all pnp.

Richard

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5505
  • DOES work for LinuxMCE.
    • View Profile
Re: creating CM19A device
« Reply #3 on: August 30, 2010, 06:18:27 am »
yup, you can either do that, or copy the contents of /usr/pluto/lib into src/lib, which is typically what I do when I get a fresh tree.

-Thom

rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
Re: creating CM19A device
« Reply #4 on: August 30, 2010, 01:46:42 pm »
Thanks Thom, very useful information.

Richard

rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
Re: creating CM19A device
« Reply #5 on: September 01, 2010, 07:51:16 pm »
Question,

I see that when i created the device with LMCE and run the device it creates another device in /dev/CM19A

The driver i have already creates a device in /dev/cm19a0

So can i make my driver file the header for the device template and make it all 1 piece?

Just not completely sure how it all ties in.

Richard

valent

  • Guru
  • ****
  • Posts: 381
    • View Profile
    • /kernel_reloaded/
Re: creating CM19A device
« Reply #6 on: December 19, 2010, 09:54:39 pm »
Do latest LinuxMCE snapshots support CM19A out of the box, or should I buy CM11 and be a little more patient for CM19A?
LinuxMCE - If it was easy, everybody would be doing it!!
My setup - http://wiki.linuxmce.org/index.php/User:Valent

rperre

  • Guru
  • ****
  • Posts: 264
    • View Profile
Re: creating CM19A device
« Reply #7 on: December 21, 2010, 04:48:55 pm »
valent, doing a revert my CM19A was deleted and i never finished it, i'll try to use the CM15 template and see if it's working

I also only have lights, so i cannot test the CM19A with cameras or other stuff if i happen to finish the device.

Richard