From: <re...@us...> - 2006-08-30 17:29:11
|
Revision: 6081 http://svn.sourceforge.net/openhpi/?rev=6081&view=rev Author: renierm Date: 2006-08-30 10:29:04 -0700 (Wed, 30 Aug 2006) Log Message: ----------- #1549447 fixing unresolved event log test cases with the simulator Modified Paths: -------------- openhpi/trunk/plugins/simulator/sim_el.c openhpi/trunk/plugins/simulator/sim_el.h openhpi/trunk/src/safhpi.c Modified: openhpi/trunk/plugins/simulator/sim_el.c =================================================================== --- openhpi/trunk/plugins/simulator/sim_el.c 2006-08-29 14:46:01 UTC (rev 6080) +++ openhpi/trunk/plugins/simulator/sim_el.c 2006-08-30 17:29:04 UTC (rev 6081) @@ -32,7 +32,30 @@ return err; } +SaErrorT sim_el_set_state(void *hnd, SaHpiResourceIdT id, SaHpiBoolT state) +{ + struct oh_handler_state *h = (struct oh_handler_state *)hnd; + + if (!hnd || !id) + return SA_ERR_HPI_INVALID_PARAMS; + + h->elcache->enabled = state; + + return SA_OK; +} +SaErrorT sim_el_get_state(void *hnd, SaHpiResourceIdT id, SaHpiBoolT *state) +{ + struct oh_handler_state *h = (struct oh_handler_state *)hnd; + + if (!hnd || !id) + return SA_ERR_HPI_INVALID_PARAMS; + + *state = h->elcache->enabled; + + return SA_OK; +} + SaErrorT sim_el_set_time(void *hnd, SaHpiResourceIdT id, SaHpiTimeT time) { struct oh_handler_state *state; @@ -146,6 +169,12 @@ void * oh_get_el_info (void *, SaHpiResourceIdT, SaHpiEventLogInfoT *) __attribute__ ((weak, alias("sim_el_get_info"))); +void * oh_set_el_state (void *, SaHpiResourceIdT, SaHpiBoolT) + __attribute__ ((weak, alias("sim_el_set_state"))); + +void * oh_get_el_state (void *, SaHpiResourceIdT, SaHpiBoolT *) + __attribute__ ((weak, alias("sim_el_get_state"))); + void * oh_set_el_time (void *, SaHpiResourceIdT, const SaHpiEventT *) __attribute__ ((weak, alias("sim_el_set_time"))); @@ -162,5 +191,3 @@ void * oh_reset_el_overflow (void *, SaHpiResourceIdT) __attribute__ ((weak, alias("sim_el_overflow"))); - - Modified: openhpi/trunk/plugins/simulator/sim_el.h =================================================================== --- openhpi/trunk/plugins/simulator/sim_el.h 2006-08-29 14:46:01 UTC (rev 6080) +++ openhpi/trunk/plugins/simulator/sim_el.h 2006-08-30 17:29:04 UTC (rev 6081) @@ -1,6 +1,6 @@ /* -*- linux-c -*- * - * (C) Copyright IBM Corp. 2005 + * (C) Copyright IBM Corp. 2005,2006 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,6 +16,8 @@ SaErrorT sim_el_get_info(void *hnd, SaHpiResourceIdT id, SaHpiEventLogInfoT *info); +SaErrorT sim_el_set_state(void *hnd, SaHpiResourceIdT id, SaHpiBoolT state); +SaErrorT sim_el_get_state(void *hnd, SaHpiResourceIdT id, SaHpiBoolT *state); SaErrorT sim_el_set_time(void *hnd, SaHpiResourceIdT id, SaHpiTimeT time); SaErrorT sim_el_add_entry(void *hnd, SaHpiResourceIdT id, const SaHpiEventT *Event); @@ -27,4 +29,3 @@ SaHpiRptEntryT *rptentry); SaErrorT sim_el_clear(void *hnd, SaHpiResourceIdT id); SaErrorT sim_el_overflow(void *hnd, SaHpiResourceIdT id); - Modified: openhpi/trunk/src/safhpi.c =================================================================== --- openhpi/trunk/src/safhpi.c 2006-08-29 14:46:01 UTC (rev 6080) +++ openhpi/trunk/src/safhpi.c 2006-08-30 17:29:04 UTC (rev 6081) @@ -897,7 +897,7 @@ if (!set_el_state) { oh_release_handler(h); - return SA_ERR_HPI_UNSUPPORTED_API; + return SA_ERR_HPI_INVALID_CMD; } rv = set_el_state(h->hnd, ResourceId, Enable); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |