I am trying to pass a char pointer from the parse_http_request function which points to the incoming data to an xc function which transmits the data down channel. The function uses an array index to count through the data. I have looked through other code and it seems to be common practice but for some reason it is giving me an exception.
Below is the xc function.
Code: Select all
signed int xc_write_data_flash(chanend server, unsigned int address, unsigned int len, char data[] ) {
server <: 12;
server <: address;
server <: len;
for(int i = 0; i < len; i++)
{
server <: data[i];
}
}
Code: Select all
void parse_http_request(httpd_state_t *hs, char *data, int len,
chanend IRserve, chanend flash_serve)
{
int i;
int cmd;
int port;
int chnl;
int size;
char tmp[7];
if (hs->dptr != NULL)
return;
if (hs->receive_state.left < hs->receive_state.len)
{
xc_write_data_flash(flash_serve, 393216, len, data);
Code: Select all
static void writeDataToFlash(chanend client) {
int i;
int j;
unsigned int address;
unsigned int size;
unsigned char data[XTCP_CLIENT_BUF_SIZE];
client :> address;
client :> size;
for (i = 0; i<size ; i++)
{
client :> data[i];
}
The current code breaks when I send the array value down the channel.
Please help
Matt.