コード例 #1
0
ファイル: protocol.c プロジェクト: abraxa/libsigrok
static int recv_log_u128x(const struct sr_dev_inst *sdi, GMatchInfo *match)
{
	static const int mqs[] = { SR_MQ_VOLTAGE, SR_MQ_VOLTAGE, SR_MQ_CURRENT, SR_MQ_CURRENT, SR_MQ_RESISTANCE, SR_MQ_VOLTAGE, SR_MQ_TEMPERATURE, SR_MQ_CAPACITANCE, SR_MQ_FREQUENCY, SR_MQ_DUTY_CYCLE, SR_MQ_PULSE_WIDTH, SR_MQ_VOLTAGE, SR_MQ_CURRENT, SR_MQ_CONDUCTANCE };
	static const int units[] = { SR_UNIT_VOLT, SR_UNIT_VOLT, SR_UNIT_AMPERE, SR_UNIT_AMPERE, SR_UNIT_OHM, SR_UNIT_VOLT, SR_UNIT_CELSIUS, SR_UNIT_FARAD, SR_UNIT_HERTZ, SR_UNIT_PERCENTAGE, SR_UNIT_SECOND, SR_UNIT_DECIBEL_MW, SR_UNIT_PERCENTAGE, SR_UNIT_SIEMENS };
	static const int exponents[] = { -6, -4, -9, -4, -3, -4, -1, -12, -3, -3, -6, -3, -2, -11 };

	return recv_log(sdi, match, mqs, units, exponents, ARRAY_SIZE(mqs));
}
コード例 #2
0
ファイル: protocol.c プロジェクト: abraxa/libsigrok
static int recv_log_u124xc(const struct sr_dev_inst *sdi, GMatchInfo *match)
{
	static const int mqs[] = { SR_MQ_VOLTAGE, SR_MQ_VOLTAGE, SR_MQ_CURRENT, SR_MQ_CURRENT, SR_MQ_RESISTANCE, SR_MQ_VOLTAGE, SR_MQ_TEMPERATURE, SR_MQ_CAPACITANCE, SR_MQ_FREQUENCY, SR_MQ_HARMONIC_RATIO, SR_MQ_CURRENT };
	static const int units[] = { SR_UNIT_VOLT, SR_UNIT_VOLT, SR_UNIT_AMPERE, SR_UNIT_AMPERE, SR_UNIT_OHM, SR_UNIT_VOLT, SR_UNIT_CELSIUS, SR_UNIT_FARAD, SR_UNIT_HERTZ, SR_UNIT_PERCENTAGE, SR_UNIT_PERCENTAGE };
	static const int exponents[] = { -5, -4, -7, -3, -2, -3, -1, -10, -2, -2, -2 };

	return recv_log(sdi, match, mqs, units, exponents, ARRAY_SIZE(mqs));
}
コード例 #3
0
ファイル: syslog_drv.c プロジェクト: alepharchives/eddie
static void log_ready(int port, int readyfd)
{
    int received_fd;
    int len;
    char buf[MAX_LOG];
	
#if 0
    if (port != instance) return -1;
    if (readyfd != fdsrv) return -1;

    /* receive the file descriptor */
    recv_log(readyfd, &priority, buf);

    /* syslog it ..*/
    syslog(priority, buf);
#endif
    
    return;
}