当前位置: 首页>>代码示例>>C++>>正文


C++ PRTMSG函数代码示例

本文整理汇总了C++中PRTMSG函数的典型用法代码示例。如果您正苦于以下问题:C++ PRTMSG函数的具体用法?C++ PRTMSG怎么用?C++ PRTMSG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PRTMSG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PRTMSG

bool CGpsSrc::_ReleaseGpsSrc()
{
	m_bGpsInit = false;
	if( false == _KillSirfReq() )
	{
		PRTMSG(MSG_NOR, "关闭SifvNav进程失败\n");
		g_bProgExit = true;
		return false;
	}
	else
	{
		PRTMSG(MSG_NOR, "关闭SifvNav进程成功\n");
	}

	sleep(1);

	if(-1 != m_iSemid)
	{
		semctl(m_iSemid,0,IPC_RMID);
		m_iSemid = -1;
	}

	if(-1 != m_iShmid)
	{
		//que 是否需要做失败的判断?
		shmctl(m_iShmid, IPC_RMID, NULL);
		m_iShmid = -1;
	}
	m_pShm = NULL;

	return true;
}
开发者ID:awzhang,项目名称:MyWork,代码行数:32,代码来源:GpsSrc.cpp

示例2: PRTMSG

void CLN_Login::LoginAnswer(char *v_szBuf, DWORD v_dwLen)
{
	if( v_dwLen != 1 )
	{
		PRTMSG(MSG_ERR, "LoginAnswer len err, v_dwLen = %d\n", v_dwLen);
		return;
	}
	
	switch( v_szBuf[0] )
	{
	case 0x01:		// 登陆成功
		{
			PRTMSG(MSG_NOR, "Login succ!\n");
			g_objLNDownLoad.m_bNetFined = true;
			m_dwLoginTimers = 0;
			m_dwLoginSucc = 1;
			
			_KillTimer(&g_objTimerMng, LOGIN_TIMER);
			
			// 发送心跳维护帧
			HeartKeep();
		}
		break;
		
	case 0x00:		// 登陆失败,继续登陆
		{
			PRTMSG(MSG_NOR, "Login failed, continue Login!\n");
		}
		break;
		
	default:
		break;
	}
}
开发者ID:awzhang,项目名称:MyWork,代码行数:34,代码来源:LN_Login.cpp

示例3: PRTMSG

int CIO::IOCfgGet( unsigned char v_ucIOSymb, void *v_pIOCfg, DWORD v_dwCfgSize )
{
/*	_Init();*/

	if( v_ucIOSymb >= sizeof(SYSIO_CFG) / sizeof(SYSIO_CFG[0]) )
	{
		PRTMSG( MSG_ERR, "IOCfgGet %d: IOSymb Over Max Number\n", int(v_ucIOSymb) );
		return ERR_PAR;
	}

	if( v_pIOCfg && v_dwCfgSize >= sizeof(tagIOCfg) )
	{
		memcpy( v_pIOCfg, &SYSIO_CFG[v_ucIOSymb], sizeof(tagIOCfg) );
		PRTMSG( MSG_DBG, "IOCfgGet OK, No.%3d,Pin-%3d,prd-%4d,io-%d,brken-%d,brktyp-%d,brklvl-%d,low-%3d,hig-%3d\n", v_ucIOSymb,
			SYSIO_CFG[v_ucIOSymb].m_uiPinNo, SYSIO_CFG[v_ucIOSymb].m_uiContPrid, SYSIO_CFG[v_ucIOSymb].m_ucInOut,
			SYSIO_CFG[v_ucIOSymb].m_bBreak, SYSIO_CFG[v_ucIOSymb].m_cBreakType, SYSIO_CFG[v_ucIOSymb].m_cBreakPow,
			SYSIO_CFG[v_ucIOSymb].m_ucPinLowApp, SYSIO_CFG[v_ucIOSymb].m_ucPinHigApp );
		return 0;
	}
	else
	{
		PRTMSG( MSG_ERR, "IOCfgGet %d: output size(%d) lack!\n", int(v_ucIOSymb), int(v_dwCfgSize) );
		return ERR_PTR;
	}
}
开发者ID:awzhang,项目名称:MyWork,代码行数:25,代码来源:IO.cpp

示例4: memset

//设置RTC时间,使用GPS时间校对RTC(格林威治时间格式)
bool CGpsSrc::_SetTimeToRtc(struct tm* v_SetTime)
{
	struct rtc_time objRtcTime;

	memset(&objRtcTime, 0, sizeof(objRtcTime));

	int iDevRtc = open("/dev/misc/rtc", O_NONBLOCK);

	if(-1 == iDevRtc)
	{
		PRTMSG(MSG_ERR,"open rtc dev err\n");
		return false;
	}
		
	objRtcTime.tm_sec = v_SetTime->tm_sec;
	objRtcTime.tm_min = v_SetTime->tm_min;
	objRtcTime.tm_hour = v_SetTime->tm_hour;
	objRtcTime.tm_mday = v_SetTime->tm_mday;
	objRtcTime.tm_mon =	v_SetTime->tm_mon;
	objRtcTime.tm_year = v_SetTime->tm_year+1900;

	if(0 != ioctl(iDevRtc, RTC_SET_TIME, &objRtcTime))
	{
		close(iDevRtc);
		iDevRtc = -1;
		return false;
	}

	PRTMSG(MSG_DBG,"set gps time to rtc\n");

	close(iDevRtc);
	iDevRtc = -1;

	return true;
}
开发者ID:awzhang,项目名称:MyWork,代码行数:36,代码来源:GpsSrc.cpp

示例5: ftok

//共享内存
int CGpsSrc::_ShmInit()
{
	int iShmid = -1;
	int i;
	key_t shmKey;
	int flag1, flag2;

	shmKey = ftok(KEYPATH,0);

	if (shmKey == -1)
	{
		PRTMSG(MSG_ERR,"failed to get a key from ftok(name, 0)\n");
		perror(" ");
		return -1;
	}
	for(i = 0; i<5; i++)
	{
		iShmid = shmget(shmKey,SHM_SIZE,0666 );
		if(-1 == iShmid)
		{
			PRTMSG(MSG_ERR,"shmget failed times: %d\n",i+1);
			sleep(1);
			continue;
		}
		else
		{
			return iShmid;
		}
	}

	PRTMSG(MSG_ERR,"gps shmget error\n");
	perror(" ");

	return -1;
}
开发者ID:awzhang,项目名称:MyWork,代码行数:36,代码来源:GpsSrc.cpp

示例6: main

int main()
{
	//unsigned char ucIOSta = 0;
	int iVal = 0;
	tag2QServCodeCfg cfg;
	//tag1LComuCfg cfg2;
	int iCode = 1111111111;
	int iRet = 0;
	char buf[100] = { 0 };
	while(1)
	{
		memset( buf, 0, sizeof(buf) );
		sprintf( buf, "%d", iCode ++ );
		
		memcpy( cfg.m_szTaxHandtel, buf, sizeof(cfg.m_szTaxHandtel) );
		iRet = SetSecCfg( &cfg, offsetof(tagSecondCfg, m_uni2QServCodeCfg.m_obj2QServCodeCfg), sizeof(cfg) );
		PRTMSG( MSG_NOR, "Set seccfg: %s, result: %d\n", buf, iRet );

// 		memcpy( cfg2.m_szVeIDKey, buf, sizeof(cfg2.m_szVeIDKey) );
// 		iRet = SetImpCfg( &cfg2, offsetof(tagImportantCfg, m_uni1LComuCfg.m_obj1LComuCfg), sizeof(cfg2) );
// 		//iRet = SetImpCfg( buf, 200, sizeof(buf) );
// 		PRTMSG( MSG_NOR, "Set impcfg: %s, result: %d\n", buf, iRet );
		

		iVal ++;
		if( 20 == iVal ) break;

		usleep( 1000000 );
	}

	PRTMSG( MSG_NOR, "exit!\n" );
	exit( 0 );
}
开发者ID:awzhang,项目名称:MyWork,代码行数:33,代码来源:UseComuServ_CfgSet.cpp

示例7: PRTMSG

int COil::Init()
{
	// 打开串口
	if( !ComOpen() )
	{
		PRTMSG(MSG_ERR, "Open Com failed!\n");
		return ERR_COM;
	}

	pthread_mutex_init(&m_MutexAD, NULL);

	// 创建线程
	pthread_t pThreadRecv, pThreadSend;
	if( pthread_create(&pThreadRecv, NULL, G_ThreadOilRecv, NULL) != 0
		||
		pthread_create(&pThreadSend, NULL, G_ThreadOilSend, NULL) != 0
		)
	{
		PRTMSG(MSG_ERR, "Create thread failed!\n");
		perror("");
		return ERR_THREAD;
	}

	return 0;
}
开发者ID:awzhang,项目名称:MyWork,代码行数:25,代码来源:yx_Oil.cpp

示例8: JBDemo_StartAudio

int JBDemo_StartAudio( void )
{
	int result;

	/* Initialize audio hardware and open an output stream. */
	Pa_Initialize();
	result = Pa_OpenDefaultStream( &audioStream,
	                               0, SAMPLES_PER_FRAME,
	                               paInt16,
	                               (double) SAMPLE_RATE,
	                               JukeBox_GetFramesPerTick(),
	                               0,
	                               JBDemo_Callback,
	                               NULL );
	if( result < 0 )
	{
		PRTMSG( "Pa_OpenDefaultStream returns " );
		PRTMSG( Pa_GetErrorText( result ) );
		PRTMSG( "\n" );

		goto error;
	}

	Pa_StartStream( audioStream );

error:
	return result;
}
开发者ID:gromgit,项目名称:hmsl,代码行数:28,代码来源:hmsl_midi_me2000.c

示例9: main

int main()
{
	unsigned char ucIOSta = 0;
	int iVal = 0;
	int iResult = 0;
	tag2QServCodeCfg cfg;
	tag1LComuCfg cfg2;
	char buf[100] = { 0 };
	//PRTMSG( MSG_NOR, "Run!\n" );
	while(1)
	{
		//PRTMSG( MSG_DBG, "Loop!\n" );

		memset( buf, 0, sizeof(buf) );

		//iResult = GetSecCfg( &cfg, sizeof(cfg), offsetof(tagSecondCfg, m_uni2QServCodeCfg.m_obj2QServCodeCfg), sizeof(cfg) );
		//memcpy( buf, cfg.m_szTaxHandtel, sizeof(cfg.m_szTaxHandtel) );
		
		iResult = GetImpCfg( &cfg2, sizeof(cfg2), offsetof(tagImportantCfg, m_uni1LComuCfg.m_obj1LComuCfg), sizeof(cfg2) );
		memcpy( buf, cfg2.m_szVeIDKey, sizeof(cfg2.m_szVeIDKey) );

		//iResult = GetImpCfg( buf, sizeof(buf), 200, sizeof(buf) );

		PRTMSG( MSG_NOR, "Get seccfg: %s, result: %d\n", buf, iResult );

		iVal ++;
		if( 50 == iVal ) break;

		usleep( 1000000 );
	}

	PRTMSG( MSG_NOR, "exit!\n" );
	exit( 0 );
}
开发者ID:awzhang,项目名称:MyWork,代码行数:34,代码来源:UseComuServ_CfgGet_2.cpp

示例10: PRTMSG

int CKTIrdMod::Init()
{
	// 打开红外口
	if( !ComOpen() )
	{
		PRTMSG(MSG_ERR, "Open Ird failed\n");
		return ERR_COM;
	}
	
	// 创建接收线程
	if( pthread_create(&m_pthreadRecv, NULL, G_ThreadIrdModKaiTianRecv, NULL) != 0 )
	{
		Release();
		PRTMSG(MSG_ERR, "Create Recv Thread failed\n");
		return ERR_THREAD;
	}

#if USE_IRD_KAITIAN == 1
	if( pthread_create(&m_pthreadWork, NULL, G_ThreadIrdModKaiTianWork, NULL) != 0 )
	{
		Release();
		PRTMSG(MSG_ERR, "Create Work Thread failed\n");
		return ERR_THREAD;
	}
#endif

	return 0;
}
开发者ID:awzhang,项目名称:MyWork,代码行数:28,代码来源:yx_IrdModKaiTian.cpp

示例11: ExeUpdate

bool ExeUpdate()
{
	if( WaitForEvent(MOUNT, &g_objUsbSta.UDisk[0], 15000)==0 )
	{
		char const szUpdateFile[32] = "exe.bin";
		char diskPathUpfile[128] = {0};	//升级路径+升级文件
		
		sprintf(diskPathUpfile, "/mnt/%s/%s", UDISK_UP_PATH, szUpdateFile);
	
		// 将升级文件exe.bin复制到part3的下载目录下,以作为升级备份
		if( AppIntact(diskPathUpfile) == false || 0 != system("cp -f /mnt/UDisk/part1/exe.bin /mnt/Flash/part3/Down/exe.bin") )
		{
			PRTMSG(MSG_DBG, "cp exe.bin to part3 fail!\n");
			return false;
		}
		
#if VEHICLE_TYPE == VEHICLE_M
		if( G_ExeUpdate(diskPathUpfile, 1) == true )
#endif
#if VEHICLE_TYPE == VEHICLE_V8 || VEHICLE_TYPE == VEHICLE_M2
		if( G_ExeUpdate(diskPathUpfile, 0) == true )
#endif
		{
			PRTMSG(MSG_DBG, "soft update succ\n");
			
			DelErrLog();	// 升级成功后程序从分区5启动
		
			return true;
		}
	}
	
	return false;
}
开发者ID:awzhang,项目名称:MyWork,代码行数:33,代码来源:yx_config.cpp

示例12: XUN_ASSERT_VALID

int CSock::DealSmsFrame( char* v_szBuf, int v_iBufLen, char* v_szVeTel, size_t v_sizTel)
{
    // 检查数据长度
    if( v_iBufLen < QIANDOWNFRAME_BASELEN )
    {
        XUN_ASSERT_VALID( false, "" );
        return ERR_PAR;
    }

    char* szDesTelInFrm = v_szBuf;
    char* szSrcTelInFrm = v_szBuf;
#if 0 == USE_PROTOCOL || 1 == USE_PROTOCOL || 30 == USE_PROTOCOL
    szDesTelInFrm = v_szBuf + 5;
    szSrcTelInFrm = v_szBuf + 20;
#endif
#if 2 == USE_PROTOCOL
    szDesTelInFrm = v_szBuf + 6;
    szSrcTelInFrm = v_szBuf + 21;
#endif

    BYTE bytTranType, bytDataType;
#if 0 == USE_PROTOCOL || 30 == USE_PROTOCOL
    bytTranType = BYTE( v_szBuf[3] );
    bytDataType = BYTE( v_szBuf[4] );
#endif
#if 1 == USE_PROTOCOL
    bytTranType = BYTE( v_szBuf[0] );
    bytDataType = BYTE( v_szBuf[1] );
#endif
#if 2 == USE_PROTOCOL
    bytTranType = BYTE( v_szBuf[4] );
    bytDataType = BYTE( v_szBuf[5] );
#endif

    // 检查请求帧的目的手机号
    if( 0x10 != bytTranType || 0x01 != bytDataType ) // 若不是设置短信中心号
    {
        if( v_szVeTel && v_szVeTel[0] && strncmp(szDesTelInFrm, v_szVeTel, v_sizTel) )
        {
            PRTMSG(MSG_DBG, "DesTel is uncorrect!\n");
            PRTMSG(MSG_DBG, "szDesTelInFrm is:%s\n", szDesTelInFrm);
            PRTMSG(MSG_DBG, "v_szVeTel is:%s\n", v_szVeTel);
            return ERR_PAR;
        }
    }

    // 检查校验和
    byte bytSum = get_crc_sms((byte*)v_szBuf, v_iBufLen - 1);
    if( bytSum != BYTE( v_szBuf[v_iBufLen - 1] ) )
    {
        PRTMSG(MSG_DBG, "get_crc_sms err!\n");
        return ERR_PAR;
    }

    // 转入具体事务处理
    AnalyzeSmsFrame( szSrcTelInFrm, szDesTelInFrm, bytTranType, bytDataType, v_szBuf + QIANDOWNFRAME_BASELEN - 1, v_iBufLen - QIANDOWNFRAME_BASELEN);

    return 0;
}
开发者ID:zyh329,项目名称:MyWork,代码行数:59,代码来源:yx_Sock.cpp

示例13: _KillTimer

void CSock::TcpLog()
{
    char buf[ 200 ] = { 0 };
    int iLen = 0;

    // TCP连续登陆失败次数达到上限
    if(m_iTcpLogTimers > TCP_MAX_LOG_TIMERS)
    {
        m_iTcpLogTimers = 0;
        _KillTimer(&g_objTimerMng, DVRTCP_LOG_TIMER);

        buf[0] = 0x01;	// 请求SockServExe重新连接套接字
        DataPush(buf, 1, DEV_DVR, DEV_SOCK, LV3);
        PRTMSG(MSG_NOR, "Tcp Log failed to max timers, request Tcp Reconnect!\n");

        // 调度屏进行提示
        G_TmShowMsg(NULL, 0);

        return;
    }

    m_bTcpLogged = false;

#if USE_LIAONING_SANQI == 1
    buf[0] = 0x07;
    buf[1] = m_bTcpLogged ? 0x01 : 0x00;
    DataPush(buf, 2, DEV_DVR, DEV_QIAN, LV3);
#endif
    _SetTimer(&g_objTimerMng, DVRTCP_LOG_TIMER, 15000, G_TmTcpLog );

#if 2 == USE_PROTOCOL
    tag1PComuCfg obj1PComuCfg;
    obj1PComuCfg.Init(CDMA_NAME,CDMA_PASS);
    GetImpCfg( &obj1PComuCfg, sizeof(obj1PComuCfg),	offsetof(tagImportantCfg, m_uni1PComuCfg.m_obj1PComuCfg), sizeof(obj1PComuCfg) );
    memcpy( m_objGPRS01.m_szUserIdenCode, USERIDENCODE, sizeof(m_objGPRS01.m_szUserIdenCode) );
#endif

    GetSelfTel( m_objGPRS01.m_szParData, sizeof(m_objGPRS01.m_szParData) );

#if 0 == USE_PROTOCOL || 1 == USE_PROTOCOL || 30 == USE_PROTOCOL
    const BYTE GPRSLOGFRM_TYPE = 0x11;
    const BYTE GPRSLOGFRM_GRADE = 0x10;
#endif
#if 2 == USE_PROTOCOL
    const BYTE GPRSLOGFRM_TYPE = 0x01;
    const BYTE GPRSLOGFRM_GRADE = 0x04;
#endif
    if( !_MakeTcpFrame( (char*)&m_objGPRS01, sizeof(m_objGPRS01), GPRSLOGFRM_TYPE, GPRSLOGFRM_GRADE, buf, sizeof(buf), iLen ) )
    {
        PRTMSG(MSG_NOR, "Send Tcp Log Frame\n" );

        G_RecordDebugInfo("Dvr Send Tcp Log Frame" );

        DataPush(buf, iLen, DEV_DVR, DEV_SOCK, LV3);
        m_iTcpLogTimers++;
    }
}
开发者ID:zyh329,项目名称:MyWork,代码行数:57,代码来源:yx_Sock.cpp

示例14: Deal_ReUpload

void Deal_ReUpload(void *arg, int len)
{
	if( g_szReUploadBuf[0] == 0xC1 )
		PRTMSG(MSG_DBG, "ReUpload C1 frame\n");
	if( g_szReUploadBuf[0] == 0xC3 )
		PRTMSG(MSG_DBG, "ReUpload C3 frame\n");

	//PrintString((char*)g_szReUploadBuf, g_iReUploadLen);

	DataPush(g_szReUploadBuf, (DWORD)g_iReUploadLen, DEV_DVR, DEV_SOCK, LV2);
}
开发者ID:awzhang,项目名称:MyWork,代码行数:11,代码来源:yx_black_new.cpp

示例15: PRTMSG

int CLightCtrl::Init()
{
	// ´´½¨¿ØÖƵÆÏß³Ì
	if( pthread_create(&m_pthreadLightCtrl, NULL, G_ThreadLightCtrl, NULL) != 0 )
	{
		PRTMSG(MSG_ERR, "create light thread failed!\n");
		return ERR_THREAD;
	}

	PRTMSG(MSG_ERR, "create light thread succ!\n");
	return 0;
}
开发者ID:awzhang,项目名称:MyWork,代码行数:12,代码来源:LightCtrl.cpp


注:本文中的PRTMSG函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。