View previous topic :: View next topic |
Author |
Message |
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
CCS/MCHP TCP/IP daemon that handles multiple sockets |
Posted: Thu Sep 03, 2009 4:16 pm |
|
|
I'm writing an app for tcp/ip that will (hopefully) have a single daemon handling multiple duplicate hardware devices hooked to a single PIC18F97J60 in extended bus mode (cool)...
The intent is to have 8 sockets that communicate with the devices and I'd like to have a single set of routines that handle this.
The current method I've see with MCHP's examples is that a single task is a single daemon which is a single port.
So not being in the land of bigger OS's, I thought I would ask the advanced crew here how they may have accomplished this in the past.
(in verilog this would be EASY! INSTANTIATE! INSTANTIATE! INSTANTIATE! hahaha.. but this is not verilog.)
The device on the bus is a single octal UART and I've already written the code to handle the FIFO's and interrupt servicing and so on (and it works. OMG)
Now I just need to write the daemon to allow a TCP connection to jump into the serial flow (one socket per UART channel) and go.
My ports are fixed at something like 1001, 1002, 1003.... 1008
Thanks in advance!
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Fri Sep 04, 2009 8:09 pm |
|
|
Well, I can see people have read this -- but did I scare everyone off?
So far, I think I have a solution for doing the multiple socket support -- but I'd still love to hear thoughts from others on how they may have accomplished this.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Wed Sep 09, 2009 11:14 pm |
|
|
For those interested,
It's as easy as setting up an array and then working through the number of ports and giving (in my case) each port its own socket.
So far, it's been working out quite nicely.
I have to give credit for the MCHP TCP/IP Stack conversion done by CCS. While it's probably not perfect ( I don't have any complaints yet ) -- I got it working on a PICDEM.net2 in a matter of a couple of hours... and my new code is flowing nicely.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
|