robot

Dependencies:   FastPWM3 mbed

CommandProcessor/CommandProcessor.h

Committer:
bwang
Date:
2018-11-13
Revision:
252:38644631ed97
Parent:
247:da647f7185b7

File content as of revision 252:38644631ed97:

#ifndef __COMMAND_PROCESSOR_H
#define __COMMAND_PROCESSOR_H

#include "mbed.h"
#include "PreferenceWriter.h"

void processCmd(Serial *pc, PreferenceWriter *pref, char *buf);
void processCmdFast(Serial *pc, PreferenceWriter *pref, char *buf);

/*---variable loading, setting, and flashing---*/
void cmd_ls(Serial *pc);
void cmd_ls2(Serial *pc, char *buf);
void cmd_set(Serial *pc, char *buf, char *val);
void cmd_defaults(Serial *pc);
void cmd_reload(Serial *pc, PreferenceWriter *pref);
void cmd_flush(Serial *pc, PreferenceWriter *pref);
void cmd_query(Serial *pc, char *buf);

/*---mode switching---*/
void cmd_setp(Serial *pc, char *buf);
void cmd_mode(Serial *pc, char *buf);
void cmd_src(Serial *pc, char *buf);
void cmd_op(Serial *pc, char *buf);

/*---variable commands---*/
void cmd_exit(Serial *pc);

/*---system commands---*/
void cmd_clear(Serial *pc);

/*---fast path commands---*/
void cmdf_w(Serial *pc);
void cmdf_data(Serial *pc);
void cmdf_setp(Serial *pc, char c);

/*---internal functions---*/
int tokenize(char *buf, char **out, int max);
float *checkf(char *s);
int *checkn(char *s);
char *mode_to_str(int n);
int str_to_mode(char *buf);
char *src_to_str(int n);
int str_to_src(char *buf);
char *op_to_str(int n);
int str_to_op(char *buf);

#endif