forked from SZV10X_Software/SZV103_FM33A0xxEV_SiZhu

wujiazhi
2024-06-07 d0cca79a4aa7efce979c6aed275fe1bb75af4cc4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef __GPRS_MESSAGE_QUEUE_H
#define __GPRS_MESSAGE_QUEUE_H
#include "datatype.h"
#include "typedefdata.h"    
 
 
 
 
typedef struct GPRS_SEND_MESS{
    u8            message_head1;        //Êý¾ÝÍ·
    u8            message_head2;        //Êý¾ÝÍ·
    u8            message_length;      //ЭÒ鳤¶È
    u8                month;                //ÔÂ
    u8                date;                //ÈÕ
    u8                hour;                //Сʱ
    u8                min;                //·Ö
    u8                sec;                    //Ãë
    u16                 device_id;              //É豸ID
    u16                 year;                     //Äê
    float                 mid_flow;                //ÖмäÁ÷Á¿
    float                 up_flow;              //ÉÏÁ÷Á¿
    float                 down_flow;              //ÏÂÁ÷Á¿
    double                 total_flow ;             //×ÜÁ÷Á¿
 
    float                temperature;        //ζÈ
    float                pressure;            //ѹÁ¦
    
 
}GPRS_SEND_MESSAGE;    
 
 
  
typedef struct queuet  
{  
 
    GPRS_SEND_MESSAGE        * memory_block;
    u8                         head;  
    u8                         tail;  
    u8                        queue_num;
} queue_t;          // ¶ÓÁеĽṹ 
 
  
 
 
 
#define    QUEUE_FULL            1
#define    QUEUE_OK            2
#define    QUEUE_EMPTY        3
 
/*Êý¾Ý·¢ËͶÓÁÐ*/
#define        MESSAGE_NUM    10
void initQueue(queue_t * queue_eg, GPRS_SEND_MESSAGE * message_addr) ;
u8 enQueue(queue_t *hq, GPRS_SEND_MESSAGE ins) ;
u8 outQueue(queue_t * hq, GPRS_SEND_MESSAGE * ins) ;
void clearQueue(queue_t * hq, GPRS_SEND_MESSAGE * message_addr); 
#endif