123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- /**
- * \file MS_ltrn_api.h
- *
- * \brief This file defines the Mesh Lower Transport Application Interface - includes
- * Data Structures and Methods.
- */
- /*
- * Copyright (C) 2017. Mindtree Ltd.
- * All rights reserved.
- */
- #ifndef _H_MS_LTRN_API_
- #define _H_MS_LTRN_API_
- /* --------------------------------------------- Header File Inclusion */
- /* Network API Header File */
- #include "MS_net_api.h"
- /* --------------------------------------------- Global Definitions */
- /**
- * \defgroup ltrn_module LTRANSPORT (Mesh Lower Transport Layer)
- * \{
- * This section describes the interfaces & APIs offered by the EtherMind
- * Mesh Lower Transport (LTRANSPORT) module to the Application and other upper
- * layers of the stack.
- */
- /**
- * \defgroup ltrn_defines Defines
- * \{
- * Describes defines for the module.
- */
- /**
- * \defgroup ltrn_constants Constants
- * \{
- * Describes Constants defined by the module.
- */
- /** Unsgemented Access Message */
- #define MS_UNSEGMENTED_ACCESS_MSG 0x00
- /** Segmented Access Message */
- #define MS_SEGMENTED_ACCESS_MSG 0x01
- /** Unsegmented Control Message */
- #define MS_UNSEGMENTED_CTRL_MSG 0x02
- /** Segmented Control Message */
- #define MS_SEGMENTED_CTRL_MSG 0x03
- /** Transport Message Type */
- typedef UCHAR MS_TRN_MSG_TYPE;
- /** Transport Layer Control Packet */
- #define MS_TRN_CTRL_PKT 0x01
- /** Access Layer Packet */
- #define MS_TRN_ACCESS_PKT 0x00
- /** \} */
- /**
- * \defgroup ltrn_events Events
- * \{
- * This section lists the Asynchronous Events notified to Application by the
- * Module.
- */
- /** \} */
- /** \} */
- /**
- * \defgroup ltrn_marcos Utility Macros
- * \{
- * Initialization and other Utility Macros offered by the module.
- */
- /** \} */
- /* --------------------------------------------- Data Types/ Structures */
- /**
- * \addtogroup ltrn_defines Defines
- * \{
- */
- /**
- * \addtogroup ltrn_structures Structures
- * \{
- */
- /** LPN Handle */
- typedef UINT8 LPN_HANDLE;
- /** \} */
- /** \} */
- /**
- * \defgroup ltrn_cb Application Callback
- * \{
- * This Section Describes the module Notification Callback interface offered
- * to the application
- */
- /**
- * Lower TRANSPORT Application Asynchronous Notification Callback.
- *
- * Lower TRANSPORT calls the registered callback to indicate events occurred to the
- * application.
- *
- * \param net_hdr Network Header.
- * \param subnet_handle Associated Subnet Handle.
- * \param data_param Data associated with the event if any or NULL.
- * \param data_len Size of the event data. 0 if event data is NULL.
- */
- typedef API_RESULT (*LTRN_NTF_CB)
- (
- MS_NET_HEADER * net_hdr,
- MS_SUBNET_HANDLE subnet_handle,
- UCHAR szmic,
- UCHAR * data_param,
- UINT16 data_len
- ) DECL_REENTRANT;
- /** \} */
- /**
- * \addtogroup ltrn_defines Defines
- * \{
- */
- /**
- * \addtogroup ltrn_structures Structures
- * \{
- */
- /** \} */
- /** \} */
- /** TCF (Transport Control Field) - Transport Field Value */
- /* --------------------------------------------- Function */
- /**
- * \defgroup ltrn_api_defs API Definitions
- * \{
- * This section describes the EtherMind Mesh Lower Transport Layer APIs.
- */
- #ifdef __cplusplus
- extern "C" {
- #endif
- /**
- * \brief Register Inerface with Lower Transport Layer
- *
- * \par Description
- * This routine registers interface with the Lower Transport Layer.
- * Transport Layer supports single Application, hence this rouine shall be called once.
- *
- * \param [in] ltrn_cb
- * Upper Layer Notification Callback
- *
- * \return API_SUCCESS or an error code indicating reason for failure
- */
- API_RESULT MS_ltrn_register
- (
- /* IN */ LTRN_NTF_CB ltrn_cb
- );
- /**
- * \brief API to send transport PDUs
- *
- * \par Description
- * This routine sends transport PDUs to peer device.
- *
- * \param [in] src_addr
- * Source Address
- *
- * \param [in] dst_addr
- * Destination Address
- *
- * \param [in] subnet_handle
- * Handle identifying the Subnet
- *
- * \param [in] msg_type
- * Transport Message Type
- *
- * \param [in] ttl
- * Time to Live
- *
- * \param [in] akf
- * Application Key Flag
- *
- * \param [in] aid
- * Application Key Identifier
- *
- * \param [in] seq_num
- * Sequence Number to be used for the Packet
- *
- * \param [in] buffer
- * Transport Packet
- *
- * \param [in] buffer_len
- * Transport Packet Length
- *
- * \param [in] reliable
- * If requires lower transport Ack, set reliable as TRUE
- *
- * \return API_SUCCESS or an error code indicating reason for failure
- */
- API_RESULT MS_ltrn_send_pdu
- (
- /* IN */ MS_NET_ADDR src_addr,
- /* IN */ MS_NET_ADDR dst_addr,
- /* IN */ MS_SUBNET_HANDLE subnet_handle,
- /* IN */ MS_TRN_MSG_TYPE msg_type,
- /* IN */ UINT8 ttl,
- /* IN */ UINT8 akf,
- /* IN */ UINT8 aid,
- /* IN */ UINT32 seq_num,
- /* IN */ UCHAR * buffer,
- /* IN */ UINT16 buffer_len,
- /* IN */ UINT8 reliable
- );
- /**
- * \brief To clear all Segmentation and Reassembly Contexts
- *
- * \par Description
- * This routine clears all Segmentation and Reassembly Contexts.
- *
- * \return API_SUCCESS or an error code indicating reason for failure
- */
- API_RESULT MS_ltrn_clear_sar_contexts(void);
- #ifdef __cplusplus
- };
- #endif
- /** \} */
- /** \} */
- #endif /* _H_MS_LTRN_API_ */
|