protocol.c File Reference

Implementation of the command protocol between the board and the host. More...

#include "protocol.h"
#include "cmd_ctor.h"
#include "verstag.h"
#include "hw/hw_adc.h"
#include "hw/hw_input.h"
#include <drv/timer.h>
#include <drv/ser.h>
#include <drv/sipo.h>
#include <drv/wdt.h>
#include <drv/buzzer.h>
#include <mware/readline.h>
#include <mware/parser.h>
#include <cfg/compiler.h>
#include <cfg/debug.h>
#include <kern/kfile.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.


Functions

void NAK (KFile *fd, const char *err)
 Send a NAK asking the host to send the current message again.
void protocol_run (KFile *fd)

Variables

static bool interactive
 True if we are in interactive mode, false if we are in protocol mode.
static struct RLContext rl_ctx
 Readline context, used for interactive mode.

Detailed Description

Implementation of the command protocol between the board and the host.

Version:
Id
protocol.c 1532 2008-08-04 07:21:26Z bernie

Author:
Giovanni Bajo <rasky@develer.com>

Marco Benelli <marco@develer.com>

Bernie Innocenti <bernie@codewiz.org>

Daniele Basile <asterix@develer.com>

Definition in file protocol.c.


Function Documentation

void NAK ( KFile fd,
const char *  err 
) [inline]

Send a NAK asking the host to send the current message again.

fd kfile handler for serial. err human-readable description of the error for debug purposes.

Definition at line 93 of file protocol.c.

void protocol_run ( KFile fd  ) 

Definition at line 174 of file protocol.c.


Variable Documentation

bool interactive [static]

True if we are in interactive mode, false if we are in protocol mode.

In interactive mode, commands are read through readline() (prompt, completion, history) without IDs, and replies/errors are sent to the serial output. In protocol mode, we implement the default protocol

Definition at line 81 of file protocol.c.