Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Marc VDH

Pages: [1]
1
NXPTM M522XX, KINETIS and i.MX RT / Getting control over port TC
« on: March 06, 2010, 10:02:28 AM »
Hello Mark,

I would like to use port TC in my application, but this port is already being used by uTasker itself for the blinking LEDs.
Is there a simple, straightforward way to disable the uTasker use of this port, or do I have to go through the code to remove all uTasker use of that port myself?

2
NXPTM M522XX, KINETIS and i.MX RT / Connecting a T6963c based LCD
« on: November 22, 2009, 08:05:52 PM »
I was wondering if a Toshiba T6963C based graphical LCD module can be connected directly to a Coldfire microcontroller, as the Toshiba chips are specified to work at a power supply voltage of 5V only. Or do they also work at 3,3V?

3
µTasker general / Trying to get some TCP work done...
« on: October 27, 2009, 06:28:45 PM »
I'm currently trying to download some HTTP data from the internet using the uTasker. I used the TCP tutorial that was posted here a while ago as a reference, together with the NTP client code from the demo application.

Definitions...
Code: [Select]
#define METAF_TCP_PORT 8080
#define MAX_DATA_LEN 500
typedef struct stTCP_MESSAGE
{
TCP_HEADER     tTCP_Header;                    // reserve header space
unsigned char  ucTCP_Message[MAX_DATA_LEN];    // data payload space
} TCP_MESSAGE;

const char postData[] = "station_ids=EBAW&std_trans=standard&chk_metars=on&hoursStr=most+recent+only&chk_tafs=on&submitmet=Submit";
static TCP_MESSAGE MetafData;
USOCKET Metaf_TCP_socket;
static unsigned char ucRemoteIP[IPV4_LENGTH] = {204,227,127,34};

My code first obtains a free socket and then performs a connect to the server. So far it's all working fine.
When the connection is successful, the data that is to be sent is created and sent using fnSendTCP. Tracing the code indicates that the data transmission is successful.

Connecting and sending data...
Code: [Select]
extern void fnMETAF(TTASKTABLE *ptrTaskTable)
{
char printstring[2048];

Metaf_TCP_socket = fnGetTCP_Socket(TOS_MINIMISE_DELAY, TCP_DEFAULT_TIMEOUT, fnMetafListener);
if (Metaf_TCP_socket >= 0)
{
fnTCP_Connect(Metaf_TCP_socket, ucRemoteIP, METAF_TCP_PORT, 0, 0);

strcpy ((char*)MetafData.ucTCP_Message, "POST /metars/index.php HTTP/1.1\r\n");
strcat ((char*)MetafData.ucTCP_Message, "Content-Type: application/x-www-form-urlencoded\r\n");
strcat ((char*)MetafData.ucTCP_Message, "User-Agent: Mozilla/2.0 (compatible; WS4.9e.667)\r\n");
strcat ((char*)MetafData.ucTCP_Message, "Host: adds.aviationweather.gov\r\n");
sprintf (printstring, "Content-Length: %d\r\n", strlen(postData));
strcat ((char*)MetafData.ucTCP_Message, printstring);
strcat ((char*)MetafData.ucTCP_Message, "Cache-Control: no-cache\r\n\r\n");
strcat ((char*)MetafData.ucTCP_Message, postData);

if (fnSendTCP(Metaf_TCP_socket, (unsigned char *)&MetafData, strlen((char*)MetafData.ucTCP_Message), TCP_FLAG_PUSH) > 0)
{
strcpy (printstring, (char*)MetafData.ucTCP_Message);    // just some code to put a breakpoint on
}
}
}

The listener code is never reached. Wireshark doesn't indicate a received packet either.

Listener code...
Code: [Select]
static int fnMetafListener(USOCKET Socket, unsigned char ucEvent, unsigned char *ucIp_Data, unsigned short usPortLen)
{
char printstring[2048];
switch (ucEvent)
{
case TCP_EVENT_ARP_RESOLUTION_FAILED:
break;

case TCP_EVENT_DATA:
// process data
strcpy (printstring, (char*)ucIp_Data);
break;

case TCP_EVENT_CLOSE:
case TCP_EVENT_CLOSED:
case TCP_EVENT_ABORT:                                                // no connection was established
break;
}
return APP_ACCEPT;
}

I have a windows program that sends the same request to the same server and processes the same data. The lines in the trace window that indicate the transmission and reception of the relevant data in Wireshark are all in green. The lines that come from the uTasker are all grey though. Also, the packets that come from the uTasker don't contain the data that I'm trying to send and don't have the PUSH flag set either.

There is obviously something not being done right here. Any help is appreciated!  :)

4
µTasker general / Simulator and host PC with wireless network
« on: October 20, 2009, 07:40:39 PM »
I'm picking up the uTasker again after messing with Interniche/Coldfire Lite for some time.

While playing around with the simulator, I noticed that DHCP does not resolve when the host PC is connected to the network via WLAN. It does work when connected via the wired network interface though. I didn't forget to select the right physical interface in the simulator by the way.

I have noticed this on more than one PC, so it's probably not hardware related. Is this maybe a limitation of a wlan connection?

Pages: [1]