Files
kunlun/app/utils/iot_app_meta_api.h
2024-09-28 14:24:04 +08:00

74 lines
2.4 KiB
C
Executable File

/****************************************************************************
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
be copied by any method or incorporated into another program without
the express written consent of Aerospace C.Power. This Information or any portion
thereof remains the property of Aerospace C.Power. The Information contained herein
is believed to be accurate and Aerospace C.Power assumes no responsibility or
liability for its use in any way and conveys no license or title under
any patent or copyright and makes no representation or warranty that this
Information is free from patent or copyright infringement.
****************************************************************************/
#ifndef _IOT_APP_META_API_H_
#define _IOT_APP_META_API_H_
/* pack for the structures in the whole file */
#pragma pack(push) // save the pack status
#pragma pack(1) // 1 byte align
typedef struct _iot_meta_info_t
{
/* Aerospace C.Power */
uint32_t magic;
/* meta data used length */
uint16_t used_len;
/* source mac, send from */
uint8_t src_mac[IOT_MAC_ADDR_LEN];
} iot_meta_info_t;
#pragma pack(pop) /* restore the pack status */
/**
* @brief iot_meta_make_query_cmd() - pack query cmd to buffer,called by api
* @param id_group:id group
* @param id:point to the cmd id
* @return: ERR_OK, or error reason
*/
uint8_t iot_meta_make_query_cmd(uint16_t id_group, uint16_t id);
/**
* @brief iot_meta_rcd_app_msdu_info() - record app msdu info
* @param msdu: msdu info
* @param conn_type: msdu type
* @return: recd index
*/
uint8_t iot_meta_rcd_app_msdu_info(iot_plc_msdu_recv_t *msdu, uint8_t conn_type);
/**
* @brief iot_plc_add_meta_info() - add meta info
* @param msdu_pkt: point to msdu pkt
* @param meta_len: the meta length can add meta data.
*/
void iot_plc_add_meta_info(iot_pkt_t *msdu_pkt, uint16_t meta_len);
/**
* @brief iot_check_meta_data() - recv plc msdu, check meta info
* @param msdu_pkt: point to msdu pkt, msdu len need change if include
* meta info
*/
void iot_check_meta_data(iot_pkt_t *msdu_pkt);
/**
* @brief iot_meta_init() - init meta
* @param app_id: app index
* @param module_id: app module index
*/
void iot_meta_init(uint8_t app_id, uint16_t module_id);
#endif /* _IOT_APP_META_API_H_ */