esp8266-std/include/ne_device.h

39 lines
889 B
C

/*
* ne_device.h -- provide iot-system device layer operation interface.
*
*
* ORIGINAL AUTHOR:
*
* Copyright (c) 2018 Netease Corporation
*/
#ifndef NE_DEVICE_H
#define NE_DEVICE_H
#include "c_types.h"
#define NE_DEVICE_BUF_SIZE 900
typedef struct ne_device_msgtype{
uint8* data;
uint32 len;
uint8 msg_dir;
} ne_device_msgtype_t;
typedef struct ne_device_handler{
int32 (* device_init)(void *arg);
int32 (* device_deinit)(void *arg);
int32 (* device_read)(void *arg, uint8 **input, uint32 *len);
int32 (* device_write)(void *arg, uint8 *input, uint32 len);
int32 (* device_parse)(void *arg, uint8 type, uint8 *input, uint32 ilen, uint8 *output, uint32 maxlen);
int32 (* device_split)(void *arg, uint32 *offset, uint8 *input, uint32 len, uint8 *output, uint32 *output_len);
}ne_device_handler_t;
#endif