void CLocaSenderImpl::NewSensorEventL(const TTupleName& , 
	const TDesC& aSubName, const CBBSensorEvent& aEvent)
{
	CALLSTACKITEM_N(_CL("CLocaSenderImpl"), _CL("NewSensorEventL"));

	//Reporting().DebugLog(_L("CLocaSenderImpl::NewSensorEventL"));
	if (!iEnabled) return;

	const CBBBtDeviceList* devices=bb_cast<CBBBtDeviceList>(aEvent.iData());
	if (!devices) return;
	if (aSubName.Length()>0) {
		iLocaLogic->UpdateStats(aSubName, devices, aEvent.iStamp());
		return;
	} else {
		if (devices->Count()<=1) return;
		iLocaLogic->UpdateStats(iNodeName, devices, aEvent.iStamp());
	}

	if (iCurrentState==ESending || iCurrentState==ECanceling) {
		// shouldn't happen
		CancelSend();
		return;
	}
	if (iCurrentState==ECanceling) {
		return;
	}

	const TBBBtDeviceInfo* i=0;
	TInt send_to=-1;
	auto_ptr<HBufC8> iSendingBody(0);
	iLocaLogic->GetMessage(devices, 
		aEvent.iStamp(), 
		send_to, iSendingMessageId,
		iSendingWithName, iSendingWithTitle,
		iSendingBody);
	if(send_to==-1) return;

	TInt ii;
	for(i=devices->First(), ii=0; i && ii<send_to; i=devices->Next(), ii++) {
	}
	if (!i) return;
	iSendingTo=*i;

	iCurrentState=ESending;
	TBTDevAddr a(iSendingTo.iMAC());
	iSendingToAddr=a;
	TInt connectcount=10;
	Settings().GetSettingL(SETTING_LOCA_BLUEJACK_CONNECT_COUNT, connectcount);
#ifdef __WINS__
	{
		TBuf<100> msg=_L("CLocaSender::Sending to ");
		TRAPD(err, iSendingTo.IntoStringL(msg));
		//Reporting().DebugLog(msg);
	}
#endif
	iBlueJack->SendMessageL(iSendingToAddr,
		iSendingWithName, iSendingWithTitle,
		*iSendingBody, connectcount);
	iTimeOut->Wait(iMessageTimeOut);
}
void OsclSocketIBase::CancelFxn(TPVSocketFxn aType)
{
    switch (aType)
    {
        case EPVSocketConnect:
            CancelConnect();
            break;
        case EPVSocketAccept:
            CancelAccept();
            break;
        case EPVSocketShutdown:
            CancelShutdown();
            break;
        case EPVSocketSend:
            CancelSend();
            break;
        case EPVSocketRecv:
            CancelRecv();
            break;
        case EPVSocketSendTo:
            CancelSendTo();
            break;
        case EPVSocketRecvFrom:
            CancelRecvFrom();
            break;
        case EPVSocketBind:
            CancelBind();
            break;
        case EPVSocketListen:
            CancelListen();
            break;
        default:
            OSCL_ASSERT(false);
            break;
    }
}
void CLocaSenderImpl::expired(CBase* Source)
{
	CALLSTACKITEM_N(_CL("CLocaSenderImpl"), _CL("expired"));

	CancelSend();
}