urtware / doc / activitydiagrams / request / hrtrequest / urtHrtRequestSubmit.uml @ f86427e8
History | View | Annotate | Download (3.756 KB)
| 1 | 2d315870 | Thomas Schöpping | /' |
|---|---|---|---|
| 2 | µRtWare is a lightweight publish/subscribe middleware for real-time |
||
| 3 | applications. It was developed as part of the software habitat for the |
||
| 4 | Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well. |
||
| 5 | |||
| 6 | Copyright (C) 2018..2020 Thomas Schöpping et al. |
||
| 7 | |||
| 8 | This program is free software: you can redistribute it and/or modify |
||
| 9 | it under the terms of the GNU General Public License as published by |
||
| 10 | the Free Software Foundation, either version 3 of the License, or |
||
| 11 | (at your option) any later version. |
||
| 12 | |||
| 13 | This program is distributed in the hope that it will be useful, |
||
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
| 16 | GNU General Public License for more details. |
||
| 17 | |||
| 18 | You should have received a copy of the GNU General Public License |
||
| 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
||
| 20 | '/ |
||
| 21 | |||
| 22 | /'### INTRO ##################################################################'/ |
||
| 23 | |||
| 24 | @startuml |
||
| 25 | |||
| 26 | title **µRtWare**\nurtHrtRequestSubmit()\n |
||
| 27 | |||
| 28 | /'### PARAMETERS & RETURN ####################################################'/ |
||
| 29 | |||
| 30 | note |
||
| 31 | -- **request** : urt_hrtrequest_t* -- |
||
| 32 | The request to be used for this call. |
||
| 33 | Must not be ""NULL"". |
||
| 34 | Must have been acquired before. |
||
| 35 | -- **service** : urt_service_t* -- |
||
| 36 | The service to be called. |
||
| 37 | Must not be ""NULL"". |
||
| 38 | -- **deadline** : urt_delay_t -- |
||
| 39 | Deadline offset until when this request is valid. |
||
| 40 | ==== |
||
| 41 | -- **return** : urt_status_t -- |
||
| 42 | Always returns ""URT_STATUS_OK"". |
||
| 43 | endnote |
||
| 44 | |||
| 45 | /'### PROCEDURE ##############################################################'/ |
||
| 46 | |||
| 47 | start |
||
| 48 | fork |
||
| 49 | :set QoS timer to deadline or maximum jitter; |
||
| 50 | fork again |
||
| 51 | :set ""deadlineOffset"" to argument; |
||
| 52 | endfork |
||
| 53 | :lock service; |
||
| 54 | fork |
||
| 55 | partition "enqueue request" {
|
||
| 56 | if (Service already holds requests?) then (yes) |
||
| 57 | if (Service already holds HRT requests?) then (yes) |
||
| 58 | :access first queued HRT request; |
||
| 59 | while (Queued request is more or equally critical?) is (yes) |
||
| 60 | :proceed to next request; |
||
| 61 | endwhile (no) |
||
| 62 | fork |
||
| 63 | :set ""next"" pointer of this request to queued request; |
||
| 64 | fork again |
||
| 65 | :set ""prev"" pointer of this request to ""prev"" of queued request; |
||
| 66 | fork again |
||
| 67 | :set ""next"" pointer of previous request to this request; |
||
| 68 | fork again |
||
| 69 | :set ""prev"" pointer of queued request to this request; |
||
| 70 | fork again |
||
| 71 | if (This is the least critical HRT request?) then (yes) |
||
| 72 | :set the ""requestQueue_hrtBack"" pointer to this request; |
||
| 73 | else (no) |
||
| 74 | endif |
||
| 75 | endfork |
||
| 76 | else (no) |
||
| 77 | :access first queued request; |
||
| 78 | fork |
||
| 79 | :set ""next"" pointer of this request to queued request; |
||
| 80 | fork again |
||
| 81 | :set ""prev"" pointer of queued request to this request; |
||
| 82 | fork again |
||
| 83 | :set the ""requestQueue_hrtBack"" pointer to this request; |
||
| 84 | endfork |
||
| 85 | endif |
||
| 86 | fork |
||
| 87 | if (The request is at the front of the queue?) then (yes) |
||
| 88 | :set the ""requestQueue_front"" pointer to this request; |
||
| 89 | else (no) |
||
| 90 | endif |
||
| 91 | fork again |
||
| 92 | if (The request is at the back of the queue?) then (yes) |
||
| 93 | :set the ""requestQueue_back"" pointer to this request; |
||
| 94 | else (no) |
||
| 95 | endif |
||
| 96 | endfork |
||
| 97 | else (no) |
||
| 98 | fork |
||
| 99 | :set the ""requestQueue_front"" pointer to this request; |
||
| 100 | fork again |
||
| 101 | :set the ""requestQueue_back"" pointer to this request; |
||
| 102 | fork again |
||
| 103 | :set the ""requestQueue_hrtBack"" pointer to this request; |
||
| 104 | endfork |
||
| 105 | endif |
||
| 106 | } |
||
| 107 | fork again |
||
| 108 | :set the service as request owner; |
||
| 109 | endfork |
||
| 110 | :unlock request; |
||
| 111 | :fire event (@service); |
||
| 112 | :unlock service; |
||
| 113 | stop |
||
| 114 | note |
||
| 115 | Returns ""URT_STATUS_OK"". |
||
| 116 | endnote |
||
| 117 | |||
| 118 | /'### OUTRO ##################################################################'/ |
||
| 119 | |||
| 120 | @enduml |