Beispiel #1
0
/**
 *
 * @param line
 */
static void process_line_read(const char *line) {
	char value[8] ALIGNED;
	uint8_t len = 3;
	uint8_t value8;

	if (sscan_uint8_t(line, PARAMS_TIMECODE, &value8) == 2) {
		if (value8 != 0) {
			ArtNetParamsUseTimeCode = true;
		}
		return;
	}

	if (sscan_uint8_t(line, PARAMS_NET, &value8) == 2) {
		ArtNetParamsNet = value8;
	} else if (sscan_uint8_t(line, PARAMS_SUBNET, &value8) == 2) {
		ArtNetParamsSubnet = value8;
	} else if (sscan_uint8_t(line, PARAMS_UNIVERSE, &value8) == 2) {
		ArtNetParamsUniverse = value8;
	} else if (sscan_char_p(line, PARAMS_OUTPUT, value, &len) == 2) {
		if(memcmp(value, "spi", 3) == 0) {
			ArtNetParamsOutputType = OUTPUT_TYPE_SPI;
		} else if(memcmp(value, "mon", 3) == 0) {
			ArtNetParamsOutputType = OUTPUT_TYPE_MONITOR;
		}
	}

}
/**
 *
 * @param line
 */
static void process_line_read(const char *line) {
	uint8_t value8;
	uint32_t value32;

	if (sscan_uint8_t(line, PARAMS_INTERFACE, &value8) == 2) {
		midi_interface = value8;
	}

	if (sscan_uint32_t(line, PARAMS_BAUDRATE, &value32) == 2) {
		if (value32 == 0) {
			midi_baudrate = MIDI_BAUDRATE_DEFAULT;
		} else {
			midi_baudrate = value32;
		}
	}
}
Beispiel #3
0
void SparkFunDmx::callbackFunction(const char *pLine) {
	assert(pLine != 0);

	uint8_t value8;
	uint16_t value16;

	if (Sscan::Uint8(pLine, PARAMS_DMX_MODE, &value8) == SSCAN_OK) {
		m_nDmxMode = value8;
	} else if (Sscan::Uint16(pLine, PARAMS_DMX_START_ADDRESS, &value16) == SSCAN_OK) {
		m_nDmxStartAddressMode = value16;
	} else if (sscan_uint8_t(pLine, SPARKFUN_PARAMS_POSITION, &value8) == SSCAN_OK) {
		m_nPosition = value8;
		m_bIsPositionSet = true;
	} else if (Sscan::Uint8(pLine, SPARKFUN_PARAMS_SPI_CS, &value8) == SSCAN_OK) {
		m_nSpiCs = value8;
		m_bIsSpiCsSet = true;
	} else if (Sscan::Uint8(pLine, SPARKFUN_PARAMS_RESET_PIN, &value8) == SSCAN_OK) {
		m_nResetPin = value8;
		m_bIsResetSet = true;
	} else if (Sscan::Uint8(pLine, SPARKFUN_PARAMS_BUSY_PIN, &value8) == SSCAN_OK) {
		m_nBusyPin = value8;
		m_bIsBusyPinSet = true;
	}
}