Subject:
|
Very preliminary Seance API spec
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Mon, 22 Nov 1999 20:57:14 GMT
|
Original-From:
|
Brian Connors <CONNORBD@YAHOO.spamlessCOM>
|
Viewed:
|
771 times
|
| |
| |
This is the preliminary API spec for Seance, such as
it is. Anybody got something that should be added
and/or suggestions on how to make this more useful?
/Brian
------
Seance API Specification for Lego Mindstorms
--------------------------------------------
Brian Connors
connorbd@yahoo.com
22 November 1999
Version 0.1
1 Introduction
This is a preliminary form of the specification for
the Seance communications API for Lego Mindstorms.
Seance is a platform-independent interface for a
low-level comm driver for the Lego RCX
microcontroller, and is based on Kekoa Proudfoot's
send.c code for directly interfacing with the RCX on
the bytecode level. Seance is part of Project Spectre,
an attempt to create a freely redistributable,
platform independent implementation of the spirit.ocx
API for Win32.
Unless otherwise stated, the function prototypes
within are derived directly from send.c, since Seance
was constructed by factoring out the interactive
send/recieve code from this program.
2 Functions
Function names are based on their names in send.c with
an se_ prefix (as opposed to Spectre functions which
will have sp_ prefixes, as well as VBish aliases).
int se_rcxinit(char *tty)
se_rcxinit() is the low-level interface for the
Spectre/spirit.ocx InitComm() function. It sets up the
RCX for communication. The return value is a Unix file
descriptor.
int se_rcxclose(int fd)
se_rcxinit() takes as an argument a Unix file
descriptor and closes the RCX channel that it
describes; it is the Seance interface for CloseComm().
Unlike rcx_close() from send.c, it returns a non-zero
value if there's no channel to close.
int se_rcxsend(int fd, unsigned char *sbuf, int slen,
unsigned char *rbuf, int rlen)
se_rcxsend() sends the data in sbuf, then stores the
reply in rbuf. (I haven't quite figured out what it
returns (a variable called rpos; I think it's the
length of the return buffer) -- Kekoa? Anybody?)
3 Constants
BUFFERSIZE
The maximum amount of space that a Seance session is
capable of sending or recieving. Default is 4096.
RETRIES
The maximum number of attempts that Seance will make
before giving up. Default is 5.
DEFAULTTTY
A platform-appropriate representation of the
connection. (May not be appropriate for a non-Unix
setting -- check this)
=====
--
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|