The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

RE: Rioplay and xPL


  • Subject: RE: Rioplay and xPL
  • From: Tony T
  • Date: Sat, 25 Jan 2003 07:49:00 +0000

Hi all,

Have got Rioplay compiling and listening to xPL messages :-)
(Currently does play/stop/light on/light off)

However, I was holding the array of message elements in a global, but as
the
routine is threaded when it is processing a valid command, the global
structure is getting overwritten by other incoming messages.

Can any C programmers please advise on the following, please?

I thought the best way was to define the array within the thread and then
pass a pointer to the array to the sub functions that do the processing.
But
I get an error during comilation:

Base operand of '->' has non-pointer type 'xpl_msg_struc'

These are some relevant code snippets:

typedef struct xpl_msg_struc {
char section[35];
char name[17];
char value[129];
};

int xPLParser(const char* xplmsg, struct xpl_msg_struc *, unsigned int
xpl_msg_index);

Then in the thread:

struct xpl_msg_struc xpl_msg[20], *pxpl_msg;
unsigned int xpl_msg_index = 0;
pxpl_msg=&xpl_msg[0]; (tried without the [0])

Calling the function:
xPLParser(mesg, pxpl_msg, xpl_msg_index)

The function is:
int xPLParser(const char* xplmsg, struct xpl_msg_struc * pxpl_msg, unsigned
int xpl_msg_index) {

A typical line causing the error is:
strcpy(pxpl_msg[xpl_msg_index]->section, xpl_section);

I'm sure I must be doing something stupid, but I havent used C for many
years.

Any ideas?

Many thanks
Tony






xPL Main Index | xPL Thread Index | xPL Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.