예제 #1
0
ArpConfigureFile& ArpConfigureFile::operator=(const ArpConfigureFile& o)
{
    StopWatcher();

    size_t i;
    mConfigs->resize(0);
    mConfigs->reserve(o.mConfigs->size());
    for( i=0; i<o.mConfigs->size(); i++ ) mConfigs->push_back(o.mConfigs->at(i));
    mNames->resize(0);
    mNames->reserve(o.mNames->size());
    for( i=0; i<o.mNames->size(); i++ ) mNames->push_back(o.mNames->at(i));
    mFile = o.mFile;
    mMimeType = o.mMimeType;

#if 0	// Don't copy the watcher info
    mWatcher = o.mWatcher;

    delete mWatchMessage;
    mWatchMessage = 0;
    if( o.mWatchMessage ) {
        mWatchMessage = new BMessage(o.mWatchMessage);
    }
#endif

    StartWatcher();

    ArpD(cdb << ADH << "Copied ArpConfigureFile:" << endl);
    ArpD(cdb << ADH << "  src num configs = " << o.mConfigs->size()
         << ", names = " << o.mNames->size() << endl);
    ArpD(cdb << ADH << "  new num configs = " << mConfigs->size()
         << ", names = " << mNames->size() << endl);
    return *this;
}
예제 #2
0
status_t ArpConfigureFile::StartWatching(const BMessenger& destination,
        BMessage* message)
{
    StopWatching();
    mWatcher = destination;
    mWatchMessage = message;
    return StartWatcher();
}
예제 #3
0
void wxGxDiscConnection::LoadChildren(void)
{
	if(m_bIsChildrenLoaded)
		return;

    wxGxFolder::LoadChildren();
    StartWatcher();
}
/**
 *  This tests the retrieval of the charger Strength.  ESAChargerNotCharging
 *  does not appear to be used in the indicatorwatcher, apart from the
 *  #ifdef'ed test code that is not available to this "in situ" test.
 *
 *  @test GT83-SSW-Test02 Test retrieval of the Battery and Charger setting.
 */	
enum TVerdict CTelWatchersIntTestRetrieveChargerStatusWithPublishSubscribe::doTestStepL()
	{
	//
	// Make sure watchers are stopped and unloaded before running this test.
	// This forces SIMTSY to be loaded again.
	//
	StopWatcher();
	SetSimTsyTestNumberL(1);
	StartWatcher();

	TInt  state;
	TRequestStatus  localStatus;
	RProperty       localProperty;

	//-- attach and subscribe to KUidChargerStatus property
	TInt ret = localProperty.Attach(KUidSystemCategory,KUidChargerStatus.iUid);
	TESTCHECKL(ret, KErrNone);
	localProperty.Subscribe(localStatus);  

	//
	// Get initial battery charge state
	//
	ret = localProperty.Get(state);
	TESTCHECKL(ret, KErrNone);
	INFO_PRINTF2(_L("Initial Battery Charger State is %d"), state);

	
	User::WaitForRequest(localStatus);		
	localProperty.Subscribe(localStatus);
	ret = localProperty.Get(state);
	TESTCHECKL(ret, KErrNone);
	INFO_PRINTF2(_L("Battery Charger State is %d"), state);
	TESTCHECK(state, ESAChargerConnected);

	User::WaitForRequest(localStatus);		
	localProperty.Subscribe(localStatus);
	ret = localProperty.Get(state);
	TESTCHECKL(ret, KErrNone);
	INFO_PRINTF2(_L("Battery Charger State is %d"), state);
	TESTCHECK(state, ESAChargerDisconnected);

	User::WaitForRequest(localStatus);		
	localProperty.Subscribe(localStatus);
	ret = localProperty.Get(state);
	TESTCHECKL(ret, KErrNone);
	INFO_PRINTF2(_L("Battery Charger State is %d"), state);
	TESTCHECK(state, KErrUnknown);

	User::WaitForRequest(localStatus);
	ret = localProperty.Get(state);
	TESTCHECKL(ret, KErrNone);
	INFO_PRINTF2(_L("Battery Charger State is %d"), state);
	TESTCHECK(state, ESAChargerConnected);

	CheckSimTsyTestNumberL(1);

	return TestStepResult();
	} // CTelWatchersIntTestRetrieveChargerStatusWithPublishSubscribe::doTestStepL
예제 #5
0
Watcher *WatcherCreate(char *paths[], int numPaths, PathCallback callback) {
    int i;
    CFMutableArrayRef paths_ = CreatePathsArray(paths, numPaths);
    Watcher *watcher = malloc(sizeof *watcher);
    watcher->pathsToWatch = paths_;
    FSEventStreamContext context = {};
    context.info = callback;
    watcher->stream = FSEventStreamCreate(NULL, &WatcherCallback, &context, paths_, kFSEventStreamEventIdSinceNow, 2, 0);
    StartWatcher(watcher);
    return watcher;
}
예제 #6
0
int WatcherListener::Open (void * arg)
{ 
    ev_io_set(&m_watcher, m_socket.GetSocketFD(), EV_READ);
    StartWatcher();
    char* addrStr = m_socket.GetLocalAddrStr()->GetAsCString();
    if(addrStr)
    {
        LOG_NOTICE("Lister IP:%s,Port:%u, Successed!",addrStr,m_socket.GetLocalPort());
        delete addrStr;
    }
    return 0;
}
/**
 *  This tests the retrieval of the Network Status.
 *
 *  @test GT83-SSW-Test03 Test retrieval of the Network status information.
 */	
enum TVerdict CTelWatchersIntTestNetworkStatusWithPublishSubscribe::doTestStepL()
	{
	//
	// Make sure watchers are stopped and unloaded before running this test.
	// This forces SIMTSY to be loaded again.
	//
	StopWatcher();
	SetSimTsyTestNumberL(2);
	StartWatcher();

	TInt  state;
	TRequestStatus  localStatus;
	RProperty       localProperty;

	//
	// Get initial network available status...
	//
	TInt ret = RProperty::Get(KUidSystemCategory, KUidChargerStatus.iUid, state);
	TESTCHECKL(ret, KErrNone);
	INFO_PRINTF2(_L("Initial Network Available Status is %d"), state);
		
	//-- attach and subscribe to KUidNetworkStatus property
	ret = localProperty.Attach(KUidSystemCategory,KUidNetworkStatus.iUid);
	TESTCHECKL(ret, KErrNone);
	localProperty.Subscribe(localStatus);
	
	User::WaitForRequest(localStatus);		
	localProperty.Subscribe(localStatus);
	ret = localProperty.Get(state);
	TESTCHECKL(ret, KErrNone);
	INFO_PRINTF2(_L("Network Available Status is %d"), state);
	TESTCHECK(state, ESANetworkAvailable);

	User::WaitForRequest(localStatus);		
	ret = localProperty.Get(state);
	TESTCHECKL(ret, KErrNone);
	INFO_PRINTF2(_L("Network Available Status is %d"), state);
	TESTCHECK(state, ESANetworkUnAvailable);

	CheckSimTsyTestNumberL(2);

	return TestStepResult();
	} // CTelWatchersIntTestNetworkStatusWithPublishSubscribe::doTestStepL
/**
 *  This test tests the retrieval of the signal strength.
 *
 *  @test GT83-SSW-Test01 Test retrieval of the Signal Strength setting.
 */	
enum TVerdict CTelWatchersIntTestRetrieveSignalStrengthWithPublishSubscribe::doTestStepL()
	{
	//
	// Make sure watchers are stopped and unloaded before running this test
	// This forces SIMTSY to be loaded again.
	//
	StopWatcher();
	SetSimTsyTestNumberL(0);
	StartWatcher();
	CheckSimTsyTestNumberL(0);

	TInt  state;
	TRequestStatus  localStatus;
	RProperty       localProperty;
		
	//-- attach and subscribe to KUidNetworkStrength property
	TESTCHECKL(localProperty.Attach(KUidSystemCategory,KUidNetworkStrength.iUid), KErrNone);    
	localProperty.Subscribe(localStatus);

	TInt ret = localProperty.Get(state);
	TESTCHECKL(ret, KErrNone);
	INFO_PRINTF2(_L("Initial Signal Strength State is %d"), state);

	INFO_PRINTF1(_L("Commence Wait for Request local status..."));
	INFO_PRINTF2(_L("Prior to wait cycle, status is %d"), localStatus.Int());
	User::WaitForRequest(localStatus);			
	INFO_PRINTF1(_L("Complete Wait for Request local status."));
	localProperty.Subscribe(localStatus);
	ret = localProperty.Get(state);	
	TESTCHECKL(ret, KErrNone);
				
	INFO_PRINTF2(_L("Signal Strength State is %d"), state);
	TESTCHECK(state, ESANetworkStrengthNone);
		
	User::WaitForRequest(localStatus);		
	ret = localProperty.Get(state);
	localProperty.Subscribe(localStatus);
	TESTCHECKL(ret, KErrNone);
			
	INFO_PRINTF2(_L("Signal Strength State is %d"),state);
	TESTCHECK(state, ESANetworkStrengthLow);

	User::WaitForRequest(localStatus);		
	ret = localProperty.Get(state);
	localProperty.Subscribe(localStatus);
	TESTCHECKL(ret, KErrNone);

	INFO_PRINTF2(_L("Signal Strength State is %d"),state);
	TESTCHECK(state, ESANetworkStrengthMedium);

	User::WaitForRequest(localStatus);	
	ret = localProperty.Get(state);	
	localProperty.Subscribe(localStatus);
	TESTCHECKL(ret, KErrNone);

	INFO_PRINTF2(_L("Signal Strength State is %d"),state);
	TESTCHECK(state, ESANetworkStrengthHigh);

	User::WaitForRequest(localStatus);		
	ret = localProperty.Get(state);
	TESTCHECKL(ret, KErrNone);

	INFO_PRINTF2(_L("Signal Strength State is %d"),state);
	TESTCHECK(state, ESANetworkStrengthUnknown);

	return TestStepResult();
	} // CTelWatchersIntTestRetrieveSignalStrengthWithPublishSubscribe::doTestStepL
예제 #9
0
status_t ArpConfigureFile::SetFile(const entry_ref& file)
{
    StopWatcher();
    mFile = file;
    return StartWatcher();
}
예제 #10
0
int WatcherNoticePipe::Open (void * arg)
{
    ev_io_set(&m_watcher, m_readFD, EV_READ);
    StartWatcher();
    return 0;
}