Revision history [back]

click to hide/show revision 1
initial version

signature and argument

Hi~ I am a beginner of Alljoyn SDK and trying to make an app with c++ in linux. (based on "Chat" example)

my problem is I don't know how to make "signature" and how to deal with arguments of MsgArg class.

I already checked some example online but i can not unstand it.

I need to make a Signal which have arguments ( string, INT32, INT32) and print them as arguments

so my code is (almost same with "Chat" example)

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

InterfaceDescription* chatIntf = NULL;

chatIntf->AddSignal("Chat", "r(sii)", NULL, 0}; // <-- is this Signature right?

chatIntf->Activate(); ..

..

status = bus.RegisterSignalHandler(this, static_cast<messagereceiver::signalhandler>(&ChatObject::ChatSignalHandler), chatSignalMember NULL);

MsgArg chatArg("r(sii)", "hello", 1004, 1005); // <-- is this right? i just want to send "hello" and 1004, 1005 as arguments

return Signal(NULL, s_sessionID, *chatSignalMember, &chatArg, 1, 0, flags);

//for print argument

void ChatSignalHandler(const InterfaceDescription::Member* member, const char* srcPath, Message& msg) {

**printf(" string arg = %s \n", msg->GetArg(0)->v_string.str); <-- is this right to print string argument "helllo"?

printf(" int arg1 = %s \n", msg->GetArg(1)->v_int32); <-- is this right to print int argument "1004"?

printf(" int arg2 = %s \n", msg->GetArg(2)->v_int32); <-- is this right to print int argument "1005"?**

}

i don't know how to use signature of struct with C++ code.

thanks in advence

signature and argument

Hi~ I am a beginner of Alljoyn SDK and trying to make an app with c++ in linux. (based on "Chat" example)

my example) My problem is I don't know how to make "signature" and how to deal with arguments of MsgArg class.

class. I already checked some example online but i can not unstand it.

it. I need to make a Signal which have arguments ( string, INT32, INT32) and print them as arguments

arguments so my code is (almost same with "Chat" example)

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

InterfaceDescription* chatIntf = NULL;

NULL; chatIntf->AddSignal("Chat", "r(sii)", NULL, 0}; // <-- is this Signature right?

chatIntf->Activate(); ..

.. ..

status = bus.RegisterSignalHandler(this, static_cast<messagereceiver::signalhandler>(&ChatObject::ChatSignalHandler), chatSignalMember NULL);

MsgArg chatArg("r(sii)", "hello", 1004, 1005); // <-- is this right? i just want to send "hello" and 1004, 1005 as arguments

return Signal(NULL, s_sessionID, *chatSignalMember, &chatArg, 1, 0, flags);

//for print argument

void ChatSignalHandler(const InterfaceDescription::Member* member, const char* srcPath, Message& msg) {

**printf(" string arg = %s \n", msg->GetArg(0)->v_string.str); <-- is this right to print string argument "helllo"?

printf(" int arg1 = %s \n", msg->GetArg(1)->v_int32); <-- is this right to print int argument "1004"?

printf(" int arg2 = %s \n", msg->GetArg(2)->v_int32); <-- is this right to print int argument "1005"?**

}

i don't know how to use signature of struct with C++ code.

thanks in advence

signature and argument

Hi~ I am a beginner of Alljoyn SDK and trying to make an app with c++ in linux. (based on "Chat" example) example)

My problem is I don't know how to make "signature" and how to deal with arguments of MsgArg class. class.

I already checked some example online but i can not unstand it. it.

I need to make a Signal which have arguments ( string, INT32, INT32) and print them as arguments arguments

so my code is (almost same with "Chat" example)

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" ////////////////////////////////////////////////////////////////////////////////////////////////"

InterfaceDescription* chatIntf = NULL; NULL;

chatIntf->AddSignal("Chat", "r(sii)", NULL, 0}; // <-- is this Signature right?right as a signature of struct?

chatIntf->Activate(); .. ..

status = bus.RegisterSignalHandler(this, static_cast<messagereceiver::signalhandler>(&ChatObject::ChatSignalHandler), chatSignalMember NULL);

MsgArg chatArg("r(sii)", "hello", 1004, 1005); // <-- is this right? i just want to send "hello" and 1004, 1005 as arguments

return Signal(NULL, s_sessionID, *chatSignalMember, &chatArg, 1, 0, flags);

//for print argument

void ChatSignalHandler(const InterfaceDescription::Member* member, const char* srcPath, Message& msg) {

**printf(" string arg = %s \n", msg->GetArg(0)->v_string.str); <-- is this right to print string argument "helllo"?

printf(" int arg1 = %s \n", msg->GetArg(1)->v_int32); <-- is this right to print int argument "1004"?

printf(" int arg2 = %s \n", msg->GetArg(2)->v_int32); <-- is this right to print int argument "1005"?**

}

" ////////////////////////////////////////////////////////////////////////////////////////////////"

i don't know how to use signature of struct with C++ code.

thanks in advence

signature and argument

Hi~ I am a beginner of Alljoyn SDK and trying to make an app with c++ in linux. (based on "Chat" example)

My problem is I don't know how to make "signature" and how to deal with arguments of MsgArg class.

I already checked some example online but i can not unstand it.

I need to make a Signal which have arguments ( string, INT32, INT32) and print them as arguments

so my code is (almost same with "Chat" example)

" ////////////////////////////////////////////////////////////////////////////////////////////////"

InterfaceDescription* chatIntf = NULL;

chatIntf->AddSignal("Chat", "r(sii)", NULL, 0}; // <-- is this Signature right as a signature of struct?

chatIntf->Activate(); .. ..

status = bus.RegisterSignalHandler(this, static_cast<messagereceiver::signalhandler>(&ChatObject::ChatSignalHandler), chatSignalMember NULL);

MsgArg chatArg("r(sii)", "hello", 1004, 1005); // <-- is this right? i just want to send "hello" and 1004, 1005 as arguments

return Signal(NULL, s_sessionID, *chatSignalMember, &chatArg, 1, 0, flags);

//for print argument

void ChatSignalHandler(const InterfaceDescription::Member* member, const char* srcPath, Message& msg) {

 **printf(" string arg = %s \n", msg->GetArg(0)->v_string.str); <-- is this right to print string argument "helllo"?

printf(" "helllo"?** **printf(" int arg1 = %s \n", msg->GetArg(1)->v_int32); <-- is this right to print int argument "1004"?

printf(" "1004"?** **printf(" int arg2 = %s \n", msg->GetArg(2)->v_int32); <-- is this right to print int argument "1005"?**

"1005"?**

}

" ////////////////////////////////////////////////////////////////////////////////////////////////"

i don't know how to use signature of struct with C++ code.

thanks in advence

signature and argument

Hi~ I am a beginner of Alljoyn SDK and trying to make an app with c++ in linux. (based on "Chat" example)

My problem is I don't know how to make "signature" and how to deal with arguments of MsgArg class.

I already checked some example online but i can not unstand it.

I need to make a Signal which have arguments ( string, INT32, INT32) and print them as arguments

so my code is (almost same with "Chat" example)

" ////////////////////////////////////////////////////////////////////////////////////////////////"

InterfaceDescription* chatIntf = NULL;

chatIntf->AddSignal("Chat", "r(sii)", NULL, 0}; // <-- is this Signature right as a signature of struct?

chatIntf->Activate(); .. ..

status = bus.RegisterSignalHandler(this, static_cast<messagereceiver::signalhandler>(&ChatObject::ChatSignalHandler), chatSignalMember NULL);

MsgArg chatArg("r(sii)", "hello", 1004, 1005); // <-- is this right? i just want to send "hello" and 1004, 1005 as arguments

return Signal(NULL, s_sessionID, *chatSignalMember, &chatArg, 1, 0, flags);

//for print argument

argument void ChatSignalHandler(const InterfaceDescription::Member* member, const char* srcPath, Message& msg) {

 **printf(" printf(" string arg = %s \n", msg->GetArg(0)->v_string.str); <-- is this right to print string argument "helllo"?**

 **printf(" "helllo"?

printf(" int arg1 = %s \n", msg->GetArg(1)->v_int32); <-- is this right to print int argument "1004"?**

**printf(" "1004"?

printf(" int arg2 = %s \n", msg->GetArg(2)->v_int32); <-- is this right to print int argument "1005"?**
"1005"?

}

" ////////////////////////////////////////////////////////////////////////////////////////////////"

i don't know how to use signature of struct with C++ code.

thanks in advence

signature and argument

Hi~ I am a beginner of Alljoyn SDK and trying to make an app with c++ in linux. (based on "Chat" example)

My problem is I don't know how to make "signature" and how to deal with arguments of MsgArg class.

I already checked some example online but i can not unstand it.

I need to make a Signal which have arguments ( string, INT32, INT32) and print them as arguments

so my code is (almost same with "Chat" example)

" ////////////////////////////////////////////////////////////////////////////////////////////////""###########################################################################"

InterfaceDescription* chatIntf = NULL;

chatIntf->AddSignal("Chat", "r(sii)", NULL, 0}; // <-- is this Signature right as a signature of struct?

chatIntf->Activate(); .. ..

status = bus.RegisterSignalHandler(this, static_cast<messagereceiver::signalhandler>(&ChatObject::ChatSignalHandler), chatSignalMember NULL);

MsgArg chatArg("r(sii)", "hello", 1004, 1005); 1005);

// <-- is this right? i just want to send "hello" and 1004, 1005 as arguments

return Signal(NULL, s_sessionID, *chatSignalMember, &chatArg, 1, 0, flags);

//for print argument argument

void ChatSignalHandler(const InterfaceDescription::Member* member, const char* srcPath, Message& msg) {

printf(" string arg = %s \n", msg->GetArg(0)->v_string.str); msg->GetArg(0)->v_string.str);

<-- is this right to print string argument "helllo"? "helllo"?

printf(" int arg1 = %s \n", msg->GetArg(1)->v_int32); msg->GetArg(1)->v_int32)

<-- is this right to print int argument "1004"? "1004"?

printf(" int arg2 = %s \n", msg->GetArg(2)->v_int32); msg->GetArg(2)->v_int32);

<-- is this right to print int argument "1005"? "1005"?

}

" ////////////////////////////////////////////////////////////////////////////////////////////////""###########################################################################"

i don't know how to use signature of struct with C++ code.

thanks in advenceadvenceenter code here

signature and argument

Hi~ I am a beginner of Alljoyn SDK and trying to make an app with c++ in linux. (based on "Chat" example)

My problem is I don't know how to make "signature" and how to deal with arguments of MsgArg class.

I already checked some example online but i can not unstand it.

I need to make a Signal which have arguments ( string, INT32, INT32) and print them as arguments

so my code is (almost same with "Chat" example)

"###########################################################################"

InterfaceDescription* chatIntf = NULL;

chatIntf->AddSignal("Chat", "r(sii)", NULL, 0}; // <-- is this Signature right as a signature of struct?

chatIntf->Activate(); .. chatIntf->Activate();

..

..

status = bus.RegisterSignalHandler(this, static_cast<messagereceiver::signalhandler>(&ChatObject::ChatSignalHandler), chatSignalMember NULL);

MsgArg chatArg("r(sii)", "hello", 1004, 1005);

// <-- is this right? i just want to send "hello" and 1004, 1005 as arguments

return Signal(NULL, s_sessionID, *chatSignalMember, &chatArg, 1, 0, flags);

//for print argument

void ChatSignalHandler(const InterfaceDescription::Member* member, const char* srcPath, Message& msg) {

printf(" string arg = %s \n", msg->GetArg(0)->v_string.str);

<-- is this right to print string argument "helllo"?

printf(" int arg1 = %s \n", msg->GetArg(1)->v_int32)

<-- is this right to print int argument "1004"?

printf(" int arg2 = %s \n", msg->GetArg(2)->v_int32);

<-- is this right to print int argument "1005"?

}

"###########################################################################"

i don't know how to use signature of struct with C++ code.

thanks in advenceenter code here

dealing with signature and argument

Hi~ I am a beginner of Alljoyn SDK and trying to make an app with c++ in linux. (based on "Chat" example)

My problem is I don't know how to make "signature" and how to deal with arguments of MsgArg class.

I already checked some example online but i can not unstand it.

I need to make a Signal which have arguments ( string, INT32, INT32) and print them as arguments

so my code is (almost same with "Chat" example)

"###########################################################################"

InterfaceDescription* chatIntf = NULL;

chatIntf->AddSignal("Chat", "r(sii)", NULL, 0}; // <-- is this Signature right as a signature of struct?

chatIntf->Activate();

..

..

status = bus.RegisterSignalHandler(this, static_cast<messagereceiver::signalhandler>(&ChatObject::ChatSignalHandler), chatSignalMember NULL);

MsgArg chatArg("r(sii)", "hello", 1004, 1005);

// <-- is this right? i just want to send "hello" and 1004, 1005 as arguments

return Signal(NULL, s_sessionID, *chatSignalMember, &chatArg, 1, 0, flags);

//for print argument

void ChatSignalHandler(const InterfaceDescription::Member* member, const char* srcPath, Message& msg) {

printf(" string arg = %s \n", msg->GetArg(0)->v_string.str);

<-- is this right to print string argument "helllo"?

printf(" int arg1 = %s \n", msg->GetArg(1)->v_int32)

<-- is this right to print int argument "1004"?

printf(" int arg2 = %s \n", msg->GetArg(2)->v_int32);

<-- is this right to print int argument "1005"?

}

"###########################################################################"

i don't know how to use signature of struct with C++ code.

thanks in advenceenter code here