/*********************************************************************************
|
* Copyright: (C) 2018 LingYun IoT System Studio
|
* All rights reserved.
|
*
|
* Filename: tlv.h
|
* Description: This file is TLV(Tag Length Value) protocal head file
|
*
|
* Version: 1.0.0(2018/10/14)
|
* Author: Guo Wenxue <guowenxue@gmail.com>
|
* ChangeLog: 1, Release initial version on "2018/10/14 12:13:26"
|
*
|
********************************************************************************/
|
|
#ifndef __TLV_H_
|
#define __TLV_H_
|
|
|
/*+-----------------------------------------------+
|
*| TLV Format: Tag(1B) Length(1B) Value(2B) |
|
*+-----------------------------------------------+*/
|
|
|
/*TLV Format Tag definition */
|
enum
|
{
|
TAG_TEMP = 1, /* Temperature */
|
TAG_HUMI, /* Relative Humidity */
|
TAG_DOOR, /* Door open status */
|
|
TAG_NAK=0xFD, /* NAK packet */
|
TAG_ACK=0xFE, /* ACK packet */
|
};
|
|
void tlv_dump_buf(const char *prompt, char *buf, int size);
|
|
int tlv_pack_ack(char *buf, int size);
|
|
int tlv_pack_nak(char *buf, int size);
|
|
|
#endif
|