Esempio n. 1
0
// Function Specification
//
//  Name: printSensorInfo
//
//  Description: Dump a sensor's info via printf
//
// End Function Specification
void printSensorInfo(uint16_t i_gsid)
{
// This prevents warnings of set but not used since without SNSR_DEBUG
// being set, the SNSR_DBG macros don't do anything.
#ifdef SNSR_DEBUG

    // Initialize variable j and k with NULL and then
    // point to sensor to avoid compilation error when SNSR_DEBUG is not
    // defined. j and k are only used with SNSR_DBG which is no-op statement
    // when SNSR_DEBUG is not defined.
    sensor_t * k = NULL;
    k = G_amec_sensor_list[i_gsid];
    uint16_t * j = NULL;
    j = G_amec_sensor_list[i_gsid]->mini_sensor;

    // Print Sensors Information from Sensor_info_t Table
    SNSR_DBG("Sensor [%d] = Name: %s, Units: %s, Type: 0x%04x, Loc: 0x%04x, Num: %d, Freq: 0x%08x, Scale: 0x%08x\n",
             i_gsid,
             G_sensor_info[i_gsid].name,
             G_sensor_info[i_gsid].sensor.units,
             G_sensor_info[i_gsid].sensor.type,
             G_sensor_info[i_gsid].sensor.location,
             G_sensor_info[i_gsid].sensor.number,
             G_sensor_info[i_gsid].sensor.freq,
             G_sensor_info[i_gsid].sensor.scalefactor
    );

    // Print Sensor Information from Sensor_t
    SNSR_DBG("SensorPtr=0x%08x, Sample=%d, Max=%d, Min=%d, Tag=%d, MiniSensorPtr=0x%08x, MiniSensorVal=0x%04x\n",
             (uint32_t) k,
             k->sample,
             k->sample_max,
             k->sample_min,
             k->update_tag,
             (uint32_t)k->mini_sensor,
             (NULL != j) ? *j : 0
    );

#endif
}
Esempio n. 2
0
// Function Specification
//
//  Name: printSensorInfo
//
//  Description: Dump a sensor's info via printf
//
// End Function Specification
void printSensorInfo(uint16_t i_gsid)
{
/* TEMP -- NOT SUPPORTED (NEED AMEC/DCOM) */
#if 0
    // Initialize variable j and k with NULL and then
    // point to sensor to avoid compilation error when SNSR_DEBUG is not
    // defined. j and k are only used with SNSR_DBG which is no-op statement
    // when SNSR_DEBUG is not defined.
    sensor_t * k = NULL;
    k = G_amec_sensor_list[i_gsid];
    uint16_t * j = NULL;
    j = G_amec_sensor_list[i_gsid]->mini_sensor;

    // Print Sensors Information from Sensor_info_t Table
    SNSR_DBG("Sensor [%d] = Name: %s, Units: %s, Type: 0x%04x, Loc: 0x%04x, Num: %d, Freq: 0x%08x, Scale: 0x%08x\n",
             i_gsid,
             G_sensor_info[i_gsid].name,
             G_sensor_info[i_gsid].sensor.units,
             G_sensor_info[i_gsid].sensor.type,
             G_sensor_info[i_gsid].sensor.location,
             G_sensor_info[i_gsid].sensor.number,
             G_sensor_info[i_gsid].sensor.freq,
             G_sensor_info[i_gsid].sensor.scalefactor
    );

    // Print Sensor Information from Sensor_t
    SNSR_DBG("SensorPtr=0x%08x, Sample=%d, Max=%d, Min=%d, Tag=%d, MiniSensorPtr=0x%08x, MiniSensorVal=0x%04x\n",
             (uint32_t) k,
             k->sample,
             k->sample_max,
             k->sample_min,
             k->update_tag,
             (uint32_t)k->mini_sensor,
             (NULL != j) ? *j : 0
    );
#endif
}