I need some help in figuring out AdhocCommand creation in Smack.
From this C++ gloox app: https://github.com/szatmary/iAlert/blob/master/logitechcameras.cpp
gloox::DataForm *form = new gloox::DataForm(gloox::TypeSubmit,“Get NVR Basic Request”);
form->addField( gloox::DataFormField::TypeHidden, “FORM_TYPE”, “urn:logitech-com:logitech-alert:nvr:basic:get” );
gloox::Adhoc::Command *cmd = new gloox::Adhoc::Command(“urn:logitech-com:logitech-alert:nvr:basic:get”, gloox::Adhoc::Command::Execute, form);
m_xmppClient->sendCommand( cmd );
UPDATE: ok, so in the time since the posting was approved by moderators, I think I stumbled into the .execute method I needed I believe this is equal code in Smack:
Form form1 = new Form(Form.TYPE_SUBMIT);
form1.setTitle(“Get NVR Basic Request”);
FormField field1 = new FormField(“FORM_TYPE”);
AdHocCommandManager ahcmanager = AdHocCommandManager.getAddHocCommandsManager(connection); RemoteCommand ahcommand = ahcmanager.getRemoteCommand("firstname.lastname@example.org/NvrCore", "urn:logitech-com:logitech-alert:nvr:basic:get"); ahcommand.execute(form1);
I’ll leave thread here in case anyone wants to suggest better technique. I found very few examples on the net of AdHocCommands for smack.