MK3EBPerlAPI

From EvTechWiki

Jump to: navigation, search

Contents

Perl API

What is it?

In order for code to communicate with the BMS network, and be somewhat reusable, there must be a layer of abstraction between the network and the code in question. This is also needed to preserve the sanity of the programmer.

In the case of the master computer for QM, this code is written in the ever popular perl.

The Perl API is designed to do all the heavy lifting of communicating with a network full of MK3EB nodes, leaving the programmer free to do things like invent nifty algorythms for charging the batteries. It of course doesn't achive this, at least not yet, but that's still the goal.

What's in it?

Modules that wish to talk to the MK3EB network are dropped in the appropriate directory on the master computer, which scans through them when it boots. These modules are issued callbacks under appropriate circumstances.

The Perl API provides for the following services:

  • ) Scheduling access to the MK3EB network (see MK3EBPlSchedular).
  • ) Building a request (see MK3EBPlMessage)
  • ) Sending a request on the MK3EB network (see MK3EBPlSerio).
  • ) Low level packet manipulation (see MK3EBPlPacket).
  • ) All neccesary error code wrapping, using the best abilities of each module
  • ) Receiving data from the MK3EB network, including responses from requests posted by other modules as well as the module in question - filtered using simple rules.

Where's it live?

The production version would live in [1] if it existed. The files it is being built out of live in [2].

Where's the documentation?

Documentation for perl api
ebpacket Packet maniuplation class
ebflags Definitions of network flags
ebcmd EB commands class, used for subpacketing and packet sniffer
sim Simulation class, used to transfer data between the perl API and the unix C code

Testing

I'm in the process of writing a complete test case for everything as well..

Personal tools