本文整理汇总了C++中NATIVE_PROFILE_PAL_COM函数的典型用法代码示例。如果您正苦于以下问题:C++ NATIVE_PROFILE_PAL_COM函数的具体用法?C++ NATIVE_PROFILE_PAL_COM怎么用?C++ NATIVE_PROFILE_PAL_COM使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NATIVE_PROFILE_PAL_COM函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SSL_ParseCertificate
BOOL SSL_ParseCertificate( const char* certificate, size_t certLength, const char* szPwd, X509CertData* certData )
{
if (!s_init_done) s_init_done=ssl_initialize_internal();
NATIVE_PROFILE_PAL_COM();
return ssl_parse_certificate_internal((void *)certificate,
TINYCLR_SSL_STRLEN(certificate),
NULL, (void*)certData);
}
示例2: SSL_Initialize
BOOL SSL_Initialize()
{
NATIVE_PROFILE_PAL_COM();
memset(&g_SSL_Driver, 0, sizeof(g_SSL_Driver));
return TRUE;
}
示例3: NATIVE_PROFILE_PAL_COM
void Sockets_NetduinoIP_Driver::ApplyConfigExtended()
{
NATIVE_PROFILE_PAL_COM();
if(!HAL_CONFIG_BLOCK::ApplyConfig( g_NetworkConfigExtended.GetDriverName(), &g_NetworkConfigExtended, sizeof(g_NetworkConfigExtended) ))
{
// save to the dynamic config section so that MFDeploy will be able to get the configuration.
SaveConfigExtended(0, NULL);
}
}
示例4: NATIVE_PROFILE_PAL_COM
BOOL USART_Driver::Initialize( int ComPortNum, int BaudRate, int Parity, int DataBits, int StopBits, int FlowValue )
{
NATIVE_PROFILE_PAL_COM();
if((ComPortNum < 0) || (ComPortNum >= TOTAL_USART_PORT))
{
//DEBUG_TRACE1(TRACE_ALWAYS, "ERROR: VTE_USART_Initialize: invalid ComPortNum %u\r\n", ComPortNum);
return FALSE;
}
{
GLOBAL_LOCK(irq);
HAL_USART_STATE& State = Hal_Usart_State[ComPortNum];
if(!IS_USART_INITIALIZED(State))
{
State.fDataEventSet = FALSE;
State.PortIndex = ComPortNum;
// DO NOT INITIALIZE EVENT CALLBACKS HERE BECAUSE THEY CAN BE SET PRIOR TO INITIALIZE
State.Flag = 0; //clear all the flag bits
SET_USART_FLAG(State, HAL_USART_STATE::c_INITIALIZED | HAL_USART_STATE::c_TX_XON_STATE);
// If SW flow control on input is enabled
if (FlowValue & USART_FLOW_SW_IN_EN)
{
SET_USART_FLAG(State, HAL_USART_STATE::c_RX_SWFLOW_CTRL);
}
// If SW flow control on output is enabled
if (FlowValue & USART_FLOW_SW_OUT_EN)
{
SET_USART_FLAG(State, HAL_USART_STATE::c_TX_SWFLOW_CTRL);
}
// If HW flow control on input is enabled (HW output control is either totally in hardware or in HAL only)
if (FlowValue & USART_FLOW_HW_IN_EN)
{
SET_USART_FLAG(State, HAL_USART_STATE::c_RX_HWFLOW_CTRL);
}
State.RxBufferHighWaterMark = USART_BUFFER_HIGH_WATER_MARK( RX_USART_BUFFER_SIZE );
State.RxBufferLowWaterMark = USART_BUFFER_LOW_WATER_MARK ( RX_USART_BUFFER_SIZE );
State.TicksStartTxXOFF = 0;
State.TxQueue.Initialize( &TxBuffer_Com[ComPortNum * TX_USART_BUFFER_SIZE], TX_USART_BUFFER_SIZE);
State.RxQueue.Initialize( &RxBuffer_Com[ComPortNum * RX_USART_BUFFER_SIZE], RX_USART_BUFFER_SIZE );
return CPU_USART_Initialize( ComPortNum, BaudRate, Parity, DataBits, StopBits, FlowValue );
}
return TRUE;
}
}
示例5: NATIVE_PROFILE_PAL_COM
void I2C_HAL_XACTION::Initialize( I2C_USER_CONFIGURATION& config, I2C_HAL_XACTION_UNIT** xActionUnits, size_t numXActionUnits )
{
NATIVE_PROFILE_PAL_COM();
m_xActionUnits = xActionUnits;
m_numXActionUnits = numXActionUnits;
m_current = 0;
m_clockRate = I2C_Internal_GetClockRate( config.ClockRate );
m_address = config.Address;
m_status = c_Status_Idle;
}
示例6: SSL_Uninitialize
BOOL SSL_Uninitialize()
{
NATIVE_PROFILE_PAL_COM();
BOOL retVal;
retVal = ssl_uninitialize_internal();
s_init_done = FALSE;
return retVal;
}
示例7: SSL_ClearCertificateAuthority
void SSL_ClearCertificateAuthority( int sslContextHandle )
{
NATIVE_PROFILE_PAL_COM();
if((sslContextHandle >= ARRAYSIZE(g_SSL_Driver.m_sslContextArray)) || (sslContextHandle < 0))
{
return;
}
memset(&g_SSL_Driver.m_sslContextArray[sslContextHandle].m_certificates[0], 0, sizeof(g_SSL_Driver.m_sslContextArray[sslContextHandle].m_certificates));
g_SSL_Driver.m_sslContextArray[sslContextHandle].m_certificateCount = 0;
}
示例8: SSL_ParseCertificate
BOOL SSL_ParseCertificate( const char* certificate, size_t certLength, const char* szPwd, X509CertData* certData )
{
NATIVE_PROFILE_PAL_COM();
RTCertificate rt_cert;
int ret;
rt_cert.cert = (X509Certificate)certificate;
rt_cert.size = certLength;
ret = secure_parse_certificate( (const RTCertificate *)&rt_cert, (RTCertData*)certData );
return (-1 != ret);
}
示例9: DebuggerPort_Flush
BOOL DebuggerPort_Flush( COM_HANDLE ComPortNum )
{
NATIVE_PROFILE_PAL_COM();
switch(ExtractTransport(ComPortNum))
{
case USART_TRANSPORT:
return USART_Flush( ConvertCOM_ComPort( ComPortNum ) );
case USB_TRANSPORT:
return USB_Flush( ConvertCOM_UsbStream(ComPortNum) );
case SOCKET_TRANSPORT:
return SOCKETS_Flush( ConvertCOM_SockPort(ComPortNum) );
}
return FALSE;
}
示例10: CPU_ProtectCommunicationGPIOs
void CPU_ProtectCommunicationGPIOs( BOOL On )
{
NATIVE_PROFILE_PAL_COM();
switch(ExtractTransport(HalSystemConfig.DebugTextPort))
{
case USART_TRANSPORT:
CPU_USART_ProtectPins( ConvertCOM_ComPort(HalSystemConfig.DebugTextPort), On );
return ;
case USB_TRANSPORT:
CPU_USB_ProtectPins ( ConvertCOM_UsbController(HalSystemConfig.DebugTextPort), On );
return;
default:
return;
}
}
示例11: DebuggerPort_Uninitialize
BOOL DebuggerPort_Uninitialize( COM_HANDLE ComPortNum )
{
NATIVE_PROFILE_PAL_COM();
switch(ExtractTransport(ComPortNum))
{
case USART_TRANSPORT:
return USART_Uninitialize( ConvertCOM_ComPort(ComPortNum) );
case USB_TRANSPORT:
USB_CloseStream( ConvertCOM_UsbStream(ComPortNum) );
return USB_Uninitialize( ConvertCOM_UsbController(ComPortNum) );
case SOCKET_TRANSPORT:
return SOCKETS_Uninitialize(ConvertCOM_SockPort(ComPortNum));
}
return FALSE;
}
示例12: DebuggerPort_Write
int DebuggerPort_Write( COM_HANDLE ComPortNum, const char* Data, size_t size )
{
NATIVE_PROFILE_PAL_COM();
UINT32 transport = ExtractTransport(ComPortNum);
const char* dataTmp = Data;
INT32 totWrite = 0;
int retries = 100;
while(size > 0 && retries--)
{
int ret = 0;
switch(transport)
{
case USART_TRANSPORT:
ret = USART_Write( ConvertCOM_ComPort( ComPortNum ), dataTmp, size );
break;
case USB_TRANSPORT:
ret = USB_Write( ConvertCOM_UsbStream( ComPortNum ), dataTmp, size );
break;
case SOCKET_TRANSPORT:
ret = SOCKETS_Write( ConvertCOM_SockPort(ComPortNum), dataTmp, size );
break;
}
if(ret < 0)
{
break;
}
else if(ret == 0)
{
// if interrupts are off and our buffer is full then there is nothing we can do
if(!INTERRUPTS_ENABLED_STATE()) break;
Events_WaitForEvents(0, 1);
}
else
{
retries = 50; // reset retries
size -= ret;
dataTmp += ret;
totWrite += ret;
}
}
return totWrite;
}
示例13: DebuggerPort_Initialize
BOOL DebuggerPort_Initialize( COM_HANDLE ComPortNum )
{
NATIVE_PROFILE_PAL_COM();
switch(ExtractTransport(ComPortNum))
{
case USART_TRANSPORT:
return USART_Initialize( ConvertCOM_ComPort(ComPortNum), HalSystemConfig.USART_DefaultBaudRate, USART_PARITY_NONE, 8, USART_STOP_BITS_ONE, USART_FLOW_NONE );
case USB_TRANSPORT:
if(USB_CONFIG_ERR_OK != USB_Configure( ConvertCOM_UsbController(ComPortNum), NULL )) return FALSE;
if(!USB_Initialize( ConvertCOM_UsbController(ComPortNum) )) return FALSE;
return USB_OpenStream( ConvertCOM_UsbStream(ComPortNum), USB_DEBUG_EP_WRITE, USB_DEBUG_EP_READ );
case SOCKET_TRANSPORT:
return SOCKETS_Initialize(ConvertCOM_SockPort(ComPortNum));
}
return FALSE;
}
示例14: SSL_ExitContext
BOOL SSL_ExitContext( INT32 sslContextHandle )
{
NATIVE_PROFILE_PAL_COM();
BOOL ret;
if((sslContextHandle >= ARRAYSIZE(g_SSL_Driver.m_sslContextArray)) || (sslContextHandle < 0) || (g_SSL_Driver.m_sslContextArray[sslContextHandle].SslContext == NULL))
{
return FALSE;
}
ret = (0 == secure_sslexit(g_SSL_Driver.m_sslContextArray[sslContextHandle].SslContext));
memset(&g_SSL_Driver.m_sslContextArray[sslContextHandle], 0, sizeof(g_SSL_Driver.m_sslContextArray[sslContextHandle]));
g_SSL_Driver.m_sslContextCount --;
return ret;
}
示例15: SSL_Uninitialize
BOOL SSL_Uninitialize()
{
NATIVE_PROFILE_PAL_COM();
BOOL result = TRUE;
for(int i = 0; i<ARRAYSIZE(g_SSL_Driver.m_sslContextArray); i++)
{
if(g_SSL_Driver.m_sslContextArray[i].SslContext != NULL)
{
SSL_ExitContext( i );
}
}
secure_exit();
g_SSL_Driver.m_sslContextCount = 0;
return result;
}