/* * TOPPERS ECHONET Lite Communication Middleware * * Copyright (C) 2017 Cores Co., Ltd. Japan * * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改 * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する. * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー * スコード中に含まれていること. * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 * の無保証規定を掲載すること. * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ * と. * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 * 作権表示,この利用条件および下記の無保証規定を掲載すること. * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに * 報告すること. * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理 * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを * 免責すること. * * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的 * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ * の責任を負わない. * * @(#) $Id: shellif.c 286 2017-05-02 15:25:33Z coas-nagasima $ */ #include #include #include #include "../../../musl-1.1.12/include/poll.h" #include "analogin_api.h" #include "gpio_api.h" #include "i2c_api.h" #include "pwmout_api.h" #include "rtc_api.h" #include "serial_api.h" #include "us_ticker_api.h" #include "wait_api.h" #include "usrcmd.h" #include "ff.h" #include #include "socket_stub.h" void shellif_into(); void shellif_outof(); void __exp_analogin_init(analogin_t *obj, PinName pin) { shellif_into(); analogin_init(obj, pin); shellif_outof(); } uint16_t __exp_analogin_read_u16(analogin_t *obj) { uint16_t result; shellif_into(); result = analogin_read_u16(obj); shellif_outof(); return result; } void __exp_gpio_init(gpio_t *obj, PinName pin) { shellif_into(); gpio_init(obj, pin); shellif_outof(); } void __exp_gpio_dir(gpio_t *obj, PinDirection direction) { shellif_into(); gpio_dir(obj, direction); shellif_outof(); } int __exp_i2c_start(i2c_t *obj) { int result; shellif_into(); result = i2c_start(obj); shellif_outof(); return result; } int __exp_i2c_stop(i2c_t *obj) { int result; shellif_into(); result = i2c_stop(obj); shellif_outof(); return result; } void __exp_i2c_init(i2c_t *obj, PinName sda, PinName scl) { shellif_into(); i2c_init(obj, sda, scl); shellif_outof(); } int __exp_i2c_read(i2c_t *obj, int address, char *data, int length, int stop) { int result; shellif_into(); result = i2c_read(obj, address, data, length, stop); shellif_outof(); return result; } int __exp_i2c_write(i2c_t *obj, int address, const char *data, int length, int stop) { int result; shellif_into(); result = i2c_write(obj, address, data, length, stop); shellif_outof(); return result; } int __exp_i2c_byte_read(i2c_t *obj, int last) { int result; shellif_into(); result = i2c_byte_read(obj, last); shellif_outof(); return result; } int __exp_i2c_byte_write(i2c_t *obj, int data) { int result; shellif_into(); result = i2c_byte_write(obj, data); shellif_outof(); return result; } void __exp_pwmout_free(pwmout_t* obj) { shellif_into(); pwmout_free(obj); shellif_outof(); } void __exp_pwmout_init(pwmout_t* obj, PinName pin) { shellif_into(); pwmout_init(obj, pin); shellif_outof(); } void __exp_pwmout_pulsewidth_us(pwmout_t* obj, int us) { shellif_into(); pwmout_pulsewidth_us(obj, us); shellif_outof(); } void __exp_rtc_init(void) { shellif_into(); rtc_init(); shellif_outof(); } void __exp_rtc_free(void) { shellif_into(); rtc_free(); shellif_outof(); } int __exp_rtc_isenabled(void) { int result; shellif_into(); result = rtc_isenabled(); shellif_outof(); return result; } time_t __exp_rtc_read(void) { time_t result; shellif_into(); result = rtc_read(); shellif_outof(); return result; } void __exp_rtc_write(time_t t) { shellif_into(); rtc_write(t); shellif_outof(); } void __exp_serial_baud(serial_t *obj, int baudrate) { shellif_into(); serial_baud(obj, baudrate); shellif_outof(); } void __exp_serial_init(serial_t *obj, PinName tx, PinName rx) { shellif_into(); serial_init(obj, tx, rx); shellif_outof(); } int __exp_serial_readable(serial_t *obj) { int result; shellif_into(); result = serial_readable(obj); shellif_outof(); return result; } int __exp_serial_getc(serial_t *obj) { int result; shellif_into(); result = serial_getc(obj); shellif_outof(); return result; } void __exp_serial_putc(serial_t *obj, int c) { shellif_into(); serial_putc(obj, c); shellif_outof(); } uint32_t __exp_us_ticker_read(void) { int result; shellif_into(); result = us_ticker_read(); shellif_outof(); return result; } void __exp_wait_ms(int ms) { shellif_into(); wait_ms(ms); shellif_outof(); } bool __exp_SD_begin() { bool result; shellif_into(); result = SD_begin(); shellif_outof(); return result; } int __exp_usrcmd_cd(int argc, char **argv) { int result; shellif_into(); result = usrcmd_cd(argc, argv); shellif_outof(); return result; } int __exp_usrcmd_ls(int argc, char **argv) { int result; shellif_into(); result = usrcmd_ls(argc, argv); shellif_outof(); return result; } int __exp_usrcmd_cp(int argc, char **argv) { int result; shellif_into(); result = usrcmd_cp(argc, argv); shellif_outof(); return result; } int __exp_usrcmd_rm(int argc, char **argv) { int result; shellif_into(); result = usrcmd_rm(argc, argv); shellif_outof(); return result; } int __exp_usrcmd_mv(int argc, char **argv) { int result; shellif_into(); result = usrcmd_mv(argc, argv); shellif_outof(); return result; } int __exp_usrcmd_mkdir(int argc, char **argv) { int result; shellif_into(); result = usrcmd_mkdir(argc, argv); shellif_outof(); return result; } int __exp_usrcmd_hexdump(int argc, char **argv) { int result; shellif_into(); result = usrcmd_hexdump(argc, argv); shellif_outof(); return result; } int __exp_usrcmd_info(int argc, char **argv) { int result; shellif_into(); result = usrcmd_info(argc, argv); shellif_outof(); return result; } int __exp_usrcmd_exit(int argc, char **argv) { int result; shellif_into(); result = usrcmd_exit(argc, argv); shellif_outof(); return result; } void __exp_shell_abort() { shellif_into(); shell_abort(); shellif_outof(); } void __exp_shell_exit(int exitcd) { shellif_into(); shell_exit(exitcd); shellif_outof(); } int __exp_shell_kill(int pid, int sig) { int result; shellif_into(); result = shell_kill(pid, sig); shellif_outof(); return result; } int __exp_shell_gettimeofday(struct timeval * tp, void * tzvp) { int result; shellif_into(); result = shell_gettimeofday(tp, tzvp); shellif_outof(); return result; } void __exp_vsyslog(int priority, const char *format, va_list ap) { shellif_into(); vsyslog(priority, format, ap); shellif_outof(); } int __exp_shell_open(const char * path, int flags) { int result; shellif_into(); result = shell_open(path, flags); shellif_outof(); return result; } int __exp_shell_close(int fd) { int result; shellif_into(); result = shell_close(fd); shellif_outof(); return result; } int __exp_shell_read(int fd, char *data, int len) { int result; shellif_into(); result = shell_read(fd, data, len); shellif_outof(); return result; } int __exp_shell_write(int fd, char *data, int len) { int result; shellif_into(); result = shell_write(fd, data, len); shellif_outof(); return result; } int __exp_shell_lseek(int fd, int ptr, int dir) { int result; shellif_into(); result = shell_lseek(fd, ptr, dir); shellif_outof(); return result; } int __exp_shell_fstat(int fd, struct stat * st) { int result; shellif_into(); result = shell_fstat(fd, st); shellif_outof(); return result; } int __exp_shell_stat(const char *fname, struct stat *st) { int result; shellif_into(); result = shell_stat(fname, st); shellif_outof(); return result; } int __exp_shell_link(void) { int result; shellif_into(); result = shell_link(); shellif_outof(); return result; } int __exp_shell_unlink(const char *path) { int result; shellif_into(); result = shell_unlink(path); shellif_outof(); return result; } int __exp_shell_isatty(int fd) { int result; shellif_into(); result = shell_isatty(fd); shellif_outof(); return result; } int __exp_fsync(int fd) { int result; shellif_into(); result = fsync(fd); shellif_outof(); return result; } int __exp_ftruncate(int fd, off_t length) { int result; shellif_into(); result = ftruncate(fd, length); shellif_outof(); return result; } int __exp_ioctl(int fd, int request, va_list ap) { int result; shellif_into(); result = ioctl(fd, request, ap); shellif_outof(); return result; } int __exp_tcgetattr(int fd, struct termios *termios_p) { int result; shellif_into(); result = tcgetattr(fd, termios_p); shellif_outof(); return result; } int __exp_tcsetattr(int fd, int optional_actions, const struct termios *termios_p) { int result; shellif_into(); result = tcsetattr(fd, optional_actions, termios_p); shellif_outof(); return result; } int __exp_shell_rename(const char *oldpath, const char *newpath) { int result; shellif_into(); result = shell_rename(oldpath, newpath); shellif_outof(); return result; } int __exp_rmdir(const char *path) { int result; shellif_into(); result = rmdir(path); shellif_outof(); return result; } int __exp_mkdir(const char *path, mode_t mode) { int result; shellif_into(); result = mkdir(path, mode); shellif_outof(); return result; } int __exp_chmod(const char *path, mode_t mode) { int result; shellif_into(); result = chmod(path, mode); shellif_outof(); return result; } char *__exp_getcwd(char *buf, size_t size) { char *result; shellif_into(); result = getcwd(buf, size); shellif_outof(); return result; } int __exp_chdir(const char *path) { int result; shellif_into(); result = chdir(path); shellif_outof(); return result; } int __exp_chroot(const char *path) { int result; shellif_into(); result = chroot(path); shellif_outof(); return result; } int __exp_closedir(DIR *dir) { int result; shellif_into(); result = closedir(dir); shellif_outof(); return result; } DIR *__exp_opendir(const char *path) { DIR *result; shellif_into(); result = opendir(path); shellif_outof(); return result; } struct dirent *__exp_readdir(DIR *dir) { struct dirent *result; shellif_into(); result = readdir(dir); shellif_outof(); return result; } void __exp_rewinddir(DIR *dir) { shellif_into(); rewinddir(dir); shellif_outof(); } void __exp_seekdir(DIR *dir, long pos) { shellif_into(); seekdir(dir, pos); shellif_outof(); } long __exp_telldir(DIR *dir) { long result; shellif_into(); result = telldir(dir); shellif_outof(); return result; } int __exp_shell_getpid() { int result; shellif_into(); result = shell_getpid(); shellif_outof(); return result; } int __exp_socket(int family, int type, int protocol) { int result; shellif_into(); result = socket(family, type, protocol); shellif_outof(); return result; } int __exp_bind(int fd, const struct sockaddr *addr, socklen_t len) { int result; shellif_into(); result = bind(fd, addr, len); shellif_outof(); return result; } int __exp_listen(int fd, int backlog) { int result; shellif_into(); result = listen(fd, backlog); shellif_outof(); return result; } int __exp_connect(int fd, const struct sockaddr *addr, socklen_t len) { int result; shellif_into(); result = connect(fd, addr, len); shellif_outof(); return result; } int __exp_accept(int fd, struct sockaddr *addr, socklen_t *len) { int result; shellif_into(); result = accept(fd, addr, len); shellif_outof(); return result; } ssize_t __exp_send(int fd, const void *buf, size_t len, int flags) { ssize_t result; shellif_into(); result = send(fd, buf, len, flags); shellif_outof(); return result; } ssize_t __exp_sendto(int fd, const void *buf, size_t len, int flags, const struct sockaddr *addr, socklen_t alen) { ssize_t result; shellif_into(); result = sendto(fd, buf, len, flags, addr, alen); shellif_outof(); return result; } ssize_t __exp_recv(int fd, void *buf, size_t len, int flags) { ssize_t result; shellif_into(); result = recv(fd, buf, len, flags); shellif_outof(); return result; } ssize_t __exp_recvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t *alen) { ssize_t result; shellif_into(); result = recvfrom(fd, buf, len, flags, addr, alen); shellif_outof(); return result; } int __exp_shutdown(int fd, int how) { int result; shellif_into(); result = shutdown(fd, how); shellif_outof(); return result; } int __exp_getsockopt(int fd, int level, int optname, void *optval, socklen_t *optlen) { int result; shellif_into(); result = getsockopt(fd, level, optname, optval, optlen); shellif_outof(); return result; } int __exp_setsockopt(int fd, int level, int optname, const void *optval, socklen_t optlen) { int result; shellif_into(); result = setsockopt(fd, level, optname, optval, optlen); shellif_outof(); return result; } int __exp_select(int n, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tv) { int result; shellif_into(); result = select(n, rfds, wfds, efds, tv); shellif_outof(); return result; } int __exp_poll(struct pollfd *fds, nfds_t nfds, int timeout) { int result; shellif_into(); result = poll(fds, nfds, timeout); shellif_outof(); return result; } int __exp_gethostname(char *name, size_t len) { int result; shellif_into(); result = gethostname(name, len); shellif_outof(); return result; } int __exp_getnameinfo(const struct sockaddr *sa, socklen_t sl, char *node, socklen_t nodelen, char *serv, socklen_t servlen, int flags) { int result; shellif_into(); shell_abort(); result = 0; shellif_outof(); return result; } int __exp_getpeername(int fd, struct sockaddr *addr, socklen_t *len) { int result; shellif_into(); shell_abort(); result = 0; shellif_outof(); return result; } int __exp_getsockname(int fd, struct sockaddr *addr, socklen_t *len) { int result; shellif_into(); shell_abort(); result = 0; shellif_outof(); return result; } int __exp_socketpair(int family, int type, int protocol, int fd[2]) { int result; shellif_into(); shell_abort(); result = 0; shellif_outof(); return result; }