PDA

View Full Version : send_event



RobRoy
December 10th, 2002, 06:45 PM
int send_event(char *eventstring, void *payload, int len, int device);

payload??? What exactly is the payload? and what is the device?

thank

Mark F
December 12th, 2002, 06:12 AM
The Device is the DeviceID for this eventstring (use your plugin's device ID).

payload is the structured data that is sent through Girder with the eventstring.

The structure of the memory pointed to by payload is:


BYTE cnt; // number of null terminated strings
char strings[]; // null terminated strings (turned into the pldx string variables)
BYTE binary; // binary, free-form, data



The len value passed through the interface needs to be the total size of all the above data excluding the size of cnt. If cnt is 0, len is the size of the binary data. If cnt is non-0, len is th esize of the binary data plus the length of each string (including the null terminator).

If you don't have payload data to pass with an event, use NULL for payload and 0 for len.

The source code for some of the plugins (the
bool CGirder::SendData(CString& IRStr, CStringList& strList, void* pData, int iLen)
function in cGirder.cpp in the serial plugin, in particular) on the developer's page shows how one bozo (me) uses the interface.

RobRoy
February 18th, 2003, 06:27 AM
I try sending event to girder, but girder crach right away.

This is the code I use :

bool CWMSetting::SendData(CString& EventString, void *payload, int len, int device)
{
EventString = "test";
m_ActionFunctions.send_event((PCHAR)(LPCTSTR)Event String,NULL,0,PlgDeviceID);
return TRUE;
}

What I'm doing wrong?

I want to send raw data that I receive on the serial port directly to girder.

Example : 205.36.25.12.369.85.241.33.574.256.4.36.254.258.32
as you know the code could be different length depend on witch remote is used.