コード例 #1
0
ファイル: upnp.c プロジェクト: codywon/bell-jpg
void* PnpProc( void* p )
{
    int iRet = 0;
    unsigned short times = 0;

    while ( 1 )
    {
        //printf("upnpflag=%d  enable = %d\n",upnpflag,bparam.stUpnpParam.byEnable);
        if ( upnpflag == 0x01 )
        {
            if ( bparam.stUpnpParam.byEnable == 0x01 )
            {
                iRet = UPnPStart();
                printf( "iRet %d\n", iRet );

                if ( iRet == 0x00 )
                {
                    times = 0x00;
                }
            }
        }

        sleep( 30 );
        //printf("upnp times:%d\n",times);
        times++;

        if ( times >= 60 * 10 )
        {
            times = 0;
            upnpflag = 0x00;
        }
    }
}
コード例 #2
0
ファイル: UPnPMain.c プロジェクト: optman/upnpstack
int main(void)
{
  void* UPnPFM_SwitchPower[] = {&SwitchPower_GetStatus,&SwitchPower_SetTarget};
  void* UPnPFM_DimmingService[] = {&DimmingService_GetLoadLevelStatus,&DimmingService_GetMinLevel,&DimmingService_SetLoadLevelTarget};
  UPnPSFP_SwitchPower(UPnPFM_SwitchPower);
  UPnPSFP_DimmingService(UPnPFM_DimmingService);

printf("Intel's UPnP MicroStack 1.0\r\nConnected & Extended PC Lab (CEL)\r\n\r\n");
  UPnPStart("fb852742-474d-431d-b1ad-628c92c533b2","0000001", 120);

  return 0;
}