SmartMesh QSL for STM32F4 version

Fork of COG-AD4050_QSL by APS Lab

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers dn_serial_mt.h Source File

dn_serial_mt.h

00001 /*
00002 Copyright (c) 2014, Dust Networks. All rights reserved.
00003 
00004 Serial connector.
00005 
00006 \license See attached DN_LICENSE.txt.
00007 */
00008 
00009 #ifndef DN_SERIAL_H
00010 #define DN_SERIAL_H
00011 
00012 #include "dn_common.h"
00013 
00014 //=========================== defines =========================================
00015 
00016 #define DN_SERIAL_API_MASK_RESPONSE    0x01
00017 #define DN_SERIAL_API_MASK_PACKETID    0x02
00018 #define DN_SERIAL_API_MASK_SYNC        0x08
00019 
00020 #define DN_SERIAL_PACKETID_NOTSET      0x02
00021 
00022 // return code
00023 #define DN_SERIAL_RC_OK                0x00
00024 
00025 //=========================== typedef =========================================
00026 
00027 typedef void (*dn_serial_request_cbt)(uint8_t cmdId, uint8_t flags, uint8_t* payload, uint8_t len);
00028 typedef void (*dn_serial_reply_cbt)(uint8_t cmdId, uint8_t rc, uint8_t* payload, uint8_t len);
00029 
00030 //=========================== variables =======================================
00031 
00032 //=========================== prototypes ======================================
00033 
00034 void     dn_serial_mt_init(dn_serial_request_cbt requestCb);
00035 dn_err_t dn_serial_mt_sendRequest(
00036    uint8_t              cmdId,
00037    uint8_t              extraFlags,
00038    uint8_t*             payload,
00039    uint8_t              length,
00040    dn_serial_reply_cbt  replyCb
00041 );
00042 
00043 #endif
00044