Tiny protocol  0.7.0
Tiny communication protocol for microcontrollers
tiny_rq_pool.h
1 /*
2  Copyright 2016-2019 (C) Alexey Dynda
3 
4  This file is part of Tiny Protocol Library.
5 
6  Protocol Library is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Protocol Library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with Protocol Library. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #pragma once
21 
22 #include "proto/hal/tiny_defines.h"
23 #include "proto/hal/tiny_list.h"
24 
25 enum
26 {
27  TINY_HD_REQUEST_INIT = 0,
28  TINY_HD_REQUEST_SUCCESSFUL = 1,
29  TINY_HD_REQUEST_DECLINED = 2,
30 };
31 
33 typedef struct tiny_request_
34 {
38  uint8_t state;
40  uint16_t uid;
41 } tiny_request;
42 
43 void tiny_put_request(tiny_request *request);
44 
45 void tiny_remove_request(tiny_request *request);
46 
47 void tiny_decline_requests();
48 
49 void tiny_commit_request(uint16_t uid);
50 
defines type for tiny request list item
Definition: tiny_rq_pool.h:33
list_element element
This is base data for tiny lists. Must be first field in the structure.
Definition: tiny_rq_pool.h:36
uint16_t uid
unique id of the sent packet
Definition: tiny_rq_pool.h:40
structure defines base type for the lists
Definition: tiny_list.h:25
uint8_t state
state of the request
Definition: tiny_rq_pool.h:38