commands/pubsub/pubsub.cpp
changeset 60 3ad902ef5222
parent 0 7f656887cf89
child 86 849a0b46c767
equal deleted inserted replaced
59:db96d73779bc 60:3ad902ef5222
    66 	TUint iKey;
    66 	TUint iKey;
    67 	// Options
    67 	// Options
    68 	HBufC* iStringVal;
    68 	HBufC* iStringVal;
    69 	TInt iIntVal;
    69 	TInt iIntVal;
    70 	TBool iForce;
    70 	TBool iForce;
       
    71 	TBool iRaw;
    71 
    72 
    72 	TBool iNotify;
    73 	TBool iNotify;
    73 	TBool iDefine;
    74 	TBool iDefine;
    74 
    75 
    75 	// Other assorted stuff
    76 	// Other assorted stuff
   340 	if (err == KErrNone)
   341 	if (err == KErrNone)
   341 		{
   342 		{
   342 		switch (type)
   343 		switch (type)
   343 			{
   344 			{
   344 			case EInt:
   345 			case EInt:
   345 				Printf(_L("0x%08x 0x%08x TInt: %d (0x%x)\r\n"), aCategory, aKey, valInt, valInt);
   346 				if (iRaw)
       
   347 					{
       
   348 					Printf(_L("%d"), valInt);
       
   349 					}
       
   350 				else
       
   351 					{
       
   352 					Printf(_L("0x%08x 0x%08x TInt: %d (0x%x)\r\n"), aCategory, aKey, valInt, valInt);
       
   353 					}
   346 				break;
   354 				break;
   347 			case EDes:
   355 			case EDes:
   348 				{
   356 				{
   349 				TPtrC8 des(valDes);
   357 				if (iRaw)
   350 				if (!aFull) des.Set(valDes.Left(32)); // Don't print the whole thing, only 2 lines max
   358 					{
   351 				Printf(_L("0x%08x 0x%08x TDesC8 hex dump:\r\n"), aCategory, aKey);
   359 					Printf(_L8("%S"), &valDes);
   352 				LtkUtils::HexDumpToOutput(des, Stdout());
   360 					}
   353 				if (des.Length() < valDes.Length()) Write(_L("...\r\n"));
   361 				else
       
   362 					{
       
   363 					TPtrC8 des(valDes);
       
   364 					if (!aFull) des.Set(valDes.Left(32)); // Don't print the whole thing, only 2 lines max
       
   365 					Printf(_L("0x%08x 0x%08x TDesC8 hex dump:\r\n"), aCategory, aKey);
       
   366 					LtkUtils::HexDumpToOutput(des, Stdout());
       
   367 					if (des.Length() < valDes.Length()) Write(_L("...\r\n"));
       
   368 					}
   354 				break;
   369 				break;
   355 				}
   370 				}
   356 			default:
   371 			default:
   357 				break;
   372 				break;
   358 			}
   373 			}
   374 	aOptions.AppendBoolL(iForce, _L("force"));
   389 	aOptions.AppendBoolL(iForce, _L("force"));
   375 #endif
   390 #endif
   376 #ifdef FSHELL_TRACE_SUPPORT
   391 #ifdef FSHELL_TRACE_SUPPORT
   377 	aOptions.AppendBoolL(iUseBtrace, _L("btrace"));
   392 	aOptions.AppendBoolL(iUseBtrace, _L("btrace"));
   378 #endif
   393 #endif
       
   394 	aOptions.AppendBoolL(iRaw, _L("raw"));
   379 	//aOptions.AppendStringL(iStringVal, '8', _L("set-data"), _L("Sets the specified key to this 8-bit value"));
   395 	//aOptions.AppendStringL(iStringVal, '8', _L("set-data"), _L("Sets the specified key to this 8-bit value"));
   380 	//aOptions.AppendBoolL(iDelete, 'l', _L("delete"), _L("Deletes the specified property"));
   396 	//aOptions.AppendBoolL(iDelete, 'l', _L("delete"), _L("Deletes the specified property"));
   381 	}
   397 	}
   382 
   398 
   383 TInt CCmdPubsub::PropertyChanged(TAny* aSelf)
   399 TInt CCmdPubsub::PropertyChanged(TAny* aSelf)