|
本帖最后由 weeksy 于 2018-1-16 12:51 编辑
arduino的库文件展开
#include <Gizwits.h>
void begin(void); //分配内存,初始化接口
void process(void); //处理数据
bool hasBeenSet(EVENT_TYPE_T eventType); //数据相关的事件,是否被触发 返回1触发,返回0,没有触发
bool wifiHasBeenSet(EVENT_TYPE_T eventType); //wifi相关的事件,是否被触发
void setBindMode(uint8_t mode); //设置绑定模式
void read(EVENT_TYPE_T eventType, bool* value); //读取一个 数据点,并保存到一个地址里
void read(EVENT_TYPE_T eventType, uint32_t* value);
void read(EVENT_TYPE_T eventType, int32_t* value);
void read(EVENT_TYPE_T eventType, float* value);
void readBinary(EVENT_TYPE_T eventType, uint8_t* data);
void write(VALUE_TYPE_T valueType, bool value); //向当前数据点 ,写入
void write(VALUE_TYPE_T valueType, uint32_t value);
void write(VALUE_TYPE_T valueType, int32_t value);
void write(VALUE_TYPE_T valueType, float value);
void writeBinary(VALUE_TYPE_T valueType, uint8_t* data,uint32_t dataLen);
#include < gizwits_product.h>
void mcuRestart(void); //重启MCU
int32_t uartWrite(uint8_t *buf, uint32_t len); // Send to wifi module 正确返回len ,错误返回-1
#include < common.h>
typedef void (*gizTimerFunc_t)(void *arg );
uint8_t gizProtocolSum(uint8_t *buf, uint32_t len);
uint16_t exchangeBytes(uint16_t value);
uint32_t exchangeWord(uint32_t value);
int32_t returnWeekDay(uint32_t iYear, uint32_t iMonth, uint32_t iDay);
gizTime_t returnNtp2Wt(uint32_t ntp);
void getOnePasscode(uint8_t *data, uint32_t len);
void str2Hex(char *pbDest, char *pbSrc, int32_t nLen);
void hex2Str(unsigned char *pbDest, unsigned char *pbSrc, int32_t nLen);
uint8_t char2hex(char A , char B);
int8_t checkStringIsNotZero(const char *data);
int8_t checkStringIsZero(const char *data);
#include < dataPointTools.h>
int8_t gizByteOrderExchange(uint8_t *buf,uint32_t dataLen);
uint32_t gizY2X(uint32_t ratio, int32_t addition, int32_t preValue);
int32_t gizX2Y(uint32_t ratio, int32_t addition, uint32_t preValue);
uint32_t gizY2XFloat(float ratio, float addition, float preValue);
float gizX2YFloat(float ratio, float addition, uint32_t preValue);
uint8_t gizAcrossByteJudge(uint32_t bitOffset,uint32_t bitLen);
int32_t gizVarlenCompressValue(uint32_t bitOffset,uint32_t bitLen,uint8_t *bufAddr,uint32_t srcData);
int32_t gizVarlenDecompressionValue(uint32_t bitOffset,uint32_t bitLen,uint8_t *arrayAddr,uint32_t arrayLen);
int32_t gizStandardDecompressionValue(uint32_t byteOffset,uint32_t bitOffset,uint32_t bitLen,uint8_t *arrayAddr,uint32_t arrayLen);
int32_t gizStandardCompressValue(uint32_t byteOffset,uint32_t bitOffset,uint32_t bitLen,uint8_t *bufAddr,uint32_t srcData);
#include < gizwits_protocol.h>
extern uint32_t gizGetTimerCount(void);
void gizwitsInit(void);
int32_t gizwitsSetMode(uint8_t mode);
void gizwitsGetNTP(void);
int32_t gizwitsHandle(dataPoint_t *currentData); // 获取esp8266的数据后的 -> 处理 操控模块 深度解析 模块
int32_t gizwitsPassthroughData(uint8_t * gizdata, uint32_t len);
void gizwitsGetModuleInfo(void);
int32_t gizPutData(uint8_t *buf, uint32_t len); //写入数据到ring buff Write data to the ring buffer
static int8_t gizProtocolHeadInit(protocolHead_t *head)
static int8_t gizProtocolWaitAck(uint8_t *gizdata, uint32_t len)
static int8_t ICACHE_FLASH_ATTR gizDataPoint2Event(gizwitsIssued_t *issuedData, eventInfo_t *info, dataPoint_t *dataPoints)
static int8_t ICACHE_FLASH_ATTR gizCheckReport(dataPoint_t *cur, dataPoint_t *last)
static int8_t ICACHE_FLASH_ATTR gizDataPoints2ReportData(dataPoint_t *dataPoints , devStatus_t *devStatusPtr)
static int8_t gizProtocolIssuedProcess(char *did, uint8_t *inData, uint32_t inLen, uint8_t *outData, uint32_t *outLen)
static int32_t gizProtocolIssuedDataAck(protocolHead_t *head, uint8_t *gizdata, uint32_t len, uint8_t proFlag)
static int32_t gizReportData(uint8_t action, uint8_t *gizdata, uint32_t len)
static void gizDevReportPolicy(dataPoint_t *currentData)
static int8_t gizProtocolGetOnePacket(rb_t *rb, uint8_t *gizdata, uint16_t *len)
static void gizProtocolResendData(void)
static int8_t gizProtocolWaitAckCheck(protocolHead_t *head)
static int32_t gizProtocolCommonAck(protocolHead_t *head)
static void gizProtocolAckHandle(void)
static int32_t gizProtocolGetDeviceInfo(protocolHead_t * head)
static int32_t gizProtocolErrorCmd(protocolHead_t *head,errorPacketsType_t errno)
static int8_t gizProtocolNTP(protocolHead_t *head)
static void gizProtocolReboot(void)
static int8_t gizProtocolModuleStatus(protocolWifiStatus_t *status)
static int8_t gizProtocolModuleInfoHandle(protocolHead_t *head)
#include <ringBuffer.h>
int8_t rbCreate(rb_t* rb);
int8_t rbDelete(rb_t* rb);
int32_t rbCapacity(rb_t *rb);
int32_t rbCanRead(rb_t *rb);
int32_t rbCanWrite(rb_t *rb);
int32_t rbRead(rb_t *rb, void *data, size_t count);
int32_t rbWrite(rb_t *rb, const void *data, size_t count);
|
|