Amir,

The spec B version does the interpretation by default, rather than
having to call the conversion routine every time.
Attached is some code with compile flags (see 'HPI_A') that shows the
difference in how sensors and readings are handled.

Andy 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Amir
Parniani
Sent: Wednesday, November 07, 2007 1:26 PM
To: [email protected]
Subject: [Openhpi-devel] Questions with porting from OpenHpi spec A
toOpenHpi Spec B.

Hi,

I am at the middle of porting some of my code from spec A to spec B.
Some structures and types have been changed or removed; I have some
questions with the usage of the ones which have been replaced and the
ones that have been removed. 

Thanks, 

-------------------------------------------------------
In structure: SaHpiSensorReadingT
Almost all the fields have changed and we use them all, is this the
replacement or how we use the new structure in comparison with the old
one. 

A spec:
typedef struct {
      SaHpiSensorReadingFormatsT  ValuesPresent;
      SaHpiUint32T                Raw;
      SaHpiSensorInterpretedT     Interpreted;
      SaHpiSensorEvtStatusT       EventStatus;
} SaHpiSe


B spec:
typedef struct {
      SaHpiBoolT                  IsSupported;
      SaHpiSensorReadingTypeT     Type;
      SaHpiSensorReadingUnionT    Value;
} SaHpiSensorReadingT;

-------------------------------------------------------
Type SaHpiSensorInterpretedTypeT has been removed what is the
corresponding in spec B. 

typedef enum {
      SAHPI_SENSOR_INTERPRETED_TYPE_UINT8,
      SAHPI_SENSOR_INTERPRETED_TYPE_UINT16,
      SAHPI_SENSOR_INTERPRETED_TYPE_UINT32,
      SAHPI_SENSOR_INTERPRETED_TYPE_INT8,
      SAHPI_SENSOR_INTERPRETED_TYPE_INT16,
      SAHPI_SENSOR_INTERPRETED_TYPE_INT32,
      SAHPI_SENSOR_INTERPRETED_TYPE_FLOAT32,
           SAHPI_SENSOR_INTERPRETED_TYPE_BUFFER    /* 32 byte array */
} SaHpiSensorInterpretedTypeT;

-------------------------------------------------------
saHpiSensorReadingConvert converts between raw and interpreted sensor
reading values has been deleted from spec B, what is the replacement for
it?


-------------------------------------------------------
In type: SaHpiTextTypeT

How does the ones from spec B. map to the old ones from spec A.

A spec:
typedef enum {
    SAHPI_TL_TYPE_BINARY = 0,     /* String of bytes, any values legal
*/
    SAHPI_TL_TYPE_BCDPLUS,        /* String of 0-9, space, dash, period
ONLY */
    SAHPI_TL_TYPE_ASCII6,         /* Reduced ASCII character set:
0x20-0x5F 
                                     ONLY */
    SAHPI_TL_TYPE_LANGUAGE        /* ASCII or UNICODE depending on
language */
} SaHpiTextTypeT;

B Spec.
typedef enum {
    SAHPI_TL_TYPE_UNICODE = 0,     /* 2-byte UNICODE characters;
DataLength
                                     must be even. */
    SAHPI_TL_TYPE_BCDPLUS,        /* String of ASCII characters,
"0"-"9", space,
                                     dash, period, colon, comma or
underscore
                                     ONLY */
    SAHPI_TL_TYPE_ASCII6,         /* Reduced ASCII character set:
0x20-0x5F
                                     ONLY */
    SAHPI_TL_TYPE_TEXT,           /* ASCII+Latin 1 */
    SAHPI_TL_TYPE_BINARY          /* Binary data, any values legal */
} SaHpiTextTypeT;

-------------------------------------------------------

Is MOTHPI_SENSOR_NUM_POST replacement for CTRL_NUM_POSTTYPE? If not what
do we use for CTRL_NUM_POSTTYPE?

-------------------------------------------------------

Is MOTHPI_LED_CONFIG_DEFAULT_AUTO_COLOR replacement for
HPI_LED_COLOR_DEFAULT?

-------------------------------------------------------
What are the replacements for these HPI_LED_STATE_STATE &
HPI_LED_STATE_OVERRIDE in spec B.

-------------------------------------------------------
Is SAHPI_HS_STATE_ACTIVE replacement for SAHPI_HS_STATE_ACTIVE_HEALTHY?

-------------------------------------------------------
The following has been deleted from spec B. 

typedef SaHpiUint8T SaHpiSensorReadingFormatsT;
#define SAHPI_SRF_RAW         (SaHpiSensorReadingFormatsT)0x01
#define SAHPI_SRF_INTERPRETED (SaHpiSensorReadingFormatsT)0x02 
#define SAHPI_SRF_EVENT_STATE (SaHpiSensorReadingFormatsT)0x04


 

------------------------------------------------------------------------
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel

Attachment: hpisensor.c
Description: hpisensor.c

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel

Reply via email to