📄 simple_proto.c
字号:
// This file is part of MANTIS OS, Operating System// See http://mantis.cs.colorado.edu///// Copyright (C) 2003,2004,2005 University of Colorado, Boulder//// This program is free software; you can redistribute it and/or// modify it under the terms of the mos license (see file LICENSE)/**************************************************************************//* File: simple_proto.c *//* Author: Carl Hartunge : carl.hartung@colorado.edu *//* Date: 11/12/04 *//* *//* Simple protocol example *//**************************************************************************//** @file simple_proto.c * @brief Simple protocol example * @author Carl Hartung * @date Created: 11/12/2004 */#include <stdlib.h>#include <string.h>#include "led.h"#include "node_id.h"#include "mutex.h"#include "simple_proto.h"void simple_proto_init(){ /* must be called by all protocols */ net_proto_register(SIMPLE_PROTO_ID, simple_proto_send, simple_proto_recv, simple_proto_ioctl);}int8_t simple_proto_send(comBuf *pkt, va_list args){ return 0;}boolean simple_proto_recv(comBuf *pkt, uint8_t **footer, uint8_t port){ /* must be called if the protocol wants to try to send the packet to the app */ return is_app_waiting_on(port);}int8_t simple_proto_ioctl(uint8_t request, va_list args){ return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -