How to Proceed with Firmware, Software, and Web Control using XML
I've been approached about utilizing XML to help "tie together" several currently dissociated tasks. Coming from an almost totally .NET/C++ background, I'm having trouble getting a bearing on which way to proceed. My situation is this:
We have a piece of hardware for which we use an array of C structs (table?) to perform the hardware configuration at startup and as new parameters are received via any remote interface. This table is a clunky old dinosaur, but the larger problem is that we also have a web co开发者_开发知识库ntrol that provides a hardware interface via web browser, and a .NET application run on our workstations, that functions in much the same way (but over Ethernet or Serial), but based on a separate configuration file that it parses at runtime.
So, we have three different ways to alter the configuration of the hardware, each of which is configured separately instead of from a common configuration source located in the hardware. I started putting some basic XML together over the weekend, just trying to wrap my head around what the advantage could be, but my lack of experience with XML makes it hard to grasp the benefits. A snippet of code is below:
<unit type="6850">
<command name="General Version">
<category>General</category>
<command>GVR</command>
<description>Get Version</description>
<type>Status</type>
<args count="0"/>
</command>
<command name="General Echo">
<category>General</category>
<command>GEC</command>
<description>Control Interface Echo</description>
<type>On/Off</type>
<args count="2">
<Off>0</Off>
<On>1</On>
</args>
</command>
...
So, I'm sure that makes you more experienced XML guys scream in anguish and I'm sorry about that. What I'm trying to do is populate the web interface, the .NET control, and the direct-connect configuration parameters from a common location in the hardware, probably device EEPROM, on startup and as requested. I realize that parsing within the firmware will have to be done in-house via proprietary means (unless there's an XML stack available for our control processor), but is there a particular extension or derived language that I should lean toward to help generate the web control interface smoothly?
The idea for the .NET control software would be a query to the device on startup that would return the firmware's current configuration as XML and then use that XML to populate a Windows form for use as a control interface.
We've got a command interface description document, but otherwise have the opportunity to work from the ground up and it'll make my life easier if someone with more experience in XML could give me an idea if this is even something that COULD be done with XML.
If the question is too vague or long, please let me know and I'll attempt to abbreviate the situation and needs, or expand where necessary.
Thanks.
精彩评论