locationmgmt/networkgateway/test/netprotocoltest/src/lbsnetgatewayprotocoltestapi.cpp
changeset 57 3267d9ea3e98
parent 0 9cfd9a3ee49c
equal deleted inserted replaced
48:81c9bee26a45 57:3267d9ea3e98
   210 	return self;
   210 	return self;
   211 	}
   211 	}
   212 
   212 
   213 void CNetProtocolMessageTransmitter::ConstructL(TUid aCategory, TUint aTxKey)
   213 void CNetProtocolMessageTransmitter::ConstructL(TUid aCategory, TUint aTxKey)
   214 	{
   214 	{
   215 	LBSLOG(ELogP1, "CNetProtocolMessageTransmitter::ConstructL()");
   215 	LBSLOG2(ELogP1, "CNetProtocolMessageTransmitter::ConstructL(0x%x)", aTxKey);
   216 	__ASSERT_DEBUG(iTxProperty.Handle() == NULL, User::Invariant());
   216 	__ASSERT_DEBUG(iTxProperty.Handle() == NULL, User::Invariant());
   217 	
   217 	
   218 	User::LeaveIfError(iTxProperty.Attach(aCategory, aTxKey));
   218 	User::LeaveIfError(iTxProperty.Attach(aCategory, aTxKey));
   219 	User::LeaveIfError(iTxAckProperty.Attach(aCategory, (aTxKey + KChannelAckOffset)));
   219 	User::LeaveIfError(iTxAckProperty.Attach(aCategory, (aTxKey + KChannelAckOffset)));
   220 	
   220 	
   269 	NotifyMessageRead();
   269 	NotifyMessageRead();
   270 	TPckg<TNetGatewayMsg> pckg(aMessage);
   270 	TPckg<TNetGatewayMsg> pckg(aMessage);
   271 	TInt err = iTxProperty.Set(pckg);
   271 	TInt err = iTxProperty.Set(pckg);
   272 	if(err!=KErrNone)
   272 	if(err!=KErrNone)
   273 		{
   273 		{
       
   274 		LBSLOG2(ELogP1, "err = 0x%x", err);
   274 		Cancel();
   275 		Cancel();
   275 		User::Leave(err);
   276 		User::Leave(err);
   276 		}
   277 		}
   277 	iActiveWait.Start();
   278 	iActiveWait.Start();
   278 	}
   279 	}
   283 
   284 
   284 
   285 
   285 EXPORT_C RNetGatewayProtocolTestChannel::RNetGatewayProtocolTestChannel(TUint aModuleIndex) :
   286 EXPORT_C RNetGatewayProtocolTestChannel::RNetGatewayProtocolTestChannel(TUint aModuleIndex) :
   286 iModuleIndex(aModuleIndex)
   287 iModuleIndex(aModuleIndex)
   287 	{
   288 	{
   288 	LBSLOG(ELogP1, "RNetGatewayProtocolTestChannel::RNetGatewayProtocolTestChannel()");
   289 	LBSLOG2(ELogP1, "RNetGatewayProtocolTestChannel::RNetGatewayProtocolTestChannel(0x%x)", aModuleIndex);
   289 	}
   290 	}
   290 
   291 
   291 EXPORT_C RNetGatewayProtocolTestChannel::RNetGatewayProtocolTestChannel() :
   292 EXPORT_C RNetGatewayProtocolTestChannel::RNetGatewayProtocolTestChannel() :
   292 iModuleIndex(0)
   293 iModuleIndex(0)
   293 	{
   294 	{
   294 	LBSLOG(ELogP1, "RNetGatewayProtocolTestChannel::RNetGatewayProtocolTestChannel()");
   295 	LBSLOG(ELogP1, "RNetGatewayProtocolTestChannel::RNetGatewayProtocolTestChannel()");
   295 	}
   296 	}
   296 
   297 
   297 EXPORT_C void RNetGatewayProtocolTestChannel::InitialiseL(TUint aModuleIndex)
   298 EXPORT_C void RNetGatewayProtocolTestChannel::InitialiseL(TUint aModuleIndex)
   298 	{
   299 	{
   299 	LBSLOG(ELogP1, "RNetGatewayProtocolTestChannel::InitialiseL()");
   300 	LBSLOG2(ELogP1, "RNetGatewayProtocolTestChannel::InitialiseL(0x%x)", aModuleIndex);
   300 	__ASSERT_DEBUG(KLbsNetGatewayUid  == RProcess().SecureId(), User::Invariant());
   301 	__ASSERT_DEBUG(KLbsNetGatewayUid  == RProcess().SecureId(), User::Invariant());
   301 	
   302 	
   302 	TSecurityPolicy readPolicy(ECapabilityLocation);
   303 	TSecurityPolicy readPolicy(ECapabilityLocation);
   303 	TSecurityPolicy writePolicy(ECapabilityWriteDeviceData);
   304 	TSecurityPolicy writePolicy(ECapabilityWriteDeviceData);
   304 
   305