[EMAIL PROTECTED] wrote:
> Hii all,
>         
>    Accessing SDRs for a system, i am using below code, whether it will give 
> SDRs information in a 
> system       
>
> //mycode.c
>
> ipmi_sdr_info_t *sdrs;
> rv = ipmi_sdr_info_alloc(domain, NULL, 0, 0, &sdrs);
> ipmi_sdr_fetch(sdrs, sdrs_fetched, tmp_obj);
>
> void
> sdrs_fetched(ipmi_sdr_info_t *sdrs,
>              int             err,
>              int             changed,
>              unsigned int    count,
>              void            *cb_data)
> {
>
>  for(int i=0;i<count;i++)
>   {
>     ipmi_sdr_t sdr;
>     rv = ipmi_get_sdr_by_index(sdrs, i, &sdr);
>     if (rv)
>     continue;
>                                                                               
>                                                
>     printf(\"Record_ID     =%d\\n\",sdr.record_id);
>     printf(\"Type          =%d\\n\",sdr.type);
>     printf(\"Major_version =%d\\n\",sdr.major_version);
>     printf(\"Minor_version =%d\\n\",sdr.minor_version);
>   }
>
> }
> ---------------------------
>   
This should be ok, though parsing your own SDRs is a lot of work.  
OpenIPMI does that for you, if you like.
> my question is i am passing the second parameter (ipmi_mc_t *mc) of following 
> function value is NULL, whether this is correct or wrong,please tell
> me.
>  
> \"rv = ipmi_sdr_info_alloc(domain, NULL, 0, 0, &sdrs);\"
>   
No, you need a real mc here, NULL will not work.  It has to know where 
to get the SDRs; each MC may have its own.

-corey

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

Reply via email to