Esempio n. 1
0
/**
* Returns a PROGMEM string containing name of error code @e
* @param e error code
* @return a PROGMEM string pointer
*/
const __FlashStringHelper* esr::get_error_name(esr::error e)
{
	const __FlashStringHelper* message;

	// Pick a message text from flash
	switch (e)
	{
		_CASE(E_OK);
		_CASE(E_NO_FREE_THREAD_SLOTS);		
		_CASE(E_WRONG_THREAD);
		_CASE(E_MESSAGE_QUEUE_IS_FULL);
		_CASE(E_WRONG_MESSAGE);
		_CASE(E_WRONG_PERIOD);
		_CASE(E_TIMER_NOT_DEFINED);
		_CASE(E_NOT_IN_SCHEDULER);		
		_CASE(E_LOG_CONFIGURATION_IS_INCORRECT);
		_CASE(E_INCORRECT_FORMAT);

	default:
		message = reinterpret_cast<const __FlashStringHelper*>(res::E_UNKNOWN);
		break;
	}

	return message;
}
Esempio n. 2
0
static void
setOption(isc_opt_t *op, int which, void *rval)
{
     switch(which) {
	  _CASE(port, _OPT_INT(rval));
	  _CASE(tags, _OPT_INT(rval));
	  _CASE(maxluns, _OPT_INT(rval));
	  _CASE(iqn, _OPT_STR(rval));
	  _CASE(sockbufsize, _OPT_INT(rval));

	  _CASE(maxConnections, _OPT_INT(rval));
	  _CASE(maxRecvDataSegmentLength, _OPT_INT(rval));
	  _CASE(maxXmitDataSegmentLength, _OPT_INT(rval));
	  _CASE(maxBurstLength, _OPT_INT(rval));
	  _CASE(firstBurstLength, _OPT_INT(rval));
	  _CASE(defaultTime2Wait, _OPT_INT(rval));
	  _CASE(defaultTime2Retain, _OPT_INT(rval));
	  _CASE(maxOutstandingR2T, _OPT_INT(rval));
	  _CASE(errorRecoveryLevel, _OPT_INT(rval));
	  _CASE(targetPortalGroupTag, _OPT_INT(rval));
	  _CASE(headerDigest, _OPT_STR(rval));
	  _CASE(dataDigest, _OPT_STR(rval));

	  _CASE(targetAddress, _OPT_STR(rval));
	  _CASE(targetAlias, _OPT_STR(rval));
	  _CASE(targetName, _OPT_STR(rval));
	  _CASE(initiatorName, _OPT_STR(rval));
	  _CASE(initiatorAlias, _OPT_STR(rval));
	  _CASE(authMethod, _OPT_STR(rval));
	  _CASE(chapSecret, _OPT_STR(rval));
	  _CASE(chapIName, _OPT_STR(rval));
	  _CASE(chapDigest, _OPT_STR(rval));

	  _CASE(tgtChapName, _OPT_STR(rval));
	  _CASE(tgtChapSecret, _OPT_STR(rval));

	  _CASE(initialR2T, _OPT_BOOL(rval));
	  _CASE(immediateData, _OPT_BOOL(rval));
	  _CASE(dataPDUInOrder, _OPT_BOOL(rval));
	  _CASE(dataSequenceInOrder, _OPT_BOOL(rval));
     }
}