Hii,
operation_loop ( os_hnd->operation_loop(os_hnd) ) is not running in my
program. In my program in the open() function,
i am allocating & initialize the os_handler ,then i spawned two threads,
first thread dedicated for running the
operation_loop ( os_hnd->operation_loop(os_hnd) ),second thread for
dedicated to making connection, opening the domian
to the IPMI server and getting the sensor details . my program as
follows..
-------------------------------------------------
static os_handler_t *os_hnd; //global variable
int Ipmi_Task::open()
{
os_hnd = ipmi_posix_setup_os_handler();
if(!os_hnd)
{
printf(\"Error:Unable to allocate to OS handler\\n\");
return 0;
}
//OpenIPMI init
ipmi_init(os_hnd);
// spawning first thread
spawn_n(1, ACE_THR_FUNC (first_thread),
ACE_reinterpret_cast (void *, NULL),
THR_NEW_LWP | THR_JOINABLE);
// spawning second thread
spawn_n(1, ACE_THR_FUNC (second_thread),
ACE_reinterpret_cast (void *, NULL),
THR_NEW_LWP | THR_JOINABLE);
}
void *first_thread()
{
os_hnd->operation_loop(os_hnd);
}
void handle_sensor(ipmi_entity_t *entity, ipmi_sensor_t *sensor, void *cb_data)
{
// taking sensor getails
}
void handle_entity(ipmi_entity_t *entity, void *cb_data)
{
ipmi_entity_iterate_sensors(entity, handle_sensor, tmp_obj);
}
void handle_domain(ipmi_domain_t *domain,
int err,
unsigned int conn_num,
unsigned int port_num,
int still_connected,
void *user_data)
{
if(err)
{
goto out;
}
ipmi_domain_iterate_entities(domain, handle_entity, tmp_obj);
out:
printf(\"Domain open error\\n\");
}
void *second_thread()
{
rv = ipmi_ip_setup_con(tip, tport, 1, authcode, priv_code, (void*)
this->m_user, user_length,(void *) this->m_pass, pass_length, os_hnd, NULL,
&con);
if (rv)
{
printf(\\\"Error:Unable to setting up LAN connection\\\\n\\\");
}
rv = ipmi_open_domain(\"\", &con, 1, handle_domain, this, NULL, NULL, NULL,
0, NULL);
if (rv)
{
printf(\\\"Error:Unable to open domain\\\\n\\\");
}
}
------------------------------------------------------------
my problem is \'operation_loop\' not running , please give the solution for
this problem .
Thanks,
Barani
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer