本文整理汇总了C++中LE_ERROR函数的典型用法代码示例。如果您正苦于以下问题:C++ LE_ERROR函数的具体用法?C++ LE_ERROR怎么用?C++ LE_ERROR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LE_ERROR函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pthread_getspecific
//--------------------------------------------------------------------------------------------------
void StopClient
(
void
)
{
_ClientThreadData_t* clientThreadPtr = pthread_getspecific(_ThreadDataKey);
// If the thread specific data is NULL, then there is no current client session.
if (clientThreadPtr == NULL)
{
LE_ERROR("Trying to stop non-existent client session for '%s' service",
GlobalServiceInstanceName);
}
else
{
le_msg_CloseSession( clientThreadPtr->sessionRef );
// Need to delete the thread specific data, since it is no longer valid. If a new
// client session is started, new thread specific data will be allocated.
le_mem_Release(clientThreadPtr);
if (pthread_setspecific(_ThreadDataKey, NULL) != 0)
{
LE_FATAL("pthread_setspecific() failed!");
}
LE_DEBUG("======= Stopping Client %s ========", GlobalServiceInstanceName);
}
}
示例2: le_msg_GetPayloadPtr
// This function parses the message buffer received from the server, and then calls the user
// registered handler, which is stored in a client data object.
static void _Handle_AddBugTest
(
void* _reportPtr,
void* _notUsed
)
{
le_msg_MessageRef_t _msgRef = _reportPtr;
_Message_t* _msgPtr = le_msg_GetPayloadPtr(_msgRef);
uint8_t* _msgBufPtr = _msgPtr->buffer;
// The clientContextPtr always exists and is always first.
void* _clientContextPtr;
_msgBufPtr = UnpackData( _msgBufPtr, &_clientContextPtr, sizeof(void*) );
// Pull out additional data from the context pointer
_ClientData_t* _clientDataPtr = _clientContextPtr;
BugTestFunc_t _handlerRef_AddBugTest = (BugTestFunc_t)_clientDataPtr->handlerPtr;
void* contextPtr = _clientDataPtr->contextPtr;
// Unpack the remaining parameters
// Call the registered handler
if ( _handlerRef_AddBugTest != NULL )
{
_handlerRef_AddBugTest( contextPtr );
}
else
{
LE_ERROR("ERROR in client _Handle_AddBugTest: no registered handler");
}
// Release the message, now that we are finished with it.
le_msg_ReleaseMsg(_msgRef);
}
示例3: LE_DEBUG
//--------------------------------------------------------------------------------------------------
le_result_t pa_audio_SetGain
(
pa_audio_If_t interface, ///< [IN] audio interface
uint32_t gain ///< [IN] gain value [0..100] (0 means 'muted', 100 is the
/// maximum gain value)
)
{
LE_DEBUG("Set gain for [%d] to %d",interface,gain);
if ((gain < 0) || (gain > 100))
{
return LE_OUT_OF_RANGE;
}
switch (interface)
{
case PA_AUDIO_IF_CODEC_MIC:
{
if (gain > 66)
{
SetMixerParameter("ADC1 Volume","3");
}
else if (gain > 33)
{
SetMixerParameter("ADC1 Volume","2");
}
else if (gain > 0)
{
SetMixerParameter("ADC1 Volume","1");
}
else
{
SetMixerParameter("ADC1 Volume","0");
}
return LE_OK;
}
case PA_AUDIO_IF_CODEC_SPEAKER:
{
char gainPtr[10];
sprintf(gainPtr,"%d",(124*gain)/100);
SetMixerParameter("RX1 Digital Volume", gainPtr);
return LE_OK;
}
case PA_AUDIO_IF_DSP_FRONTEND_USB_RX:
case PA_AUDIO_IF_DSP_FRONTEND_USB_TX:
case PA_AUDIO_IF_DSP_BACKEND_MODEM_VOICE_RX:
case PA_AUDIO_IF_DSP_BACKEND_MODEM_VOICE_TX:
case PA_AUDIO_IF_DSP_FRONTEND_PCM_RX:
case PA_AUDIO_IF_DSP_FRONTEND_PCM_TX:
case PA_AUDIO_IF_FILE_PLAYING:
case PA_AUDIO_IF_DSP_FRONTEND_I2S_RX:
case PA_AUDIO_IF_DSP_FRONTEND_I2S_TX:
case PA_AUDIO_IF_END:
{
break;
}
}
LE_ERROR("This interface (%d) is not supported",interface);
return LE_FAULT;
}
示例4: LE_INFO
//--------------------------------------------------------------------------------------------------
static void SigHandler
(
int sigNum
)
{
le_result_t res;
bool statusPassed = true;
LE_INFO("Deactivated SMS CB");
if (GsmTest)
{
res = le_sms_DeactivateCellBroadcast();
if (res != LE_OK)
{
LE_ERROR("le_sms_DeactivateCellBroadcast FAILED");
statusPassed = false;
}
else
{
LE_INFO("le_sms_DeactivateCellBroadcast PASSED");
}
}
if (CdmaTest)
{
res = le_sms_DeactivateCdmaCellBroadcast();
if (res != LE_OK)
{
LE_ERROR("le_sms_DeactivateCdmaCellBroadcast FAILED");
statusPassed = false;
}
else
{
LE_INFO("le_sms_DeactivateCdmaCellBroadcast PASSED");
}
}
if (statusPassed)
{
exit(EXIT_SUCCESS);
}
else
{
exit(EXIT_FAILURE);
}
}
示例5: LE_ERROR
//--------------------------------------------------------------------------------------------------
static void ConnectAudioToFileRec
(
void
)
{
le_result_t res;
if ((AudioFileFd=open(AudioFileRecPath, O_RDWR | O_CREAT | O_TRUNC)) == -1)
{
LE_ERROR("Open file %s failure: errno.%d (%s)", AudioFileRecPath, errno, strerror(errno));
}
else
{
LE_INFO("Open file %s with AudioFileFd.%d", AudioFileRecPath, AudioFileFd);
}
// Capture Remote on output connector.
FileAudioRef = le_audio_OpenRecorder();
LE_ERROR_IF((FileAudioRef==NULL), "OpenFileRecording returns NULL!");
if (FileAudioRef && AudioOutputConnectorRef)
{
res = le_audio_Connect(AudioOutputConnectorRef, FileAudioRef);
if(res!=LE_OK)
{
LE_ERROR("Failed to connect FileRecording on output connector!");
return;
}
res = le_audio_Connect(AudioInputConnectorRef, FileAudioRef);
if(res!=LE_OK)
{
LE_ERROR("Failed to connect FileRecording on input connector!");
return;
}
LE_INFO("Recorder is now connected.");
res = le_audio_RecordFile(FileAudioRef, AudioFileFd);
if(res!=LE_OK)
{
LE_ERROR("Failed to record the file");
}
else
{
LE_INFO("File is now recording.");
}
}
}
示例6: OpenCgrpFile
//--------------------------------------------------------------------------------------------------
static le_result_t GetValue
(
cgrp_SubSys_t subsystem, ///< [IN] Sub-system of the cgroup.
const char* cgroupNamePtr, ///< [IN] Name of the cgroup.
const char* fileNamePtr, ///< [IN] File name to read from.
char* bufPtr, ///< [OUT] Buffer to store the value in.
size_t bufSize ///< [IN] Size of the buffer.
)
{
// Open the file.
int fd = OpenCgrpFile(subsystem, cgroupNamePtr, fileNamePtr, O_RDONLY);
if (fd < 0)
{
return LE_FAULT;
}
// Read the value from the file.
ssize_t numBytesRead;
do
{
numBytesRead = read(fd, bufPtr, bufSize);
}
while ( (numBytesRead == -1) && (errno == EINTR) );
// Check if the read value is valid.
le_result_t result;
if (numBytesRead == -1)
{
LE_ERROR("Could not read file '%s' in cgroup '%s'. %m.", fileNamePtr, cgroupNamePtr);
result = LE_FAULT;
}
else if (numBytesRead == bufSize)
{
// The value in the file is larger than the provided buffer. Truncate the buffer.
bufPtr[bufSize-1] = '\0';
result = LE_OVERFLOW;
}
else
{
// Null-terminate the string.
bufPtr[numBytesRead] = '\0';
// Remove trailing newline characters.
while ((numBytesRead > 0) && (bufPtr[numBytesRead - 1] == '\n'))
{
numBytesRead--;
bufPtr[numBytesRead] = '\0';
}
result = LE_OK;
}
fd_Close(fd);
return result;
}
示例7: LE_ERROR
//--------------------------------------------------------------------------------------------------
le_result_t pa_mdc_GetDefaultProfileIndex
(
uint32_t* profileIndexPtr
)
{
LE_ERROR("Unsupported function called");
return LE_FAULT;
}
示例8: switch
//--------------------------------------------------------------------------------------------------
le_result_t le_gnss_Disable
(
void
)
{
le_result_t result = LE_FAULT;
// Check the GNSS device state
switch (GnssState)
{
case LE_GNSS_STATE_READY:
{
// Disable GNSS device
result = pa_gnss_Disable();
// Update GNSS device state
if(result == LE_OK)
{
GnssState = LE_GNSS_STATE_DISABLED;
}
}
break;
case LE_GNSS_STATE_UNINITIALIZED:
case LE_GNSS_STATE_ACTIVE:
{
LE_ERROR("Bad state for that request [%d]", GnssState);
result = LE_NOT_PERMITTED;
}
break;
case LE_GNSS_STATE_DISABLED:
{
LE_ERROR("Bad state for that request [%d]", GnssState);
result = LE_DUPLICATE;
}
break;
default:
{
LE_ERROR("Unknown GNSS state %d", GnssState);
result = LE_FAULT;
}
break;
}
return result;
}
示例9: LE_ERROR
//--------------------------------------------------------------------------------------------------
le_result_t pa_audio_SetPcmCompanding
(
le_audio_Companding_t companding ///< [IN] Companding.
)
{
LE_ERROR("Unsupported function called");
return LE_FAULT;
}
示例10: LE_ERROR
//--------------------------------------------------------------------------------------------------
le_result_t pa_temp_ResetHandle
(
const char* sensorPtr ///< [IN] Name of the temperature sensor.
)
{
LE_ERROR("Unsupported function called");
return LE_UNSUPPORTED;
}
示例11: LE_ERROR
//--------------------------------------------------------------------------------------------------
void le_avdata_Delete
(
le_avdata_AssetInstanceRef_t instRef
///< [IN]
)
{
LE_ERROR("Not implemented yet");
}
示例12: LE_ERROR
//--------------------------------------------------------------------------------------------------
static void CleanUp
(
void *contextPtr
)
{
ServerData_t *serverDataPtr = (ServerData_t *)contextPtr;
if (close(serverDataPtr->connFd) == -1)
{
LE_ERROR("close failed %s", strerror(errno));
}
if (close(serverDataPtr->socketFd) == -1)
{
LE_ERROR("close failed %s", strerror(errno));
}
}
示例13: le_cfg_CreateReadTxn
//--------------------------------------------------------------------------------------------------
static le_result_t GetEnvironmentVariables
(
proc_Ref_t procRef, ///< [IN] The process to get the environment variables for.
EnvVar_t envVars[], ///< [IN] The list of environment variables.
size_t maxNumEnvVars ///< [IN] The maximum number of items envVars can hold.
)
{
le_cfg_IteratorRef_t procCfg = le_cfg_CreateReadTxn(procRef->cfgPathRoot);
le_cfg_GoToNode(procCfg, CFG_NODE_ENV_VARS);
if (le_cfg_GoToFirstChild(procCfg) != LE_OK)
{
LE_WARN("No environment variables for process '%s'.", procRef->name);
le_cfg_CancelTxn(procCfg);
return LE_NOT_FOUND;
}
int i;
for (i = 0; i < maxNumEnvVars; i++)
{
if ( (le_cfg_GetNodeName(procCfg, "", envVars[i].name, LIMIT_MAX_ENV_VAR_NAME_BYTES) != LE_OK) ||
(le_cfg_GetString(procCfg, "", envVars[i].value, LIMIT_MAX_PATH_BYTES, "") != LE_OK) )
{
LE_ERROR("Error reading environment variables for process '%s'.", procRef->name);
le_cfg_CancelTxn(procCfg);
return LE_FAULT;
}
if (le_cfg_GoToNextSibling(procCfg) != LE_OK)
{
break;
}
else if (i >= maxNumEnvVars-1)
{
LE_ERROR("There were too many environment variables for process '%s'.", procRef->name);
le_cfg_CancelTxn(procCfg);
return LE_FAULT;
}
}
le_cfg_CancelTxn(procCfg);
return i + 1;
}
示例14: resolution
//--------------------------------------------------------------------------------------------------
le_result_t pa_audio_SetPcmSamplingResolution
(
uint32_t bitsPerSample ///< [IN] Sampling resolution (bits/sample).
)
{
LE_ERROR("Unsupported function called");
return LE_FAULT;
}