Compare commits

..

614 Commits

Author SHA1 Message Date
El Mghazli Yacine
1ef5fafe89 logger component 2022-10-10 10:15:51 +02:00
frtabu
9f6e46bd8a Add backend memory cleanup when stopping scope, minor enhancements frontend interface 2022-10-07 20:01:01 +02:00
El Mghazli Yacine
7372378732 detail 2022-10-06 18:38:45 +02:00
El Mghazli Yacine
71d20e0543 removed logger components 2022-10-06 18:03:42 +02:00
El Mghazli Yacine
33fd2343ce removed charts folder 2022-10-06 18:02:05 +02:00
El Mghazli Yacine
48ef96959d removed scop2 and ws2 2022-10-06 17:07:29 +02:00
El Mghazli Yacine
c73ce11828 Merge branch 'rxws' of https://gitlab.eurecom.fr/oai/openairinterface5g into rxws 2022-10-06 15:15:46 +02:00
El Mghazli Yacine
66546b7ad0 send message fixed 2022-10-06 15:15:25 +02:00
El Mghazli Yacine
11087fff0f details 2022-10-06 15:15:25 +02:00
El Mghazli Yacine
ffa13d99e5 scope2 working like scope 2022-10-06 15:15:25 +02:00
yacine
ccae22f648 serdes to be tested 2022-10-06 15:15:25 +02:00
yacine
4e932c9248 build OK 2022-10-06 15:15:25 +02:00
yacine
0c9dd4d04a scope2 2022-10-06 15:12:23 +02:00
El Mghazli Yacine
67a5bfaa43 initial commit WIP 2022-10-06 15:12:23 +02:00
El Mghazli Yacine
501192a1f8 send message fixed 2022-10-06 15:12:06 +02:00
frtabu
83d00d4c21 scope waterfall enhancements 2022-10-06 15:09:38 +02:00
El Mghazli Yacine
12504106eb details 2022-10-04 15:15:48 +02:00
El Mghazli Yacine
3bb957722f scope2 working like scope 2022-10-04 12:58:41 +02:00
yacine
ae2abbc6e2 serdes to be tested 2022-10-02 23:42:22 +02:00
yacine
544c723372 build OK 2022-10-01 01:10:29 +02:00
yacine
1e34ab443c Merge branch 'rxws' of https://gitlab.eurecom.fr/oai/openairinterface5g into rxws 2022-10-01 00:51:03 +02:00
yacine
519b38817a scope2 2022-10-01 00:50:41 +02:00
El Mghazli Yacine
3da668576c initial commit WIP 2022-10-01 00:50:41 +02:00
yacine
ce46cab866 scope2 2022-10-01 00:48:51 +02:00
frtabu
553c6377aa waterfall implem going on.... 2022-09-30 19:13:29 +02:00
El Mghazli Yacine
b42694254f initial commit WIP 2022-09-30 19:07:20 +02:00
frtabu
50821cace3 switch to 16bits value for LLR data, start watterfall view implem 2022-09-29 19:40:52 +02:00
frtabu
2fb9752bff llr view enhancements 2022-09-28 19:33:42 +02:00
frtabu
7b57a3d4ed hardening websocket connection 2022-09-28 16:23:44 +02:00
frtabu
d81b670ac2 scope: llr view debug 2022-09-22 16:41:46 +02:00
yacine nokia
461ba045b1 use env backend for ws:// 2022-09-20 15:32:27 +02:00
frtabu
03a8ff2913 init fix scope availibility Pb 2022-09-20 14:31:59 +02:00
frtabu
6e85528582 scope interface modifications 2022-09-20 12:17:37 +02:00
frtabu
81ba755984 more scope updates 2022-09-19 11:25:35 +02:00
frtabu
e8ca483c56 scope front-end and back-end fixes and enhancements 2022-09-13 19:48:17 +02:00
frtabu
f8eba8400d scope chart display enhancements 2022-09-09 18:52:05 +02:00
frtabu
6d2bd1025f Add frontend chart options to improve GUI and perf 2022-09-07 19:50:56 +02:00
frtabu
36c0cf0133 scope data transfer debug 2022-09-06 19:47:57 +02:00
frtabu
7b31678bed fix frontend bug and add signal selection 2022-09-05 19:33:04 +02:00
frtabu
b2ba88667a scope gui enhancement, implement backend scope interface suport via regular http, websocket reserved for scope data transfers , frontend broken, init Pb 2022-08-26 17:14:41 +02:00
frtabu
0aca093122 start Restructure scope support code to move to regular http request control protocol, websocket being used for data 2022-08-24 19:38:36 +02:00
frtabu
73f5496ffa scope iq transfer implem and test 2022-08-23 19:19:53 +02:00
frtabu
f809e4689c angular update and ng2-charts integration completed 2022-07-26 19:15:00 +02:00
frtabu
5ae59cc394 Angular update 2022-07-26 15:16:02 +02:00
frtabu
def1ebc661 angular update 2022-07-26 13:18:22 +02:00
frtabu
b57963dd2a remove package_lock.json from git 2022-07-26 13:12:59 +02:00
frtabu
d33ae02d39 Angular update and start importing ng2-charts 2022-07-26 12:45:38 +02:00
frtabu
86ba2b0822 angular update 2022-07-25 17:55:41 +02:00
frtabu
4bfc929bad angular update 2022-07-25 15:33:48 +02:00
frtabu
db81a3f0b9 angular update 2022-07-25 15:31:18 +02:00
frtabu
abf14c0bb4 angular update 2022-07-25 15:28:26 +02:00
frtabu
a1d4514ae0 angular update 2022-07-25 15:26:05 +02:00
frtabu
d813fb8470 angular upgrade 2022-07-25 15:23:01 +02:00
frtabu
e2615dd886 angular update 2022-07-25 15:21:04 +02:00
frtabu
cc24755a34 angular update 2022-07-25 14:33:20 +02:00
frtabu
ca45cbb2b7 Angular update 2022-07-25 14:27:54 +02:00
frtabu
deb2a453c6 angular update for chart lib 2022-07-25 14:19:49 +02:00
frtabu
5a08d8109c websrv softscope interface, implement data messages 2022-07-22 19:54:08 +02:00
frtabu
65c858757d scope implem going on 2022-07-11 20:11:07 +02:00
frtabu
55003cafd2 Merge branch 'websrv' of https://gitlab.eurecom.fr/oai/openairinterface5g into websrv 2022-07-11 00:53:53 +02:00
frtabu
57a7488e85 Fix modifiable string bug and minor GUI update 2022-07-11 00:38:08 +02:00
yacine nokia
da85cf5183 Merge branch 'websrv' of gitlab.eurecom.fr:oai/openairinterface5g into websrv 2022-07-09 20:12:32 +02:00
yacine nokia
32a6dd85c2 fix string issue 2022-07-09 20:12:15 +02:00
frtabu
d9216265dc Merge branch 'websrv' of https://gitlab.eurecom.fr/oai/openairinterface5g into websrv
after rebase onto develop.
2022-07-08 20:00:53 +02:00
yacine nokia
99ecd83133 firefox debugger 2022-07-08 12:28:14 +02:00
frtabu
c4958e50e8 vertical scroll bar in grid tile 2022-07-08 12:19:07 +02:00
frtabu
7b16f7e863 Fix build error when libulfius not found (remove REQUIRED keyword in CMakelist) 2022-07-08 12:17:44 +02:00
El Mghazli Yacine
e0c7980df5 websrv working 2022-07-08 12:17:44 +02:00
frtabu
4b002029fb Remove telnet server dependency 2022-07-08 12:17:44 +02:00
frtabu
27d626dc48 exclude authentication code from websrv.c to workaround ubuntu18 compilation Pb 2022-07-08 12:17:44 +02:00
frtabu
4fa9e2b39b merge channel algo validation frontend and implement simuType variable type in backend - doesn't work and breaks modifiable string which are no more modifiable 2022-07-08 12:17:44 +02:00
El Mghazli Yacine
fb5c768159 predefs$ 2022-07-08 12:13:24 +02:00
El Mghazli Yacine
0966ceb70b predefs$ 2022-07-08 12:12:28 +02:00
El Mghazli Yacine
b75d4f90b7 loglvl 2022-07-08 12:07:09 +02:00
El Mghazli Yacine
8cbe53b82b paramCtrl 2022-07-08 12:03:30 +02:00
El Mghazli Yacine
13e17339d3 removed paramFC 2022-07-08 11:53:57 +02:00
El Mghazli Yacine
6d457fcb56 removed paramFC 2022-07-08 11:47:22 +02:00
yacine nokia
748d4cb49a localhost dev env 2022-07-08 11:46:16 +02:00
El Mghazli Yacine
1e77b753ff fixed table set 2022-07-08 11:33:50 +02:00
El Mghazli Yacine
2964ef7e3e paramCtrl 2022-07-08 11:33:50 +02:00
El Mghazli Yacine
7f69632bbb removed paramFC 2022-07-08 11:33:50 +02:00
frtabu
17af1562a8 scope implem ongoing.. 2022-07-08 11:33:50 +02:00
frtabu
c3378c7f84 Scope implem going on , front and back 2022-07-08 11:33:50 +02:00
El Mghazli Yacine
38dca6387f cleanup api (details) 2022-07-08 11:33:50 +02:00
frtabu
4a42ff54df log level validation , backend implem 2022-07-08 11:33:50 +02:00
El Mghazli Yacine
22d4495c20 !!!! major refactoring !!!! 2022-07-08 11:33:50 +02:00
frtabu
3b93a9c5cb minor fixes in scope frontend/backend 2022-07-08 11:33:50 +02:00
frtabu
6407df90e2 websocket binary message and scope interface 2022-07-08 11:33:50 +02:00
frtabu
d75da26833 start implem websocket interface with frontend 2022-07-08 11:33:50 +02:00
El Mghazli Yacine
b0f0106cc7 better rows with pristine 2022-07-08 11:33:50 +02:00
El Mghazli Yacine
2690cbd08e ws server address 2022-07-08 11:33:50 +02:00
El Mghazli Yacine
868f9d9042 ng serve OK 2022-07-08 11:33:50 +02:00
El Mghazli Yacine
ad0dcfe287 ng serve OK 2022-07-08 11:33:50 +02:00
El Mghazli Yacine
7bd44da548 initial commit - build NOK 2022-07-08 11:33:50 +02:00
El Mghazli Yacine
185e5934b7 pristine 2022-07-08 11:33:50 +02:00
frtabu
24802ee18b updatable result (frontend) 2022-07-08 11:33:50 +02:00
frtabu
8916cfdfd2 implement updatte results in frontend, ongoing 2022-07-08 11:33:49 +02:00
frtabu
b135c1dd8f start fixing https implem in backend 2022-07-08 11:33:49 +02:00
frtabu
6e61c8a05a Add access to parsed config file 2022-07-08 11:33:49 +02:00
frtabu
c957882da8 backend and frontend implementation of downloading config file 2022-07-08 11:33:49 +02:00
frtabu
7404ad7a5c commands with params... working now 2022-07-08 11:33:49 +02:00
frtabu
4e8fa01a25 frontend dialog test 2022-07-08 11:33:49 +02:00
frtabu
ec0d3fde1c command with parameters... 2022-07-08 11:33:49 +02:00
frtabu
58618be544 on going with command with parameter 2022-07-08 11:33:49 +02:00
frtabu
7e7c097942 going on with command parameter 2022-07-08 11:33:49 +02:00
frtabu
94796957e8 commands with a parameter, going on.... 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
55d9200a48 trying questions 2022-07-08 11:33:49 +02:00
frtabu
d815edebe7 command with parameter going on 2022-07-08 11:33:49 +02:00
frtabu
f1d18b4edb command with param implementation in frontend, beginning 2022-07-08 11:33:49 +02:00
frtabu
06355e9cf1 rontend Question Dialog 2022-07-08 11:33:49 +02:00
frtabu
9bcf269856 Implementing commands with question like when modifying a channel model (ask which model) 2022-07-08 11:33:49 +02:00
frtabu
9bfcbe7faa implemebtation of softmodem threads commands 2022-07-08 11:33:49 +02:00
frtabu
fa92bf1a79 Dialog enhancements in frontend 2022-07-08 11:33:49 +02:00
frtabu
a348ada211 fix log modifications in backend, allow Dialog resize and move 2022-07-08 11:33:49 +02:00
frtabu
e0f76e6ca6 implement log options modif in backend 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
351f069adc window.location.port 2022-07-08 11:33:49 +02:00
frtabu
64f84cdd6a implementation of command modifying module parameters, step 1, decode json sent by fronthaul 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
8bd1b3b53a boolean as string for setRow 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
2aef88960f http://' + window.location.hostname + ':8090' 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
51d6fd7ec2 v1 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
f2d43636bf better fields and buttons 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
dbeda2d33f table disapears when no rows 2022-07-08 11:33:49 +02:00
frtabu
5d9f91997e Modify status info , add redir log commands 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
210429f388 set disabled if all row is not modifiable 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
dc40e0dca1 fixed cmd results tile now disapears 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
fe8f418e7a fixed boolean enabled 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
98de3b9049 fixed 2 posts 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
55d83f6045 button and readonly 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
6882b63991 fixed rawIndex 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
45896f2583 row.paramsFA.controls 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
ed6b13c759 IRow2 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
eee4d3fc07 setRow$ in API 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
b8f64823bf setParam$ 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
d37952f94d setParam$ 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
12e2eded38 confirm button ok 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
d910e92669 height 80% display 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
9e2f2db88c table OK 2022-07-08 11:33:49 +02:00
frtabu
85929b7933 fix empty array format 2022-07-08 11:33:49 +02:00
frtabu
5673a31814 fix new IRespCmd json format in backend 2022-07-08 11:33:49 +02:00
frtabu
7da80421ff table response implementation fix (backend) 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
35e4f29cf6 display fix 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
c1abfcfc50 confirm dialog 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
b2e8b78a01 dynamic table WIP 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
53e160728a cleanup rowCtrl 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
522f2ad140 dynamic tables 2022-07-08 11:33:49 +02:00
frtabu
4a26a44ee0 Table Response implementation in backend 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
59722d1a91 confirm dialog before sending cmd 2022-07-08 11:33:49 +02:00
frtabu
218a524cd2 display array fix 2022-07-08 11:33:49 +02:00
frtabu
f44f105cb3 more commands implementation in backend 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
32ff4b33f1 "prod": "ng serve --configuration=production" 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
bf0492ba87 table display 2022-07-08 11:33:49 +02:00
frtabu
7a9c13422a fix json format in log response 2022-07-08 11:33:49 +02:00
frtabu
3e3b33e94c test table reslt with log command 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
58ae227080 tables and new API with IColumn and IRow 2022-07-08 11:33:49 +02:00
frtabu
81a671a4f3 implementation of log command 2022-07-08 11:33:49 +02:00
frtabu
039c6d24bc Adapt command response structure 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
ec80ef106f details 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
60f17d4d45 ilogs 2022-07-08 11:33:49 +02:00
frtabu
5e86379be4 implement mechanism for simple string response 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
62789c5161 openDialog 2022-07-08 11:33:49 +02:00
frtabu
bede89b233 command processing implementation 2022-07-08 11:33:49 +02:00
frtabu
4a29496988 better variable type processing 2022-07-08 11:33:49 +02:00
frtabu
a809a8c722 modify telnet server structure to support command execution from the webserver 2022-07-08 11:33:49 +02:00
frtabu
ad3ce4ddb6 json boolean fix 2022-07-08 11:33:49 +02:00
frtabu
72df29f225 fix backend commands response body 2022-07-08 11:33:49 +02:00
frtabu
42ab0247bf backend implementation of variable modifications 2022-07-08 11:33:49 +02:00
frtabu
a439a0cce0 Add OPTIONS http method support, used before POST by frontend. 2022-07-08 11:33:49 +02:00
frtabu
f7c9075337 change endpoint registration mechanism 2022-07-08 11:33:49 +02:00
frtabu
15fc3ccce0 More debug messages in backend 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
f2500d9297 fixed cmds display 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
72bc9baf2e fixed API variables calls 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
6cef7a8f67 APIv2.2 2022-07-08 11:33:49 +02:00
Raymond Knopp
b32524dd74 Adapt to new frontend interface 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
a45dd3b8bc yacine s'adapte grace a sa flaxibilité legendaire 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
a981bb382b APIv2.2 2022-07-08 11:33:49 +02:00
frtabu
f17aba0f5e config module fixes and websrv modif 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
ca0398c5bc APIv2.1 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
ab6bb2534e webserv APIv2 (frontend part) 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
c875ce639c working with first API version 2022-07-08 11:33:49 +02:00
frtabu
23a1d8d9bc fix config file generation to sip command line only options 2022-07-08 11:33:49 +02:00
frtabu
c0f6b39da5 config module enhancement,step 2 2022-07-08 11:33:49 +02:00
frtabu
095be9fe6a config module enhancement, next step 2022-07-08 11:33:49 +02:00
frtabu
82ebc9fa7b config module enhancement (dump of running config): start implem. 2022-07-08 11:33:49 +02:00
Raymond Knopp
526720cb24 add websrv as optional lib and frontend as independant target in oai build 2022-07-08 11:33:49 +02:00
frtabu
433dbcd41a websrv backend implementation next step 2022-07-08 11:33:49 +02:00
frtabu
20b3210062 json format sync with frontend 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
b959af152d backend env 2022-07-08 11:33:49 +02:00
frtabu
e5335a0188 Tested init with front end 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
1387bdc16e api first test 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
d2dfe830e7 display ok 2022-07-08 11:33:49 +02:00
frtabu
3da8b0e5eb Add https support and front-end url support 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
de0e075381 rudiments ok 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
826b405d47 ng build OK 2022-07-08 11:33:49 +02:00
frtabu
d761f67bcf go on websrv implem 2022-07-08 11:33:49 +02:00
frtabu
975835804d Initial implem web interface for telnet server 2022-07-08 11:33:49 +02:00
El Mghazli Yacine
b467fd2c68 updated tslib 2022-07-08 11:30:26 +02:00
El Mghazli Yacine
daec2ba3ea initial commit 2022-07-08 11:30:26 +02:00
El Mghazli Yacine
e705c88dd5 cleanup 2022-07-08 11:30:26 +02:00
El Mghazli Yacine
7121bf6d05 updated angular successfully 2022-07-08 11:30:26 +02:00
El Mghazli Yacine
1228608cc2 ng update 2022-07-08 11:30:26 +02:00
El Mghazli Yacine
47ac986d8c ng update 2022-07-08 11:30:26 +02:00
El Mghazli Yacine
8ea378eea8 ngx initial commit before upgrade 2022-07-08 11:30:26 +02:00
El Mghazli Yacine
2c688f230f Merge branch 'websrv' of gitlab.eurecom.fr:oai/openairinterface5g into websrv 2022-07-08 10:49:03 +02:00
El Mghazli Yacine
cbec64c28f websrv working 2022-07-08 10:49:00 +02:00
frtabu
1c352f3138 vertical scroll bar in grid tile 2022-07-08 01:43:00 +02:00
frtabu
5e964d660f Fix build error when libulfius not found (remove REQUIRED keyword in CMakelist) 2022-07-07 19:52:13 +02:00
frtabu
2e66c87f4d Remove telnet server dependency 2022-07-06 11:49:29 +02:00
frtabu
82a771dd61 exclude authentication code from websrv.c to workaround ubuntu18 compilation Pb 2022-07-06 10:13:45 +02:00
frtabu
c99f52207d merge channel algo validation frontend and implement simuType variable type in backend - doesn't work and breaks modifiable string which are no more modifiable 2022-07-05 13:35:05 +02:00
Robert Schmidt
5091682551 Merge branch 'integration_2022_wk26' into 'develop'
integration_2022_wk26

See merge request oai/openairinterface5g!1605

MR !1602 Use (std) bool instead of custom bool types
MR !1600 Discard RTX if RI changed
MR !1598 Set correct master clock rate for N320
MR !1584 enablement of statistics
MR !1603 Fix decoding multiple ULSCH in the same slot in the case of a ULSCH fails to be detected
MR !1590 Improvements and AVX2 in cpx_rotate_vector()
2022-07-04 15:03:35 +00:00
El Mghazli Yacine
3555edff76 Merge branch 'validators' of gitlab.eurecom.fr:oai/openairinterface5g into validators 2022-07-04 17:02:21 +02:00
El Mghazli Yacine
6723fc531b predefs$ 2022-07-04 17:02:11 +02:00
El Mghazli Yacine
26cc637d1b predefs$ 2022-07-04 16:57:42 +02:00
frtabu
e63f1454b3 Merge branch 'websrv' of https://gitlab.eurecom.fr/oai/openairinterface5g into websrv 2022-07-04 16:45:53 +02:00
El Mghazli Yacine
c69d980613 loglvl 2022-07-01 15:02:18 +02:00
frtabu
4c4917442f Merge branch 'websrv' of https://gitlab.eurecom.fr/oai/openairinterface5g into websrv 2022-07-01 14:14:42 +02:00
frtabu
bfb06225a5 Merge branch 'websrv' of https://gitlab.eurecom.fr/oai/openairinterface5g into websrv 2022-07-01 14:13:33 +02:00
El Mghazli Yacine
d62892ff8a Merge branch 'validators' of gitlab.eurecom.fr:oai/openairinterface5g into validators 2022-07-01 11:51:50 +02:00
El Mghazli Yacine
78ed7d4570 fixed table set 2022-07-01 11:47:57 +02:00
El Mghazli Yacine
d969a124ee paramCtrl 2022-06-30 17:09:45 +02:00
El Mghazli Yacine
b68e614850 removed paramFC 2022-06-30 17:09:45 +02:00
El Mghazli Yacine
17a4dea3e1 paramCtrl 2022-06-30 16:45:55 +02:00
Robert Schmidt
2cced7bdb5 Merge remote-tracking branch 'origin/optim-rotate_cpx' into integration_2022_wk26 2022-06-30 15:41:28 +02:00
frtabu
43130b687e scope implem ongoing.. 2022-06-30 00:21:27 +02:00
Robert Schmidt
b7e026fda5 Merge remote-tracking branch 'origin/fix_decoding_multi_ulsch_in_the_same_slot' into integration_2022_wk26 2022-06-29 23:15:15 +02:00
Robert Schmidt
4662ccc46a Merge remote-tracking branch 'origin/stats' into integration_2022_wk26 2022-06-29 23:15:06 +02:00
Robert Schmidt
ae54a1bd05 Merge remote-tracking branch 'origin/fix-n320' into integration_2022_wk26 2022-06-29 23:14:51 +02:00
Robert Schmidt
94ca30e82b Merge remote-tracking branch 'origin/NR_layers_in_harq' into integration_2022_wk26 2022-06-29 23:14:42 +02:00
frtabu
fdf2728d02 Scope implem going on , front and back 2022-06-29 23:07:25 +02:00
frtabu
2783acb933 Scope implem going on , front and back 2022-06-29 20:22:16 +02:00
laurent
df1cffbc7f fix bug introduced by avx2 rotate_cpx change to c16_t 2022-06-29 16:52:47 +02:00
El Mghazli Yacine
e78e720a46 Merge branch 'validators' of gitlab.eurecom.fr:oai/openairinterface5g into validators 2022-06-28 12:13:49 +02:00
El Mghazli Yacine
2d9bac6359 removed paramFC 2022-06-28 12:13:39 +02:00
El Mghazli Yacine
2ebb462a8e removed paramFC 2022-06-28 12:10:07 +02:00
frtabu
8ea5fd7894 Merge branch 'websrv' of https://gitlab.eurecom.fr/oai/openairinterface5g into websrv 2022-06-28 11:38:36 +02:00
frtabu
c939a9cdf5 log level validation , backend implem 2022-06-28 11:35:45 +02:00
El Mghazli Yacine
31c9a03e83 cleanup api (details) 2022-06-28 11:19:28 +02:00
Robert Schmidt
ff5ec94d33 Address review: drop bool defines 2022-06-28 09:38:48 +02:00
luis_pereira87
d6e58c9436 Fix decoding multiple ULSCH in the same slot in the case of a ULSCH fails to be detected 2022-06-28 07:35:06 +01:00
laurent
5894bcac22 rebase develop 2022-06-27 18:48:45 +02:00
laurent
ef469b9b51 code review remarks 2022-06-27 18:35:47 +02:00
Laurent Thomas
980bb2420b fix CI discovered bug in avx2 rotate 2022-06-27 18:35:47 +02:00
Laurent Thomas
bf219fc24f avx2 and better simd algo 2022-06-27 18:35:46 +02:00
El Mghazli Yacine
b7b41fefc0 !!!! major refactoring !!!! 2022-06-27 18:30:54 +02:00
Robert Schmidt
0b91791f67 Use (std) bool instead of custom bool types
OAI is riddled with boolean_t, FALSE, TRUE, etc. This makes no sense, as
there is a standard bool type, and could lead to nasty bugs if a
definition of a bool is non-standard (0 == false, true == !false). This
commit removes all non-standard bools in the whole project.
2022-06-27 10:07:48 +02:00
frtabu
29c5129b0a minor fixes in scope frontend/backend 2022-06-27 00:34:03 +02:00
Robert Schmidt
6d030ea2fa Merge branch 'integration_2022_wk25' into 'develop'
integration_2022_wk25

See merge request oai/openairinterface5g!1596

MR !1549: Remove ssb subcarrier offset from config file
MR !1589: Putting all CM code in one file
MR !1592: Support Fedora 36
MR !1492: Harmonization of PUCCH Resources
MR !1581: F1: Interoperability with Accelleran CU
MR !1599: nr rlc: minor: update tests
2022-06-26 15:56:56 +00:00
frtabu
3b0f050a33 websocket binary message and scope interface 2022-06-26 02:11:03 +02:00
frtabu
dc6dd67827 start implem websocket interface with frontend 2022-06-24 19:42:33 +02:00
luis_pereira87
a9faf533b4 Fix SA with COTS UE in monolithic mode after merge 2022-06-24 14:51:38 +01:00
Ilario FAVERO
c5b8fa5418 New command line arg for disabling stats: --disable-stats 2022-06-24 14:32:39 +02:00
francescomani
1565667908 remove rtx from list 2022-06-23 17:42:55 +02:00
El Mghazli Yacine
9f10bfebf2 better rows with pristine 2022-06-23 16:32:37 +02:00
Robert Schmidt
0e04fba03d Fix build warnings 2022-06-23 16:18:50 +02:00
El Mghazli Yacine
b34a44a4f9 ws server address 2022-06-23 14:40:53 +02:00
Robert Schmidt
5cebe354c5 Merge remote-tracking branch 'origin/bugfix-minor-update-nr-rlc-tests' into integration_2022_wk25 2022-06-23 14:14:37 +02:00
Robert Schmidt
b37050ac6e Merge remote-tracking branch 'origin/F1_interop_ACC_n78' into integration_2022_wk25 2022-06-23 14:09:33 +02:00
Robert Schmidt
304c92c639 Fixes in conversions.h 2022-06-23 13:51:36 +02:00
Cedric Roux
4505e780c5 nr rlc: minor: update tests
Behavior for ack/nack generation has changed not too long ago but the tests
were not checked and updated.
2022-06-23 11:44:01 +02:00
El Mghazli Yacine
0b7201244a ng serve OK 2022-06-22 23:06:18 +02:00
El Mghazli Yacine
28bd9ea4bc ng serve OK 2022-06-22 23:06:05 +02:00
El Mghazli Yacine
044ed48fc7 initial commit - build NOK 2022-06-22 19:39:04 +02:00
Robert Schmidt
644422ebec Merge remote-tracking branch 'origin/NR_PUCCH_RRC_Resources' into integration_2022_wk25 2022-06-22 17:20:38 +02:00
Robert Schmidt
586aa46c2c Set correct master clock rate for N320 2022-06-22 16:54:35 +02:00
francescomani
6f481e09f6 abort rtx if RI decreased 2022-06-22 16:15:31 +02:00
El Mghazli Yacine
1b071df0bc pristine 2022-06-22 10:13:05 +02:00
Robert Schmidt
f6fe86c653 Fix macros to avoid warnings 2022-06-21 19:24:49 +02:00
Robert Schmidt
fe7228daee Merge remote-tracking branch 'origin/support-fedora36' into integration_2022_wk25 2022-06-21 19:11:17 +02:00
Robert Schmidt
2c226b08f4 Merge remote-tracking branch 'origin/episys-channel-model-org' into integration_2022_wk25 2022-06-21 19:11:00 +02:00
Cedric Roux
2802418c34 remove debug printf 2022-06-21 16:43:54 +02:00
francescomani
2659dce8b8 removing flag init_UL_tti_req_ahead 2022-06-21 13:49:31 +02:00
Robert Schmidt
9c02189e64 Remove nr_bler_data from physims 2022-06-21 08:54:41 +02:00
Cedric Roux
d0fa56b1de compilation fix 2022-06-20 15:15:11 +02:00
Robert Schmidt
0fe98c25a2 Avoid RHEL_RELEASE_VERSION: not defined in Ubuntu 2022-06-20 13:34:54 +02:00
francescomani
a4e2c2b799 addressing review 2022-06-20 11:58:06 +02:00
Robert Schmidt
2124e43d3a Correctly use RHEL_RELEASE_CODE for Fedora and RHEL
This reverts commit 4f44a1026b.
2022-06-20 11:33:29 +02:00
francescomani
fb6fa64bc7 Merge remote-tracking branch 'origin/develop' into NR_remove_ssb_offset_from_configfile 2022-06-20 09:33:50 +02:00
Cedric Roux
5cd674483b Merge remote-tracking branch 'origin/develop' into F1_interop_ACC_n78 2022-06-19 18:41:27 +02:00
Cedric Roux
2bed0352fd f1: remove hardcoded value, set to what is in develop 2022-06-19 18:33:57 +02:00
Robert Schmidt
4f44a1026b Remove RHEL_RELEASE_CODE define 2022-06-19 18:02:08 +02:00
Robert Schmidt
dab905519b Remove nscd from additional packages
nscd (Name service cache daemon) is not needed for running OAI
2022-06-19 18:02:08 +02:00
Robert Schmidt
2b38c78588 Add fedora36 to supported distros 2022-06-19 18:02:08 +02:00
Robert Schmidt
12a23fb1ef Merge branch 'integration_2022_wk24' into 'develop'
integration_2022_wk24

See merge request oai/openairinterface5g!1591

MR !1382: Semi-automatic code generator for LDPC decoder for AVX2 and AVX512
MR !1521: 5G NR performance improvements for low SNR conditions
MR !1579: pthread_create, RT scheduler, and address sanitizer are incompatible in Ubuntu 18.04
MR !1588: small fix in csi configuration
MR !1583: Encoding/decoding CellGroup at MAC and fix RA with Msg3 carrying DCCH or DTCH messages
2022-06-18 13:57:58 +00:00
Robert Schmidt
ee71b0dd9b Lower error threshold for low SNR test in dlsim 2022-06-17 19:04:08 +02:00
frtabu
45967c8b77 updatable result (frontend) 2022-06-17 18:04:55 +02:00
frtabu
fc758069fb implement updatte results in frontend, ongoing 2022-06-17 18:04:55 +02:00
frtabu
9be7b12654 start fixing https implem in backend 2022-06-17 18:04:55 +02:00
frtabu
160abd88cc Add access to parsed config file 2022-06-17 18:04:55 +02:00
frtabu
e2eebc7a28 backend and frontend implementation of downloading config file 2022-06-17 18:04:55 +02:00
frtabu
a52adaa95e commands with params... working now 2022-06-17 18:04:55 +02:00
frtabu
ced3078e30 frontend dialog test 2022-06-17 18:04:55 +02:00
frtabu
b7d2840e04 command with parameters... 2022-06-17 18:04:55 +02:00
frtabu
0a88f1a2d8 on going with command with parameter 2022-06-17 18:04:55 +02:00
frtabu
4855b4102d going on with command parameter 2022-06-17 18:04:55 +02:00
frtabu
2dac45f1a3 commands with a parameter, going on.... 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
e73acbc776 trying questions 2022-06-17 18:04:55 +02:00
frtabu
21d0fdb92a command with parameter going on 2022-06-17 18:04:55 +02:00
frtabu
68e2cb7800 command with param implementation in frontend, beginning 2022-06-17 18:04:55 +02:00
frtabu
de24e2da1e rontend Question Dialog 2022-06-17 18:04:55 +02:00
frtabu
bc4eb38eec Implementing commands with question like when modifying a channel model (ask which model) 2022-06-17 18:04:55 +02:00
frtabu
8600b7815d implemebtation of softmodem threads commands 2022-06-17 18:04:55 +02:00
frtabu
8bee5da854 Dialog enhancements in frontend 2022-06-17 18:04:55 +02:00
frtabu
40bfb7b07a fix log modifications in backend, allow Dialog resize and move 2022-06-17 18:04:55 +02:00
frtabu
46c1dd511a implement log options modif in backend 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
d9cd942f3b window.location.port 2022-06-17 18:04:55 +02:00
frtabu
147fb74085 implementation of command modifying module parameters, step 1, decode json sent by fronthaul 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
7546e614c7 boolean as string for setRow 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
9a58bae112 http://' + window.location.hostname + ':8090' 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
9e99113aa1 v1 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
ea4d82bc31 better fields and buttons 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
94efccba21 table disapears when no rows 2022-06-17 18:04:55 +02:00
frtabu
28c688b16f Modify status info , add redir log commands 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
6d991456a9 set disabled if all row is not modifiable 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
bb840b7f7e fixed cmd results tile now disapears 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
9fecc570f8 fixed boolean enabled 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
1a5da9a1aa fixed 2 posts 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
adb13cd4d4 button and readonly 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
9f8ebe86f4 fixed rawIndex 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
46329a4f2d row.paramsFA.controls 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
1f4dcc9fda IRow2 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
7dda3dde08 setRow$ in API 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
e108aaa7db setParam$ 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
7da12ca861 setParam$ 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
2b987e8e00 confirm button ok 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
c2106e49d8 height 80% display 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
0b473838fa table OK 2022-06-17 18:04:55 +02:00
frtabu
3e15c59e00 fix empty array format 2022-06-17 18:04:55 +02:00
frtabu
9aa6e61197 fix new IRespCmd json format in backend 2022-06-17 18:04:55 +02:00
frtabu
4c58063268 table response implementation fix (backend) 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
25f1b46647 display fix 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
68ae77a79e confirm dialog 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
a4ad969553 dynamic table WIP 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
415e9e8495 cleanup rowCtrl 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
5a5d8670ea dynamic tables 2022-06-17 18:04:55 +02:00
frtabu
9e20b2464f Table Response implementation in backend 2022-06-17 18:04:55 +02:00
El Mghazli Yacine
ea5c125dbd confirm dialog before sending cmd 2022-06-17 18:04:55 +02:00
frtabu
66646cd17a display array fix 2022-06-17 18:04:54 +02:00
frtabu
81b0df6f1d more commands implementation in backend 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
e9dadf1706 "prod": "ng serve --configuration=production" 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
f9e45856fc table display 2022-06-17 18:04:54 +02:00
frtabu
0f9fcb3f0a fix json format in log response 2022-06-17 18:04:54 +02:00
frtabu
17af664374 test table reslt with log command 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
da3bda8bbb tables and new API with IColumn and IRow 2022-06-17 18:04:54 +02:00
frtabu
a5d66d1f4a implementation of log command 2022-06-17 18:04:54 +02:00
frtabu
4b289a53df Adapt command response structure 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
d5eb164a20 details 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
fec25da5e7 ilogs 2022-06-17 18:04:54 +02:00
frtabu
4ec7d0a824 implement mechanism for simple string response 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
a873c0080a openDialog 2022-06-17 18:04:54 +02:00
frtabu
06f905853a command processing implementation 2022-06-17 18:04:54 +02:00
frtabu
179b8f57b3 better variable type processing 2022-06-17 18:04:54 +02:00
frtabu
9b1e5db390 modify telnet server structure to support command execution from the webserver 2022-06-17 18:04:54 +02:00
frtabu
32e5f13002 json boolean fix 2022-06-17 18:04:54 +02:00
frtabu
4497800fe1 fix backend commands response body 2022-06-17 18:04:54 +02:00
frtabu
6846459ea5 backend implementation of variable modifications 2022-06-17 18:04:54 +02:00
frtabu
f7dafc4771 Add OPTIONS http method support, used before POST by frontend. 2022-06-17 18:04:54 +02:00
frtabu
ee11159d5d change endpoint registration mechanism 2022-06-17 18:04:54 +02:00
frtabu
c0a3b39688 More debug messages in backend 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
679dcae557 fixed cmds display 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
b14c4b2aa6 fixed API variables calls 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
92c534dcaa APIv2.2 2022-06-17 18:04:54 +02:00
Raymond Knopp
07fb404e33 Adapt to new frontend interface 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
a010b4d89f yacine s'adapte grace a sa flaxibilité legendaire 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
b340427363 APIv2.2 2022-06-17 18:04:54 +02:00
frtabu
654a2b7f63 config module fixes and websrv modif 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
b0cb9b8615 APIv2.1 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
9bb75d82cf webserv APIv2 (frontend part) 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
535239a5ae working with first API version 2022-06-17 18:04:54 +02:00
frtabu
89b2a966ba fix config file generation to sip command line only options 2022-06-17 18:04:54 +02:00
frtabu
29e2a542dd config module enhancement,step 2 2022-06-17 18:04:54 +02:00
frtabu
98a736c9d7 config module enhancement, next step 2022-06-17 18:04:54 +02:00
frtabu
8404af8d18 config module enhancement (dump of running config): start implem. 2022-06-17 18:04:54 +02:00
Raymond Knopp
7572d8cb46 add websrv as optional lib and frontend as independant target in oai build 2022-06-17 18:04:54 +02:00
frtabu
db43c3e12e websrv backend implementation next step 2022-06-17 18:04:54 +02:00
frtabu
ea066dc0dc json format sync with frontend 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
c0037b1f98 backend env 2022-06-17 18:04:54 +02:00
frtabu
29aa6407be Tested init with front end 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
f6d4c77e75 api first test 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
c0e019efbd display ok 2022-06-17 18:04:54 +02:00
frtabu
ded656208d Add https support and front-end url support 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
9c36a8ebc2 rudiments ok 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
1dda299dc3 ng build OK 2022-06-17 18:04:54 +02:00
frtabu
c8d1b99e42 go on websrv implem 2022-06-17 18:04:54 +02:00
frtabu
b274f3c8d3 Initial implem web interface for telnet server 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
1d7775875e updated tslib 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
3a560604ec initial commit 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
f677cc34b3 cleanup 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
cdab201890 updated angular successfully 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
20186aec26 ng update 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
79fc8623e3 ng update 2022-06-17 18:04:54 +02:00
El Mghazli Yacine
c104b12302 ngx initial commit before upgrade 2022-06-17 18:04:54 +02:00
luis_pereira87
78267db68b Revert "Update downlink MCS table" block of code to function nr_set_pdsch_semi_static to get downlink working again in NSA 2022-06-17 16:17:15 +01:00
Robert Schmidt
0c0d88b201 Better formatting for Consolidated Test Results 2022-06-17 12:17:54 +02:00
Robert Schmidt
7194a720c9 Increase 'low SNR' test's upper SNR threshold 2022-06-17 12:16:12 +02:00
Robert Schmidt
9ff4630071 Merge remote-tracking branch 'origin/NR_RRC_MAC_CellGroup' into integration_2022_wk24 2022-06-17 12:11:37 +02:00
luis_pereira87
9e27394ecc Reset feedback_slot and round values when resetting HARQ processes 2022-06-17 10:35:01 +01:00
Robert Schmidt
2399da33cb Merge remote-tracking branch 'origin/csi-multi-ues-fix' into integration_2022_wk24 2022-06-16 22:26:00 +02:00
Robert Schmidt
348ff98762 Merge remote-tracking branch 'origin/ubuntu_18_rt_add_san_incompatibility' into integration_2022_wk24 2022-06-16 22:25:46 +02:00
Robert Schmidt
032d477481 Merge remote-tracking branch 'origin/5g-nr-low-snr-performance' into integration_2022_wk24 2022-06-16 22:25:38 +02:00
Laurent Thomas
a73e500ded Add a warning for ubuntu 18.04 in build_oai 2022-06-16 21:42:46 +02:00
Melissa Elkadi
7b75305e3c pthread_create, RT scheduler, and address sanitizer are incompatible in Ubuntu 18.04
When we run with the RT scheduler and the address sanitizer in Ubuntu
18.04, pthread_create will hang and never create threads.  This adds
some explanatory text in CMakeLists.txt to explain about this issue.
2022-06-16 21:42:26 +02:00
Robert Schmidt
5761164a09 Build without AVX512 on asterix machine 2022-06-16 14:25:18 +02:00
Roberto Louro Magueta
4053c0c3b2 Revert log2_maxh in pusch_vars 2022-06-15 19:54:12 +01:00
luis_pereira87
cc33856ba8 Reset HARQ processes after RA when Msg3 carries a DCCH or DTCH message.
Reset ul_failure flag only after sending Msg4 otherwise gNB starts scheduling too early
2022-06-15 17:24:47 +01:00
Roberto Louro Magueta
14d3a9c0e5 Fixes after merge 2022-06-15 12:53:36 +01:00
Robert Schmidt
e62119bea5 Reintroduce nr_ulsim -I option after wrong merge 2022-06-15 13:53:22 +02:00
Roberto Louro Magueta
7f21567f83 Merge remote-tracking branch 'origin/develop' into 5g-nr-low-snr-performance
# Conflicts:
#	cmake_targets/autotests/test_case_list.xml
#	openair1/SIMULATION/NR_PHY/dlsim.c
#	openair1/SIMULATION/NR_PHY/ulsim.c
2022-06-15 11:17:06 +01:00
Cedric Roux
2521e46593 Merge remote-tracking branch 'origin/F1C_extensions_develop' into F1_interop_ACC_n78
Conflicts:
	openair2/F1AP/f1ap_du_interface_management.c
	openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
	openair2/LAYER2/NR_MAC_gNB/main.c
	openair2/RRC/NR/MESSAGES/asn1_msg.c
	openair2/RRC/NR/MESSAGES/asn1_msg.h
	openair2/RRC/NR/rrc_gNB.c
	openair3/ocp-gtpu/gtp_itf.cpp
2022-06-15 11:28:37 +02:00
luis_pereira87
527003492d Revert call to process_CellGroup function in rrc_mac_config_req_gNB to fix F1 user plane working 2022-06-15 09:34:55 +01:00
Robert Schmidt
d835f3387d Build without AVX512 on caracal to avoid compilation fail 2022-06-15 08:49:10 +02:00
Melissa Elkadi
630f8ac2b1 Putting all CM code in one file
This commit includes reorganization of
all of the SISO/MIMO channel modelling
support being moved into a single CM
file. Furthermore, it includes a bug
fix for the number of MCS simulation
tables (29 total, 0-28).
2022-06-14 12:52:01 -07:00
Karim Boutiba
079ad360e0 solve the conflict between cri-RSRP and cri-RI-PMI-CQI in the case of multiple UEs 2022-06-14 13:38:12 +00:00
Robert Schmidt
bb15360a55 Revert "CI: phySim container build: add SYS_PTRACE"
This reverts commit 0122749406.
2022-06-14 12:35:48 +02:00
Robert Schmidt
0a74c23c8a Disable Asan in LDPC decoder generator executables
The CI compiles the physims using Asan. This in turn compiles Asan into
the LDPC decoder generator files. Since they are run during build, there
are two options:

1) trigger the build using capability SYS_PTRACE to allow running asan
   when executing the generators.
2) disable asan in the generators.

The first option seems not feasible, as the compilation of the ldpctest
does not succeed (in fact, for a reason I don't understand, ninja seems
to trigger linking and is then blocked indefinitely). Therefore, this
commit simple disables asan in the generators.
2022-06-14 12:30:12 +02:00
luis_pereira87
ed74875025 Call rrc_mac_config_req_gNB function only when running nr-softmodem as a DU or in monolithic mode 2022-06-14 11:29:56 +01:00
luis_pereira87
7cee46777f Cosmetic changes 2022-06-13 23:20:37 +01:00
Cedric Roux
33b69bdf30 nr rlc: bugfix: use hard-coded mapping between drb ID and mac lcid
This will probably impact negatively the Accelleran interoperability
but the previous version is not correct and breaks the oai nr ue.

To be checked in a CU/DU scenario with Accelleran.
2022-06-13 18:28:07 +02:00
Cedric Roux
1ad8f254c2 Merge remote-tracking branch 'origin/develop' into F1_interop_ACC_n78 2022-06-13 16:59:59 +02:00
francescomani
045de837ab Merge remote-tracking branch 'origin/develop' into NR_PUCCH_RRC_Resources 2022-06-13 10:25:05 +02:00
Raymond Knopp
a119e84f92 Merge remote-tracking branch 'origin/develop' into ldpc-decoder-codegen 2022-06-13 09:44:51 +02:00
luis_pereira87
983760e9a4 Fix after merge with develop 2022-06-13 08:21:05 +01:00
luis_pereira87
131db89dfc Merge remote-tracking branch 'origin/develop' into NR_RRC_MAC_CellGroup
# Conflicts:
#	openair1/PHY/INIT/nr_init.c
#	openair2/LAYER2/NR_MAC_gNB/config.c
2022-06-13 08:19:39 +01:00
Raymond Knopp
7387721ecf Merge branch 'ldpc-decoder-codegen' of https://gitlab.eurecom.fr/oai/openairinterface5g into ldpc-decoder-codegen 2022-06-12 23:24:11 +02:00
Raymond Knopp
f6bb869c0b fixed AVX2 issue for cnProc code generator. Some cleanup in formatting and deleting unused files. 2022-06-12 23:23:07 +02:00
Robert Schmidt
169f42a365 Prevent #define name clash
The files openair1/PHY/CODING/nrLDPC_cnProc.h and
openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_cnProc.h have the same name,
and also the same include guard/define. This commit renames the define
in the latter to prevent this name clash.
2022-06-12 16:32:46 +02:00
Robert Schmidt
6900f2bc88 Add License to LDPC decoder generator files 2022-06-12 16:29:49 +02:00
luis_pereira87
e850a8ece7 Fix initial connection setup when there is Msg4 retransmissions and UE comes with a new RA with Msg3 carrying DCCH or DTCH message 2022-06-10 23:18:18 +01:00
Robert Schmidt
aabd9c6c4e nr_ulsim: Change thread-count command-line option to -C 2022-06-10 15:45:32 +02:00
Robert Schmidt
b193ccf6ee Merge remote-tracking branch 'origin/develop' into 5g-nr-low-snr-performance 2022-06-10 13:50:47 +02:00
Robert Schmidt
0122749406 CI: phySim container build: add SYS_PTRACE
Physical simulators are built using address sanitizer. During the build
process, we use generators that are themselves built during the build
process. They are also asan, and we therefore need to give the
SYS_PTRACE capability during the build process to have them run
correctly.
2022-06-10 13:37:30 +02:00
Robert Schmidt
ae23942020 Compile container images without AVX512 for relocatability 2022-06-10 13:37:30 +02:00
Robert Schmidt
f7ab71763d Remove old way of generating LDPC decoders 2022-06-09 15:03:13 +02:00
Robert Schmidt
dde6d61dd4 Dynamically create LDPC decoder headers when building ldpc libs 2022-06-09 15:03:13 +02:00
Robert Schmidt
7b68c48618 Make LDPC generator output directory prefix configurable 2022-06-09 15:03:13 +02:00
Robert Schmidt
250043655a Remove some variables from LDPC generated code to avoid warnings 2022-06-09 15:03:13 +02:00
Laurent THOMAS
97b3d1a5cd fix mutex not initialised in ul decoder 2022-06-09 15:03:13 +02:00
francescomani
8adcf8368a reverting activation of timer at transmission 2022-06-09 14:48:42 +02:00
luis_pereira87
e7a491415c Improvements on RRC passing CellGroup to MAC to get COTS UE working 2022-06-09 10:08:28 +01:00
francescomani
0aec0d91c6 temporary workaround for RRC passing CG to MAC (forced encoding of message at MAC) 2022-06-09 09:35:42 +01:00
Robert Schmidt
894c45eae5 Add comment to fix fill_mastercellGroupConfig() 2022-06-09 10:20:39 +02:00
Laurent THOMAS
e3747ea06b Fix small bugs in nrLDPC_tools, remain some warnings to fix 2022-06-09 10:01:45 +02:00
Robert Schmidt
aed83c91de Create header for LDPC bnProc BG2 files 2022-06-09 09:25:57 +02:00
Robert Schmidt
12c0f52fea Merge remote-tracking branch 'origin/develop' into F1_interop_ACC_n78 2022-06-08 19:45:17 +02:00
Robert Schmidt
2d3f4f7310 Merge remote-tracking branch 'origin/develop' into ldpc-decoder-codegen 2022-06-08 17:17:11 +02:00
Cedric Roux
f71766c3ee Merge remote-tracking branch 'origin/develop' into F1_interop_ACC_n78
Conflicts:
	openair2/F1AP/f1ap_du_ue_context_management.c
	openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
	openair2/RRC/NR/MESSAGES/asn1_msg.h
	openair2/RRC/NR/rrc_gNB.c
	openair3/ocp-gtpu/gtp_itf.cpp

There were some important conflicts in openair3/ocp-gtpu/gtp_itf.cpp
I rewrote a bit the function Gtpv1uHandleGpdu(). It might have been
done wrongly.
To be tested and fixed if needed.

To redo the merge, if needed:
git checkout 9b2a163ebb
git merge 5ea828e149
2022-06-08 15:48:24 +02:00
francescomani
bc1227f9a0 Merge remote-tracking branch 'origin/develop' into NR_remove_ssb_offset_from_configfile 2022-06-08 14:52:47 +02:00
francescomani
539e5e89f3 Merge remote-tracking branch 'origin/develop' into NR_PUCCH_RRC_Resources 2022-06-08 14:45:33 +02:00
francescomani
b96df49e15 postpone initialization of UL_tti_req_ahead to when sl_ahead is available 2022-06-01 17:09:08 +02:00
francescomani
9a43678ed0 Merge remote-tracking branch 'origin/develop' into NR_PUCCH_RRC_Resources 2022-06-01 09:06:57 +02:00
francescomani
a724c1febc starting timer for msg4 at transmission 2022-05-20 15:09:25 +02:00
francescomani
fcfc7a90e8 fix for asan assertion 2022-05-20 13:56:12 +02:00
francescomani
9150dc8c50 applying review comment 2022-05-19 14:48:45 +02:00
francescomani
6d736db22d applying PUCCH harmonization to multiple BWP 2022-05-18 17:23:55 +02:00
francescomani
0c5d6a59e7 Merge remote-tracking branch 'origin/develop' into NR_PUCCH_RRC_Resources 2022-05-18 15:19:00 +02:00
francescomani
085014f601 Merge remote-tracking branch 'origin/develop' into NR_remove_ssb_offset_from_configfile 2022-05-18 10:25:47 +02:00
Thomas Schlichter
3934f2020e slightly increase the target SNR for the nr_dlsim low SNR test to make the test more reliable 2022-05-18 09:54:59 +02:00
Thomas Schlichter
6f8b13c2ad fix nr_ulsim option "-i" has no further parameters 2022-05-18 09:50:37 +02:00
Thomas Schlichter
c97d5d04ed fixes from review 2022-05-18 09:35:01 +02:00
Thomas Schlichter
44a98a85c5 Merge remote-tracking branch 'origin/develop' into 5g-nr-low-snr-performance 2022-05-17 17:38:59 +02:00
Robert Schmidt
68be6f83e6 randominit(): show used seed when using time() 2022-05-10 14:22:50 +02:00
francescomani
c7e8002d8d adding CI test with subcarrier offset in pbchsim 2022-05-10 11:43:44 +02:00
francescomani
3b16547374 fix in pbchsim 2022-05-10 09:13:52 +02:00
francescomani
a037987b47 remove ssb subcarrier offset from config file 2022-05-09 18:28:56 +02:00
francescomani
59ced82104 Merge remote-tracking branch 'origin/develop' into NR_PUCCH_RRC_Resources 2022-05-06 17:02:22 +02:00
Raymond Knopp
bf5389936d added deletion/creation of ldpc_gen_files directory and subdirectories 2022-05-03 22:09:46 +02:00
Raymond Knopp
3ecfead572 added script to generate ldpc decoder files 2022-05-03 22:03:19 +02:00
Raymond Knopp
63b28d3610 clean up (removal) of ldpc generated files on repository 2022-05-03 21:26:18 +02:00
Raymond Knopp
8506307ef0 Merge remote-tracking branch 'origin/develop' into ldpc-decoder-codegen
Conflicts:
	cmake_targets/build_oai
	openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_cnProc.h
	openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
	openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_init_mem.h
	openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h
	openair1/PHY/NR_REFSIG/ptrs_nr.c
2022-05-02 22:41:48 +02:00
Thomas Schlichter
795c057d8c nr_dlsim: fix low-SNR performance by using DCI aggregation level 8 2022-04-19 11:32:47 +02:00
matzakos
9b2a163ebb Add true reporting of RLC buffer availability in first DDD report from DU to CU 2022-04-15 10:36:31 +02:00
matzakos
3feb0f472f Add more proper parsing of NR-RAN gtp-u extension header 2022-04-15 10:35:39 +02:00
matzakos
b216c58526 Remove xml prints of F1AP messages 2022-04-15 10:34:53 +02:00
Raymond Knopp
e721f6af04 Merge remote-tracking branch 'origin/tdd25period_for_MR' into F1_interop_ACC_n78
Conflicts:
	openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
2022-04-14 11:14:36 +02:00
matzakos
f9e5c987a6 Merge remote-tracking branch 'origin/develop' into F1C_extensions_develop 2022-04-13 14:22:19 +02:00
matzakos
0c05e283e2 Remove warnings and unused code 2022-04-13 13:19:04 +02:00
francescomani
cfda6c7b1d renaming SR config function 2022-04-13 10:58:28 +02:00
francescomani
11ced194cd Merge remote-tracking branch 'origin/develop' into NR_PUCCH_RRC_Resources 2022-04-12 10:28:32 +02:00
Thomas Schlichter
94e5aaff88 Merge remote-tracking branch 'origin/develop' into 5g-nr-low-snr-performance 2022-04-12 09:51:47 +02:00
matzakos
47c9ded007 Use higher data type to store the length of UE capability RAT container 2022-04-11 19:53:36 +02:00
matzakos
bfc7c1b361 Remove bad return before unlocking mutex in pdcp UL indication 2022-04-11 19:35:05 +02:00
Raymond Knopp
5962824038 Integrate true reporting of buffer availability of RLC(DU) towards the CU 2022-04-07 16:34:16 +02:00
Thomas Schlichter
4035bdb71d add autotest test case for nr_dlsim low SNR performance
performance is ~1.0dB worse than nr_ulsim because of unexpected bad PDCCH performance...
2022-04-07 12:20:33 +02:00
Thomas Schlichter
298740b06c add autotest test case for nr_ulsim low SNR performance 2022-04-07 12:12:20 +02:00
Thomas Schlichter
c7055b2cf9 nr_ulsim: set PUSCH detection threshold to -2.0 dB SNR 2022-04-07 12:08:26 +02:00
Thomas Schlichter
23bdf1e32c remove unused perfect_ce 2022-04-07 11:45:26 +02:00
Thomas Schlichter
dd374c7e03 add more detailed statistics to nr_dlsim output 2022-04-07 11:45:26 +02:00
Bo Zhao
7f074bcc22 Implement PDCCH channel estimation averaging over PRB (no interpolation) 2022-04-07 10:42:03 +02:00
Bo Zhao
fe7ee4d2fe Scaling LLR for different QAM schemes 2022-04-07 10:40:53 +02:00
matzakos
693d687d3f Restore nr_l1_helpers.h and dependencies 2022-04-06 10:57:36 +02:00
matzakos
0eb2acb00b F1 code cleanup before merge
-Remove commented out code, debug logs, some hardcodings, fix indentation
2022-04-06 10:43:09 +02:00
francescomani
4c17c9c62a change SR slot in FDD to avoid assertion 2022-04-03 18:15:17 +02:00
francescomani
e1e8c167de Merge remote-tracking branch 'origin/develop' into NR_PUCCH_RRC_Resources 2022-04-01 19:21:45 +02:00
Raymond Knopp
a77c1d3202 Trigger first DL Data Delivery status from DU to report the buffer availability to the CU
-After that no DL traffic is getting blocked at the Accelleran CU for low values of throughput
-Remaining to remove the hardcoded value of buffer availability and report the actual value from the DU.
2022-03-29 12:17:37 +02:00
matzakos
038e70b0c6 Merge remote-tracking branch 'origin/develop' into F1C_extensions_develop 2022-03-28 21:55:21 +02:00
matzakos
90c64f4cf8 Merge remote-tracking branch 'origin/develop' into F1C_extensions_develop 2022-03-28 21:20:49 +02:00
matzakos
4e73ef0c3b Avoid exiting in case of PDPC receiving UL user-plane traffic before the DRB is established
-Happened occasionally in the CU/DU split scenario
2022-03-17 17:01:50 +01:00
matzakos
aba5098e30 Remove hardcoding of port numbers in handling of F1 UE context modification request 2022-03-17 17:01:01 +01:00
francescomani
f40b579a78 fix for phy-simulator issues 2022-03-16 15:13:50 +01:00
francescomani
8edcd41a8d fix for pucch0 that straddles DC carrier 2022-03-14 17:35:04 +01:00
matzakos
12eed23f63 Merge remote-tracking branch 'origin/develop' into F1C_extensions_develop 2022-03-14 11:39:13 +01:00
francescomani
03617b9165 more general SR config for period and offset 2022-03-14 10:43:59 +01:00
francescomani
a88a8dae8e config of pucch2 in rrcsetup 2022-03-11 12:27:00 +01:00
francescomani
63ebfff4d3 Merge remote-tracking branch 'origin/develop' into NR_PUCCH_RRC_Resources 2022-03-10 15:21:47 +01:00
Raymond Knopp
6abb1e362d Merge remote-tracking branch 'origin/tdd25period_for_MR' into F1_interop_ACC
Conflicts:
	cmake_targets/CMakeLists.txt
	openair1/PHY/NR_TRANSPORT/pucch_rx.c
	openair1/SCHED_NR/fapi_nr_l1.c
	openair1/SIMULATION/NR_PHY/dlschsim.c
	openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
	openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
	openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
	openair2/LAYER2/NR_MAC_gNB/main.c
	openair2/RRC/NR/MESSAGES/asn1_msg.c
	openair2/RRC/NR/MESSAGES/asn1_msg.h
	openair2/RRC/NR/nr_rrc_proto.h
	openair2/RRC/NR/rrc_gNB.c
	openair3/ocp-gtpu/gtp_itf.cpp
	targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.2x2.usrpn300.conf
2022-03-09 19:16:23 +01:00
matzakos
14ec3e505d Fix decoding of UE-capabilities-RAT-container-list at the DU after receiving it from the CU 2022-03-09 19:08:15 +01:00
Raymond Knopp
2776ec78b0 Add initial support for DL Data Delivery status reporting over NR-User plane protocol in gtp-u 2022-03-03 17:21:59 +01:00
Raymond Knopp
d4b566ceb8 Update ori.h for AW2S RU 2022-03-03 17:21:23 +01:00
matzakos
e5c6ee599c Merge with latest updates of develop and fixes for F1
-Problem when parsing UE_RAT_container_list at the DU through UE context setup request
-Some debug logs added to be removed once this is fixed
2022-02-28 21:51:41 +01:00
matzakos
55d59e5f2a Merge remote-tracking branch 'origin/repair-f1-5g' into F1C_extensions_develop 2022-02-28 14:44:01 +01:00
Raymond Knopp
c02650826d SIMD alignment of stack arrays in ptrs channel estimation. 2022-02-19 17:17:09 +01:00
Raymond Knopp
9790eb1adc Merge remote-tracking branch 'origin/develop' into ldpc-decoder-codegen
Conflicts:
	cmake_targets/CMakeLists.txt
	cmake_targets/build_oai
	cmake_targets/phy_simulators
	cmake_targets/phy_simulators/CMakeLists.txt
2022-02-19 13:14:53 +01:00
matzakos
fb153cc792 Merge remote-tracking branch 'origin/NR_SA_UID' into F1C_extensions_develop 2022-02-16 16:08:58 +01:00
matzakos
d3d9325081 Merge remote-tracking branch 'origin/develop' into F1C_extensions_develop 2022-02-16 16:08:34 +01:00
Raymond Knopp
dccbd9279a Some hardcoded values in F1AP for testing with Accelleran to be removed later 2022-02-09 11:05:23 +01:00
francescomani
8d7df8d164 rrc configuration for pucch power control 2022-02-07 19:28:51 +01:00
Raymond Knopp
2e0823a7ae Change mapping between DRB id and channel id for interoperability with Accelleran CU
-Some hardcodings also added to be removed later
2022-02-01 14:03:42 +01:00
francescomani
d29b17a211 function to configure SR 2022-01-26 17:46:26 +01:00
francescomani
9408c3c0b0 function to set dl_DataToUL_ACK 2022-01-26 13:58:57 +01:00
matzakos
a19f2e3254 Merge remote-tracking branch 'origin/aw2s-n41' into F1_interop_ACC 2022-01-24 15:11:50 +01:00
francescomani
975f7e868a function to configure pucch resource set 1 (format2) 2022-01-21 19:15:50 +01:00
francescomani
dd6dac1392 function to configure pucch resource set 0 2022-01-21 16:16:02 +01:00
francescomani
299ba03b84 passing UECAP structure to RRC reconfiguration functions 2022-01-21 09:29:49 +01:00
francescomani
0d86181a58 using uid also in SA 2022-01-20 18:56:44 +01:00
Raymond Knopp
a3aae0dd9e made default nr_ulsim configuration not require root privileges (single-thread) 2022-01-20 12:35:13 +01:00
Raymond Knopp
6afebc0e41 Merge remote-tracking branch 'origin/develop' into ldpc-decoder-codegen
Conflicts:
	openair1/SIMULATION/LTE_PHY/dlsim.c
	openair1/SIMULATION/LTE_PHY/ulsim.c
2022-01-20 07:51:29 +01:00
Raymond Knopp
1f9900ba61 LDPC decoder generator cleanup 2022-01-19 23:01:27 +01:00
Raymond Knopp
8d164fe2aa Merge remote-tracking branch 'origin/develop' into ldpc-decoder-codegen 2022-01-19 20:06:08 +01:00
Raymond Knopp
4caafc7292 removal of lingering .o files in LDPC decoder generator directories. Merge conflict in CMakelists.txt 2022-01-19 11:25:34 +01:00
matzakos
e5899e2f74 Merge remote-tracking branch 'origin/develop' into F1C_extensions_develop 2022-01-17 13:19:45 +01:00
Raymond Knopp
7090db60bc Merge remote-tracking branch 'origin/physim-hotfix' into ldpc-decoder-codegen 2022-01-13 10:35:32 +01:00
Raymond Knopp
08100357f7 Merge remote-tracking branch 'origin/develop' into ldpc-decoder-codegen 2022-01-13 09:51:08 +01:00
Raymond Knopp
f44d1ccfeb reduced memory requirements of dlsim,ulsim 2022-01-12 14:21:47 +01:00
Raymond Knopp
7d9b3464a8 Merge branch 'ldpc-decoder-codegen' of https://gitlab.eurecom.fr/oai/openairinterface5g into ldpc-decoder-codegen
Conflicts:
	cmake_targets/CMakeLists.txt
	cmake_targets/ldpctest_BG_1_Zc_384_rate_1-3_block_length_8448_maxit_5.txt
	openair1/PHY/CODING/nrLDPC_decoder.c
	openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
	openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_mPass.h_native_memcpy
	openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/generator_bnProc/bnProc_gen_avx2
	openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/generator_bnProc_avx512/bnProc_gen_avx512
2022-01-05 14:55:13 +01:00
Raymond Knopp
74ce2cf4be to trigger CI 2022-01-05 01:27:42 +01:00
Raymond Knopp
40a9792fef build_oai flag to turn off AVX512 generation on machines that have it. Needed for caracal at EURECOM because of CUDA compiler which doesn't like the flag. Added creation of threadpool in nr_ulsim to test channel decoding parallelization on different high CPU count machines 2021-12-24 21:36:06 +01:00
Raymond Knopp
13b8abc310 Merge branch 'develop' into ldpc-decoder-codegen
Conflicts:
	cmake_targets/CMakeLists.txt
	cmake_targets/build_oai
	openair1/PHY/TOOLS/time_meas.h
2021-12-24 18:19:13 +01:00
Sy
cd2b80e6c2 some cleanup 2021-12-22 22:36:42 +01:00
Raymond Knopp
2d4453648f Correct how gtp-u extension header is parsed 2021-12-15 18:38:25 +01:00
Sy
5521e34360 my Internship project 2021-11-25 17:34:02 +01:00
Raymond Knopp
12792eece7 Modifications in the cellGroupConfig container content of F1 UE context response messages 2021-11-19 18:52:51 +01:00
matzakos
e8d92cbddd Merge remote-tracking branch 'origin/NR_F1C_F1U_extensions' into F1C_extensions_develop 2021-11-19 16:47:47 +01:00
Raymond Knopp
e51cd863fe Merge branch 'bler_txoptim' into F1C_extensions_develop
Conflicts:
	cmake_targets/CMakeLists.txt
	common/utils/nr/nr_common.c
	openair1/PHY/INIT/nr_parms.c
	openair1/PHY/NR_TRANSPORT/pucch_rx.c
	openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
	openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
	openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
	openair1/SCHED_NR/fapi_nr_l1.c
	openair1/SCHED_NR/phy_procedures_nr_gNB.c
	openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
	openair1/SIMULATION/NR_PHY/dlschsim.c
	openair1/SIMULATION/NR_PHY/dlsim.c
	openair2/GNB_APP/gnb_config.c
	openair2/LAYER2/NR_MAC_UE/config_ue.c
	openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c
	openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
	openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
	openair2/LAYER2/NR_MAC_gNB/main.c
	openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
	openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
	openair2/RRC/NR/L2_nr_interface.c
	openair2/RRC/NR/MESSAGES/asn1_msg.c
	openair2/RRC/NR/MESSAGES/asn1_msg.h
	openair2/RRC/NR/rrc_gNB_NGAP.c
	openair3/NAS/NR_UE/nr_nas_msg_sim.c
	openair3/NAS/NR_UE/nr_nas_msg_sim.h
	openair3/ocp-gtpu/gtp_itf.cpp
	targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band41.fr1.106PRB.usrpb210.conf
	targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf
2021-11-14 21:18:50 +01:00
matzakos
40263348f9 Merge with NR_F1C_F1U_extensions and resolve conflicts 2021-11-12 17:01:27 +01:00
matzakos
188a99ca51 Temporary dirty fix to not block SRB1 traffic once SRB2 is added
-This function will change completely after update with develop
2021-11-10 18:35:52 +01:00
matzakos
cd16d7ce03 Make the call to send DCCH SDU to RLC from RRC instead of F1AP 2021-11-10 18:35:05 +01:00
matzakos
f1455f15a3 Check whether RRC Setup is available before sending CBRA Msg4
-Required for the CU/DU split case if the RRC Setup arrives later than the first opportunity to transmit Msg4
-Next extension is to decouple RRCSetup from Msg4
2021-11-10 18:33:48 +01:00
matzakos
6a1ac14447 Include mandatory transaction ID field in F1 initial UL RRC message transfer 2021-11-10 18:31:08 +01:00
matzakos
e2b4f80ac2 Add sNSSAI configuration in F1 Setup request message to the CU
-Required for interoperability with Accelleran CU and OAI CN
-Currently hardcoded values, to be modified so that they are parsed from the DU config file
-After this modification Accelleran CU sends gNBCU configuration update
2021-11-05 10:38:46 +01:00
matzakos
b103ada542 Fix decoding of SIB1 RRC container at the processing function of F1 setup request at the CU
after modifications done at the encoded SIB1 message type included in the RRC container of F1 setup request at the DU
-Some cleanup required
2021-10-26 18:30:51 +02:00
matzakos
e7f8b56b65 Include NR_SIB1_t type in F1 setup req container instead of the whole NR_BCCH_DL_SCH_Message_t message
-Wireshark is not complaining after that
-Issue at decoding F1 Setup req at the CU due to the new encoding
-Keep the previous encoding as the default for now until the CU issue is fixed
-Fix PUCCH allocation for ACK/NAK issue appearing when DU runs without OAI CU
2021-10-26 13:11:50 +02:00
matzakos
96efe9c03b Enable rrc mac config from init NR SI for the DU case 2021-10-26 12:56:32 +02:00
matzakos
11cdf1610e Update F1AP UE context release command handling function for NR
-Include ITTI message to RRC to do the actual processing at RRC layer,
 as done for the other F1AP messages. Leave LTE processing as it was for now.
2021-10-20 19:00:51 +02:00
matzakos
85faedfcbe Add triggering of F1 UE Context release command
-Add also a temporary artificial trigger just to be able to test with OAI UE
-Comment out most of the part of the UE context release command handler function at the DU in order to separate properly the RRC from F1AP functionality later.
2021-10-18 18:32:57 +02:00
matzakos
40b131be13 Small corrections in F1AP UE context management messages and indentation fixes 2021-10-13 16:45:42 +02:00
matzakos
b37195ad1f Few updates on handling master cell group configuration updates coming from the DU 2021-10-13 14:36:38 +02:00
matzakos
1a40b36193 Use correct SCTP port number for F1AP according to standards 2021-10-12 19:38:19 +02:00
matzakos
39aaf63a4e Merge with branch NR_F1C_F1U_extensions 2021-10-11 17:56:28 +02:00
matzakos
e2c88f91af Trigger dedicated RRC Reconfiguration after processing F1 UE context modification response at RRC layer of the CU
-Successful user-plane traffic over F1-U upon completion of UE context modification procedures
2021-10-08 18:29:39 +02:00
matzakos
d3899a21a6 Add implementation of UE context modification response handler at F1AP layer of the CU 2021-10-08 13:37:46 +02:00
matzakos
a1b2d222dd Generation of UE context modification response at F1AP layer of the DU
-Fix some indentations
2021-10-08 10:31:53 +02:00
matzakos
f068fb4ef3 Add handling of UE context modification request at RRC layer of the DU and trigger UE context modification response
-Next step: Proper generation of UE context modification response at F1AP layer
2021-10-06 18:43:10 +02:00
matzakos
b3c0095f07 Add handler function for UE context modification request message at F1AP layer of the DU
-Fix indentation in UE context modification request message generation function at the CU
2021-10-05 17:24:16 +02:00
matzakos
36b8bb1b5b Trigger UE context modification request at the CU upon reception of PDU Session Resource setup request from the AMF
-F1 message successfully encoded at the CU (including SRB2, DRB and F1-U tunnel configuration) and received from the DU.
-Next steps: handling of UE context modification request at the DU and triggering the UE context setup response towards the CU.
2021-10-05 13:43:19 +02:00
matzakos
a84ecd1468 Merge with branch NR_F1C_F1U_extensions 2021-09-29 13:59:06 +02:00
matzakos
55476b175f Handle UE capabilities info at the DU received through UE context setup request
-Trigger UE context setup response at the DU and RRC Reconfiguration at the CU upon reception of UE context setup response.
-Pending: The DU should generate some updates on the master cell groupconfig based also on the received UE capabilities and add them in
 the UE context setup response message so that they can be included in the RRC Reconfiguration message sent from the CU. For the moment the
 corresponding function is empty.
-Next steps: trigger UE context modification procedures
2021-09-27 18:02:13 +02:00
matzakos
5e506bfab0 Trigger F1 UE context setup request from CU after reception of NR UE capabilities
-Include UE_Capability_RAT_container_list in UE context setup request so that it gets processed at the DU
-Next steps: DU should store and process the UE capabilities and generate updates in master cell group config
to be included in UE context setup response. Then upon reception of UE context setup response, the first RRC Reconfiguration
can be triggered at the CU with the updates on master cell group config.
2021-09-24 16:36:02 +02:00
Raymond Knopp
c64362f8ec Merge remote-tracking branch 'origin/develop' into ldpc-decoder-codegen
Conflicts:
	cmake_targets/CMakeLists.txt
	cmake_targets/build_oai
2020-08-27 07:22:10 +02:00
Raymond Knopp
3bc433a5f8 bugfix from type in last commit 2020-08-27 07:18:49 +02:00
Sy
845a226410 optimized 5G NR LDPC decoder 2020-07-06 02:34:12 +02:00
Sy
c8a787d22c optimized 5G NR LDPC decoder 2020-07-03 14:21:00 +02:00
Sy
559e8fdcd2 degradation of performance in BLER fixed | bnProc & bnProcPc unrolled | small improvement in times 2020-07-01 18:37:52 +02:00
Sy
0f704894f4 degradation of performance in BLER corrected | bnProc & bnProcPc unrolled 2020-07-01 14:12:53 +02:00
Sy
5e5bc1a9e3 Effective management of all values ​​of Z (lifting size) and all R (coding rate) for BG1 & BG2 |
some improvement in decoding time | (bnProcPc reduces 2x)
2020-06-27 02:07:13 +02:00
Sy
c912762144 bnProcPc and bnProc unrolled | BN Processing, small improvement in times at the expense of degraded performance in BLER , reordering of generated files 2020-06-19 23:45:02 +02:00
Sy
394f0deb1b bnProcPc and bnProc unrolled | BN treatment, small improvement in times at the expense of degraded performance in BLER , reordering of generated files 2020-06-19 23:38:37 +02:00
Raymond Knopp
55e32f6e8c removed unnecessary include files 2020-06-06 10:57:33 +02:00
Raymond Knopp
0d65f76d46 removed system includes that were put in the repository 2020-06-06 09:32:41 +02:00
Sy
119be5d45b Re-implementation of memcpy--> more faster | llr2cnProcBuf, cn2bnProcbuf, bn2cnProcBuf are optimized 2020-06-04 02:52:35 +02:00
Sy
cb8760a44d full version of the optimized 5NR LDPC decoder | AVX2 && AVX512 options 2020-06-03 22:57:13 +02:00
Sy
9b11d0b593 full version of the optimized 5NR LDPC decoder 2020-06-03 22:51:05 +02:00
Sy
301317eca6 full version of the optimized 5NR LDPC decoder 2020-06-03 19:04:20 +02:00
Raymond Knopp
a6af0d99ce minor fix for AVX2/AVX512 switch 2020-06-02 13:19:35 +02:00
matzakos
956d9aa1d8 added selection between AVX2 and AVX512 2020-06-02 12:06:38 +02:00
Raymond Knopp
8663ee697e chages in AVX512 code generator. Yields small improvement compared to AVX2, BLER performance is still degraded. 2020-06-01 14:40:11 +02:00
Sy
c67550e531 Test for AVX512 2020-05-29 15:23:22 +02:00
Sy
265b5c4d1b Test for AVX512 2020-05-29 15:19:52 +02:00
Sy
4542322bb4 TEST AVX512 2020-05-29 15:13:56 +02:00
Sy
558fccbba7 TEST AVX512 2020-05-29 15:07:54 +02:00
Sy
b85b5fe47a Test for avx512 2020-05-29 14:57:15 +02:00
Sy
6d9ceaa712 Test for AVX512 2020-05-29 13:51:38 +02:00
Sy
5e5e487e4c Test for avx512 2020-05-29 11:58:55 +02:00
Raymond Knopp
3e27bed4f7 updates to CMakelist.txt for AVX512 options 2020-05-28 12:23:33 +02:00
Sy
bdd12a3396 Testing for avx512 2020-05-27 13:41:57 +02:00
Sy
bfad636369 Testing for avx512 2020-05-26 16:50:32 +02:00
Sy
00a8df6f8f generated CN processing files according to the values of Z | version for AVX2 and AVX512| BG1 & BG2 2020-05-25 14:34:07 +02:00
Sy
a1b81d9475 generated files for CN processing according to the values of Z | version for AVX2 and AVX512 2020-05-23 22:07:22 +02:00
Sy
140fa111c4 file generated for CN processing according to the values of Z | version for AVX2 and AVX512 2020-05-23 21:39:17 +02:00
Sy
ad32b6108e use of avx2 & avx512 at CN processing level 2020-05-19 11:49:10 +02:00
Sy
d3af4c4b8b use of avx2 & avx512 at CN processinf level 2020-05-19 11:46:09 +02:00
Sy
22fe32645b use of avx512 & avx2 at CN processing level 2020-05-18 17:05:50 +02:00
Sy
71a8d19b7d use of avx2 & avx512 at CN Processing level 2020-05-18 13:58:44 +02:00
Sy
3ed622afbd use of avx512 at CN processing level 2020-05-18 11:50:12 +02:00
Raymond Knopp
a7e6137408 unrolled 2 BNs case in generator 2020-05-09 09:14:59 +02:00
Raymond Knopp
581a9731d8 removed one-level of unrolling in cnProc generator 2020-05-08 23:24:04 +02:00
Sy
732b98d1ae adding >> 5 to all lut_startAddrCnGroups 2020-05-08 17:40:45 +02:00
Sy
fe27b81703 adding >> 5 to all lut_startAddrCnGroups 2020-05-08 17:38:44 +02:00
Sy
66c30b9e1d adding >> 5 to all lut_startAddrCnGroups 2020-05-08 17:15:50 +02:00
Raymond Knopp
9db8db256a LUT memory access fix for code generator 2020-05-08 15:26:52 +02:00
Sy
e785891fb1 integration of the generated file (nrLDPC_cnProc_BG1_Z384_13 with the LDPC decoder at the base 2020-05-07 16:28:01 +02:00
Raymond Knopp
f8fbd26b57 more cleanup and testing 2020-05-04 13:18:47 +02:00
Raymond Knopp
fa3a637b72 cleanup of generator, added directory/file creation for output 2020-05-04 11:25:09 +02:00
Raymond Knopp
550ab5009b fixed compilation of generator 2020-05-04 10:19:37 +02:00
Raymond Knopp
cabbb72c0f modifications to Makefile to include OPENAIR_HOME path and activate debugging symbols 2020-05-04 09:45:11 +02:00
Sy
0ee70df312 first commit 2020-05-02 23:35:18 +02:00
570 changed files with 182323 additions and 29030 deletions

31
.vscode/launch.json vendored
View File

@@ -1,31 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmake_targets/ran_build/build/lte-softmodem",
"args": [
"-O", "../ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf",
"--noS1"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/cmake_targets",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "${workspaceFolder}/cmake_targets/sudo-gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}

View File

@@ -21,8 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 31; //0;
servingCellConfigCommon = (
{
#spCellConfigCommon

View File

@@ -32,7 +32,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (
{

View File

@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 31; //0;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (

View File

@@ -32,7 +32,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (

View File

@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
min_rxtxtime = 6;
servingCellConfigCommon = (

View File

@@ -44,7 +44,6 @@ gNBs =
local_s_portd = 2152;
remote_s_portc = 500;
remote_s_portd = 2152;
ssb_SubcarrierOffset = 0;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (

View File

@@ -36,7 +36,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (

View File

@@ -37,7 +37,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts_XP = 2;
pusch_AntennaPorts = 2;

View File

@@ -38,7 +38,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts_XP = 2;
pusch_AntennaPorts = 2;

View File

@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
min_rxtxtime = 6;
servingCellConfigCommon = (

View File

@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
min_rxtxtime = 6;
servingCellConfigCommon = (

View File

@@ -19,7 +19,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 31; //0;
pdsch_AntennaPorts_XP = 2;
pusch_AntennaPorts = 2;
ul_prbblacklist = "51,52,53,54"

View File

@@ -41,7 +41,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pusch_AntennaPorts = 2;
ul_prbblacklist = "51,52,53,54"
do_SRS = 1;

View File

@@ -37,7 +37,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts_XP = 2;
pusch_AntennaPorts = 2;
ul_prbblacklist = "51,52,53,54"

View File

@@ -37,7 +37,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pusch_AntennaPorts = 2;
ul_prbblacklist = "51,52,53,54"
do_SRS = 1;

View File

@@ -37,7 +37,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
#pusch_TargetSNRx10 = 200;
#pucch_TargetSNRx10 = 200;
ul_prbblacklist = "51,52,53,54"

View File

@@ -37,7 +37,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts_XP = 2;
pusch_AntennaPorts = 2;
#pusch_TargetSNRx10 = 200;

View File

@@ -21,7 +21,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
min_rxtxtime = 6;
servingCellConfigCommon = (

View File

@@ -19,7 +19,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 31; //0;
servingCellConfigCommon = (
{

View File

@@ -20,7 +20,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 31; //0;
min_rxtxtime = 6;
servingCellConfigCommon = (

View File

@@ -32,7 +32,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (

View File

@@ -32,9 +32,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
sib1_tda = 15;
min_rxtxtime = 6;

View File

@@ -529,14 +529,14 @@ class Dashboard:
mr_notes = editable_mr.notes.list(all=True)
body = '[Consolidated Test Results](https://oaitestdashboard.s3.eu-west-1.amazonaws.com/MR'+mr+'/index.html)\\\n'
body += 'Tested CommitID: ' + commit + '\\\n'
body += 'Tested CommitID: ' + commit
for i in range(0,n_tests):
jobname = args[4*i]
buildurl = args[4*i+1]
buildid = args[4*i+2]
status = args[4*i+3]
body += jobname+': **'+status+'** ([' + buildid + '](' + buildurl + '))\\\n'
body += '\\\n' + jobname + ': **'+status+'** ([' + buildid + '](' + buildurl + '))'
#create new note
mr_note = editable_mr.notes.create({

View File

@@ -32,7 +32,7 @@
<testCase id="000001">
<class>Build_eNB</class>
<desc>Build gNB</desc>
<Build_eNB_args>-w USRP -c --gNB --ninja</Build_eNB_args>
<Build_eNB_args>-w USRP -c --gNB --ninja --noavx512</Build_eNB_args>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
<forced_workspace_cleanup>True</forced_workspace_cleanup>

View File

@@ -50,7 +50,7 @@
<testCase id="000002">
<class>Build_eNB</class>
<desc>Build gNB</desc>
<Build_eNB_args>-w USRP -c --gNB --ninja</Build_eNB_args>
<Build_eNB_args>-w USRP -c --gNB --ninja --noavx512</Build_eNB_args>
<eNB_instance>1</eNB_instance>
<eNB_serverId>1</eNB_serverId>
<backgroundBuild>True</backgroundBuild>

View File

@@ -34,7 +34,7 @@
<mode>TesteNB</mode>
<class>Build_eNB</class>
<desc>Build gNB (USRP)</desc>
<Build_eNB_args>--gNB -w USRP --ninja --cmake-opt -DBoost_INCLUDE_DIR=/usr/include/boost169</Build_eNB_args>
<Build_eNB_args>--gNB -w USRP --ninja --cmake-opt -DBoost_INCLUDE_DIR=/usr/include/boost169 --noavx512</Build_eNB_args>
<forced_workspace_cleanup>True</forced_workspace_cleanup>
</testCase>

View File

@@ -32,7 +32,7 @@
<testCase id="000001">
<class>Build_PhySim</class>
<desc>Build for physical simulator</desc>
<physim_build_args>--phy_simulators --ninja</physim_build_args>
<physim_build_args>--phy_simulators --ninja --noavx512</physim_build_args>
<forced_workspace_cleanup>FALSE</forced_workspace_cleanup>
</testCase>

View File

@@ -203,17 +203,23 @@ if (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
if(EXISTS "/proc/cpuinfo")
file(STRINGS "/proc/cpuinfo" CPUINFO REGEX flags LIMIT_COUNT 1)
if (CPUINFO MATCHES "avx2")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2")
message("NOAVX512 is ${NOAVX512}")
if (CPUINFO MATCHES "avx512bw" AND "${NOAVX512}" STREQUAL "False")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx512bw -march=skylake-avx512 -mtune=skylake-avx512 " )
set(COMPILATION_AVX2 "True")
else()
set(COMPILATION_AVX2 "False")
endif()
if (CPUINFO MATCHES "sse4_1")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1 -mpclmul")
endif()
if (CPUINFO MATCHES "ssse3")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3")
if (CPUINFO MATCHES "avx2")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2")
set(COMPILATION_AVX2 "True")
else()
set(COMPILATION_AVX2 "False")
endif()
if (CPUINFO MATCHES "sse4_1")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1 -mpclmul")
endif()
if (CPUINFO MATCHES "ssse3")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3")
endif()
endif()
else()
Message("/proc/cpuinfo does not exit. We will use manual CPU flags")
@@ -224,11 +230,11 @@ set(C_FLAGS_PROCESSOR " ${C_FLAGS_PROCESSOR} ${CFLAGS_PROCESSOR_USER}")
Message("C_FLAGS_PROCESSOR is ${C_FLAGS_PROCESSOR}")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
if ( (NOT( C_FLAGS_PROCESSOR MATCHES "ssse3")) OR (NOT( C_FLAGS_PROCESSOR MATCHES "msse4.1")) )
Message(FATAL_ERROR "For x86 Architecture, you must have following flags: -mssse3 -msse4.1. The current detected flags are: ${C_FLAGS_PROCESSOR}. You can pass the flags manually in build script, for example: ./build_oai --cflags_processor \"-mssse3 -msse4.1 -mavx2\" ")
endif()
endif()
#if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
# if ( (NOT( C_FLAGS_PROCESSOR MATCHES "ssse3")) OR (NOT( C_FLAGS_PROCESSOR MATCHES "msse4.1")) )
# Message(FATAL_ERROR "For x86 Architecture, you must have following flags: -mssse3 -msse4.1. The current detected flags are: ${C_FLAGS_PROCESSOR}. You can pass the flags manually in build script, for example: ./build_oai --cflags_processor \"-mssse3 -msse4.1 -mavx2\" ")
# endif()
#endif()
#
# add autotools definitions that were maybe used!
@@ -247,6 +253,22 @@ add_boolean_option(SANITIZE_ADDRESS False "enable the address sanitizer (ASan)")
if (SANITIZE_ADDRESS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common")
# There seems to be some incompatibility with pthread_create and the RT scheduler, which
# results in pthread_create hanging.
#
# When we switch from Ubuntu 16.04 to 18.04, we found that running with the address sanitizer,
# the pthread_create function calls were not working. The inital thought was that we were
# trying to create a thread that was not-blocking and would eventually crash the machine during
# the run. After more debugging, we found that we would never even start the thread. We narrowed
# down the first two instances of pthread_create in the gNB and NR UE to be sctp_eNB_task and
# one_thread, respectively. We found that adding sleeps, and various other pauses to the threads
# had not effect. From there, we found that if we add an abort(); prior to the thread loop, we
# do not execute that. This indicated to us that the problem is not likely to be a non-blocking
# thread, but perhaps and issue with pthread_create itself. From there we begain to research the
# issue on the web. See: https://github.com/google/sanitizers/issues/1125
#
# Google searching indicates this appears to be a problem since at least 2018. This could be something
# wrong in the pthread library, or something subtly wrong in this CMakeLists.txt. Use Ubuntu 20.04 instead.
endif ()
add_definitions("-DASN_DISABLE_OER_SUPPORT")
@@ -1384,8 +1406,11 @@ set(PHY_NR_CODINGIF
)
add_library(ldpc_orig MODULE ${PHY_LDPC_ORIG_SRC} )
target_link_libraries(ldpc_orig PRIVATE ldpc_gen_HEADERS)
add_library(ldpc_optim MODULE ${PHY_LDPC_OPTIM_SRC} )
target_link_libraries(ldpc_optim PRIVATE ldpc_gen_HEADERS)
add_library(ldpc_optim8seg MODULE ${PHY_LDPC_OPTIM8SEG_SRC} )
target_link_libraries(ldpc_optim8seg PRIVATE ldpc_gen_HEADERS)
add_library(ldpc_cl MODULE ${PHY_LDPC_CL_SRC} )
target_link_libraries(ldpc_cl OpenCL)
add_dependencies(ldpc_cl nrLDPC_decoder_kernels_CL)
@@ -1397,6 +1422,7 @@ if (CUDA_FOUND)
endif (CUDA_FOUND)
add_library(ldpc MODULE ${PHY_LDPC_OPTIM8SEGMULTI_SRC} )
target_link_libraries(ldpc PRIVATE ldpc_gen_HEADERS)
add_library(coding MODULE ${PHY_TURBOSRC} )
@@ -1407,13 +1433,9 @@ add_library(dfts MODULE ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts.c )
set(PHY_SRC_COMMON
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_common.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pbch.c #Source files that had to be added after merge with sidelink
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/ulsch_demodulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_modulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_coding.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pcfich.c
# ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slss.c
# ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/sldch.c
# ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slsch.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/get_pmi.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/phich_common.c
@@ -1426,10 +1448,6 @@ set(PHY_SRC_COMMON
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/srs_modulation.c
${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_time.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c #Source files that had to be added after merge with sidelink
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/freq_equalization.c
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_cell_spec.c
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_uespec.c
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_gold.c
@@ -1525,9 +1543,6 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/prach_ue.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/pmch_ue.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/pch_ue.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/slpss.c #Transfer sidelink source files to LTE_TRANSPORT_UE
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/slsss.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/slbch.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/slss.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/sldch.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/slsch.c
@@ -1536,7 +1551,6 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/ulsch_coding.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/rar_tools_ue.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/initial_sync.c
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/initial_syncSL.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep.c
${OPENAIR1_DIR}/PHY/MODULATION/slot_fep_mbsfn.c
${OPENAIR1_DIR}/PHY/MODULATION/ul_7_5_kHz_ue.c
@@ -1938,6 +1952,7 @@ set (MAC_SRC_UE
set (MAC_NR_SRC_UE
${NR_UE_PHY_INTERFACE_DIR}/NR_IF_Module.c
${NR_UE_PHY_INTERFACE_DIR}/NR_Packet_Drop.c
${NR_UE_MAC_DIR}/config_ue.c
${NR_UE_MAC_DIR}/mac_vars.c
${NR_UE_MAC_DIR}/main_ue_nr.c
@@ -3166,3 +3181,5 @@ ADD_CUSTOM_TARGET(oarf
)
include (${OPENAIR_DIR}/common/utils/telnetsrv/telnetsrv_CMakeLists.txt)
include(${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/CMakeLists.txt)
include (${OPENAIR_DIR}/common/utils/websrv/websrv_CMakeLists.txt)

View File

@@ -1062,7 +1062,8 @@
(Test3: PBCH-only, 217 PRB),
(Test4: PBCH and synchronization, 217 RPB),
(Test5: PBCH-only, 273 PRB),
(Test6: PBCH and synchronization, 273 PRB)</desc>
(Test6: PBCH and synchronization, 273 PRB),
(Test7: PBCH and synchronization, 106PBR, SSB SC OFFSET 6)</desc>
<pre_compile_prog></pre_compile_prog>
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
<compile_prog_args> --phy_simulators -c </compile_prog_args>
@@ -1074,8 +1075,9 @@
-s-11 -S-8 -n10 -R217
-s-11 -S-8 -n10 -o8000 -I -R217
-s-11 -S-8 -n10 -R273
-s-11 -S-8 -n10 -o8000 -I -R273</main_exec_args>
<tags>nr_pbchsim.test1 nr_pbchsim.test2 nr_pbchsim.test3 nr_pbchsim.test4 nr_pbchsim.test5 nr_pbchsim.test6</tags>
-s-11 -S-8 -n10 -o8000 -I -R273
-s-11 -S-8 -n10 -R106 -O6</main_exec_args>
<tags>nr_pbchsim.test1 nr_pbchsim.test2 nr_pbchsim.test3 nr_pbchsim.test4 nr_pbchsim.test5 nr_pbchsim.test6 nr_pbchsim.test7</tags>
<search_expr_true>PBCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns>
@@ -1105,7 +1107,8 @@
(Test20: Mapping type B, 4 DMRS Symbols),
(Test21: 4x4 MIMO, 1 Layer),
(Test22: 4x4 MIMO, 2 Layers),
(Test23: 25 PRBs, 15 kHz SCS)</desc>
(Test23: 25 PRBs, 15 kHz SCS)
(Test24: MCS 0, low SNR performance)</desc>
<pre_compile_prog></pre_compile_prog>
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
<compile_prog_args> --phy_simulators -c </compile_prog_args>
@@ -1134,8 +1137,9 @@
-n100 -s2 -U 2 1 3
-n10 -s20 -U 3 0 0 2 -gR -x1 -y4 -z4
-n10 -s20 -U 3 0 0 2 -gR -x2 -y4 -z4
-n100 -m0 -e0 -R25 -b25 -i 2 1 0</main_exec_args>
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11 nr_dlsim.test12 nr_dlsim.test13 nr_dlsim.test14 nr_dlsim.test15 nr_dlsim.test16 nr_dlsim.test17 nr_dlsim.test18 nr_dlsim.test19 nr_dlsim.test20 nr_dlsim.test21 nr_dlsim.test22 nr_dlsim.test23</tags>
-n100 -m0 -e0 -R25 -b25 -i 2 1 0
-n100 -e0 -t95 -S-1.0 -i 2 1 0</main_exec_args>
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11 nr_dlsim.test12 nr_dlsim.test13 nr_dlsim.test14 nr_dlsim.test15 nr_dlsim.test16 nr_dlsim.test17 nr_dlsim.test18 nr_dlsim.test19 nr_dlsim.test20 nr_dlsim.test21 nr_dlsim.test22 nr_dlsim.test23 nr_dlsim.test24</tags>
<search_expr_true>PDSCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns>
@@ -1314,7 +1318,8 @@
(Test18: 25 PRBs, 15 kHz SCS),
(Test19: 3GPP G-FR1-A4-13 2 RX Antennas Requirements Test),
(Test20: 3GPP G-FR1-A4-13 4 RX Antennas Requirements Test),
(Test21: 3GPP G-FR1-A4-13 8 RX Antennas Requirements Test)</desc>
(Test21: 3GPP G-FR1-A4-13 8 RX Antennas Requirements Test),
(Test22: MCS 0, low SNR performance)</desc>
<pre_compile_prog></pre_compile_prog>
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
<compile_prog_args> --phy_simulators -c </compile_prog_args>
@@ -1341,9 +1346,9 @@
-n100 -u0 -m0 -R25 -r25 -i 2 1 0
-m16 -r106 -s8.8 -S9.4 -z2 -n200 -U 4 1 1 1 2 -gI -b14 -t70 -I15 -i 2 1 0
-m16 -r106 -s5.4 -S6 -z4 -n200 -U 4 1 1 1 2 -gI -b14 -t70 -I15 -i 2 1 0
-m16 -r106 -s3.4 -S3.8 -z8 -n200 -U 4 1 1 1 2 -gI -b14 -t70 -I15 -i 2 1 0</main_exec_args>
<tags>nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3 nr_ulsim.test4 nr_ulsim.test5 nr_ulsim.test6 nr_ulsim.test7 nr_ulsim.test8 nr_ulsim.test9 nr_ulsim.test10 nr_ulsim.test11 nr_ulsim.test12 nr_ulsim.test13 nr_ulsim.test14 nr_ulsim.test15 nr_ulsim.test16 nr_ulsim.test17 nr_ulsim.test18 nr_ulsim.test19 nr_ulsim.test20 nr_ulsim.test21</tags>
-m16 -r106 -s3.4 -S3.8 -z8 -n200 -U 4 1 1 1 2 -gI -b14 -t70 -I15 -i 2 1 0
-n100 -m0 -S -0.6 -i 2 1 0</main_exec_args>
<tags>nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3 nr_ulsim.test4 nr_ulsim.test5 nr_ulsim.test6 nr_ulsim.test7 nr_ulsim.test8 nr_ulsim.test9 nr_ulsim.test10 nr_ulsim.test11 nr_ulsim.test12 nr_ulsim.test13 nr_ulsim.test14 nr_ulsim.test15 nr_ulsim.test16 nr_ulsim.test17 nr_ulsim.test18 nr_ulsim.test19 nr_ulsim.test20 nr_ulsim.test21 nr_ulsim.test22</tags>
<search_expr_true>PUSCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns>

View File

@@ -55,9 +55,10 @@ BUILD_COVERITY_SCAN=0
DISABLE_HARDWARE_DEPENDENCY="False"
CMAKE_BUILD_TYPE="RelWithDebInfo"
CMAKE_CMD="$CMAKE"
NOAVX512="False"
BUILD_ECLIPSE=0
NR="False"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope websrv"
RU=0
CMAKE_C_FLAGS=()
CMAKE_CXX_FLAGS=()
@@ -164,6 +165,8 @@ Options:
Build optional shared library, <libraries> can be one or several of $OPTIONAL_LIBRARIES or \"all\"
--usrp-recplay
Build for I/Q record-playback modes
--noavx512
Build without AVX512 if it is present on CPU
-k | --skip-shared-libraries
Skip build for shared libraries to reduce compilation time when building frequently for debugging purposes
--ninja
@@ -436,6 +439,10 @@ function main() {
fi
fi
shift 2;;
--noavx512)
NOAVX512="True"
echo_info "Disabling AVX512"
shift 1;;
-k | --skip-shared-libraries)
SKIP_SHARED_LIB_FLAG="True"
echo_info "Skipping build of shared libraries, rfsimulator and transport protocol libraries"
@@ -445,6 +452,7 @@ function main() {
MAKE_CMD=ninja
shift;;
--sanitize-address | -fsanitize=address)
grep -sq "Ubuntu 18.04" /etc/os-release && echo_error "Bug in OS with this option, see CMakeLists.txt"
CMAKE_CMD="$CMAKE_CMD -DSANITIZE_ADDRESS=True"
shift;;
--ittiSIM)
@@ -624,6 +632,7 @@ function main() {
cd $DIR/$BUILD_DIR/build
if [[ ${#CMAKE_C_FLAGS[@]} > 0 ]]; then CMAKE_CMD="$CMAKE_CMD -DCMAKE_C_FLAGS=\"${CMAKE_C_FLAGS[*]}\""; fi
if [[ ${#CMAKE_CXX_FLAGS[@]} > 0 ]]; then CMAKE_CMD="$CMAKE_CMD -DCMAKE_CXX_FLAGS=\"${CMAKE_CXX_FLAGS[*]}\""; fi
CMAKE_CMD="$CMAKE_CMD -DNOAVX512=\"${NOAVX512[*]}\""
echo_info "running $CMAKE_CMD"
eval $CMAKE_CMD ../..

View File

@@ -109,6 +109,7 @@ check_supported_distribution() {
"ubuntu18.04") return 0 ;;
"ubuntu16.04") return 0 ;;
"fedora35") return 0 ;;
"fedora36") return 0 ;;
"rhel7") return 0 ;;
"rhel7.6") return 0 ;;
"rhel7.7") return 0 ;;
@@ -196,8 +197,8 @@ check_warnings() {
#argument:
# $1: log file
check_errors() {
#we look for 'warning:' in the compilation log file
error_count=`grep "error:" "$1" | wc -l`
#we look for 'error:' in the compilation log file
error_count=`grep -c "error:" "$1"`
if [ $error_count -gt 0 ]; then
echo_error "ERROR: $error_count error. See $1"
fi
@@ -623,7 +624,6 @@ check_install_additional_tools (){
android-tools-adb \
wvdial \
sshpass \
nscd \
bc \
ntp"
elif [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then
@@ -648,7 +648,6 @@ check_install_additional_tools (){
wvdial \
numpy \
sshpass \
nscd \
python2-paramiko \
python-pyroute2 \
python-netifaces \
@@ -676,7 +675,6 @@ check_install_additional_tools (){
wvdial \
python-numpy \
sshpass \
nscd \
python-paramiko \
python-pyroute2 \
python-netifaces \

View File

@@ -88,6 +88,8 @@ int processoption(paramdef_t *cfgoptions, char *value) {
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1);
sprintf(*(cfgoptions->strptr), "%s",tmpval);
} else {
AssertFatal( ( strlen(*(cfgoptions->strptr)) < cfgoptions->numelt), "[CONFIG] Error: %s too long, %s value cannot exceed %i bytes\n",
cfgoptions->optname,tmpval, cfgoptions->numelt) ;
sprintf( (char *)(cfgoptions->strptr), "%s",tmpval);
}

View File

@@ -88,13 +88,32 @@ int load_config_sharedlib(configmodule_interface_t *cfgptr) {
st = -1;
}
if ( cfgptr->rtflags & CONFIG_SAVERUNCFG ) {
sprintf (fname,"config_%s_set",cfgptr->cfgmode);
cfgptr->set = dlsym(lib_handle,fname);
if (cfgptr->set == NULL ) {
printf("[CONFIG] %s %d no function %s for config mode %s\n",
__FILE__, __LINE__,fname, cfgptr->cfgmode);
st = -1;
}
sprintf (fname,"config_%s_write_parsedcfg",cfgptr->cfgmode);
cfgptr->write_parsedcfg = dlsym(lib_handle,fname);
if (cfgptr->write_parsedcfg == NULL ) {
printf("[CONFIG] %s %d no function %s for config mode %s\n",
__FILE__, __LINE__,fname, cfgptr->cfgmode);
}
}
sprintf (fname,"config_%s_end",cfgptr->cfgmode);
cfgptr->end = dlsym(lib_handle,fname);
if (cfgptr->getlist == NULL ) {
if (cfgptr->end == NULL ) {
printf("[CONFIG] %s %d no function %s for config mode %s\n",
__FILE__, __LINE__,fname, cfgptr->cfgmode);
}
}
return st;
@@ -186,6 +205,7 @@ configmodule_interface_t *load_configmodule(int argc,
uint32_t initflags)
{
char *cfgparam=NULL;
char *modeparams=NULL;
char *cfgmode=NULL;
char *strtokctx=NULL;
@@ -193,7 +213,8 @@ configmodule_interface_t *load_configmodule(int argc,
uint32_t tmpflags=0;
int i;
int OoptIdx=-1;
int OWoptIdx=-1;
printf("CMDLINE: ");
for (int i=0; i<argc; i++)
printf("\"%s\" ", argv[i]);
@@ -208,7 +229,11 @@ configmodule_interface_t *load_configmodule(int argc,
cfgparam = argv[i+1];
OoptIdx=i;
}
char *OWopt = strstr(argv[i],"OW");
if ( OWopt == argv[i]+2) {
OWoptIdx=i;
}
if ( strstr(argv[i], "help_config") != NULL ) {
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params),CONFIG_SECTIONNAME);
exit(0);
@@ -258,6 +283,11 @@ configmodule_interface_t *load_configmodule(int argc,
/* argv[0] is the exec name, always Ok */
cfgptr->argv_info[0] |= CONFIG_CMDLINEOPT_PROCESSED;
/* When reuested _(_--OW or rtflag is 5), a file with config parameters, as defined after all processing, will be created */
if (OWoptIdx >= 0) {
cfgptr->argv_info[OWoptIdx] |= CONFIG_CMDLINEOPT_PROCESSED;
cfgptr->rtflags |= CONFIG_SAVERUNCFG ;
}
/* when OoptIdx is >0, -O option has been detected at position OoptIdx
* we must memorize arv[OoptIdx is Ok */
if (OoptIdx >= 0) {
@@ -294,14 +324,18 @@ configmodule_interface_t *load_configmodule(int argc,
printf("%s ",cfgptr->cfgP[i]);
}
printf(", debug flags: 0x%08x\n",cfgptr->rtflags);
if (cfgptr->rtflags & CONFIG_PRINTPARAMS) {
cfgptr->status = malloc(sizeof(configmodule_status_t));
}
if (strstr(cfgparam,CONFIG_CMDLINEONLY) == NULL) {
i=load_config_sharedlib(cfgptr);
if (i == 0) {
printf("[CONFIG] config module %s loaded\n",cfgmode);
Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].uptr=&(cfgptr->rtflags);
int idx = config_paramidx_fromname(Config_Params, CONFIG_PARAMLENGTH(Config_Params), CONFIGP_DEBUGFLAGS);
Config_Params[idx].uptr=&(cfgptr->rtflags);
idx = config_paramidx_fromname(Config_Params, CONFIG_PARAMLENGTH(Config_Params), CONFIGP_TMPDIR);
Config_Params[idx].strptr=&(cfgptr->tmpdir);
config_get(Config_Params,CONFIG_PARAMLENGTH(Config_Params), CONFIG_SECTIONNAME );
} else {
fprintf(stderr,"[CONFIG] %s %d config module \"%s\" couldn't be loaded\n", __FILE__, __LINE__,cfgmode);
@@ -313,7 +347,10 @@ configmodule_interface_t *load_configmodule(int argc,
cfgptr->getlist = config_cmdlineonly_getlist;
cfgptr->end = (configmodule_endfunc_t)nooptfunc;
}
printf("[CONFIG] debug flags: 0x%08x\n",cfgptr->rtflags);
if (modeparams != NULL) free(modeparams);
if (cfgmode != NULL) free(cfgmode);
@@ -326,10 +363,28 @@ configmodule_interface_t *load_configmodule(int argc,
return cfgptr;
}
/* Possibly write config file, with parameters which have been read and after command line parsing */
void write_parsedcfg(void) {
if ( cfgptr->status && (cfgptr->rtflags & CONFIG_SAVERUNCFG)) {
printf_params("[CONFIG] Runtime params creation status: %i null values, %i errors, %i empty list or array, %i successfull \n",
cfgptr->status->num_err_nullvalue,
cfgptr->status->num_err_write,
cfgptr->status->emptyla,
cfgptr->status->num_write);
}
if (cfgptr != NULL) {
if (cfgptr->write_parsedcfg != NULL) {
printf ("[CONFIG] calling config module write_parsedcfg function...\n");
cfgptr->write_parsedcfg();
}
}
}
/* free memory allocated when reading parameters */
/* config module could be initialized again after this call */
void end_configmodule(void) {
write_parsedcfg();
if (cfgptr != NULL) {
if (cfgptr->end != NULL) {
printf ("[CONFIG] calling config module end function...\n");
@@ -355,7 +410,10 @@ void end_configmodule(void) {
void free_configmodule(void) {
if (cfgptr != NULL) {
end_configmodule();
if( cfgptr->status != NULL) {
free(cfgptr->status->debug_cfgname);
free(cfgptr->status);
}
if( cfgptr->cfgmode != NULL) free(cfgptr->cfgmode);
printf ("[CONFIG] free %i config parameter pointers\n",cfgptr->num_cfgP);

View File

@@ -54,6 +54,7 @@
#define CONFIG_DEBUGPTR (1<<1) // print memory allocation/free debug messages
#define CONFIG_DEBUGCMDLINE (1<<2) // print command line processing messages
#define CONFIG_NOABORTONCHKF (1<<4) // disable abort execution when parameter checking function fails
#define CONFIG_SAVERUNCFG (1<<5) // create config file with running values, as after cfg file + command line processing
#define CONFIG_NOEXITONHELP (1<<19) // do not exit after printing help
#define CONFIG_HELP (1<<20) // print help message
#define CONFIG_ABORT (1<<21) // config failed,abort execution
@@ -61,7 +62,20 @@
typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP);
typedef int(*configmodule_getfunc_t)(paramdef_t *,int numparams, char *prefix);
typedef int(*configmodule_getlistfunc_t)(paramlist_def_t *, paramdef_t *,int numparams, char *prefix);
typedef int(*configmodule_setfunc_t)(paramdef_t *cfgoptions, int numoptions, char *prefix );
typedef void(*configmodule_endfunc_t)(void);
typedef struct configmodule_status {
int num_paramgroups;
char ** paramgroups_names;
int num_err_nullvalue;
int emptyla;
int num_err_read;
int num_err_write;
int num_read;
int num_write;
char *debug_cfgname;
}configmodule_status_t;
typedef struct configmodule_interface {
int argc;
char **argv;
@@ -72,11 +86,15 @@ typedef struct configmodule_interface {
configmodule_initfunc_t init;
configmodule_getfunc_t get;
configmodule_getlistfunc_t getlist;
configmodule_setfunc_t set;
configmodule_endfunc_t end;
configmodule_endfunc_t write_parsedcfg;
uint32_t numptrs;
uint32_t rtflags;
char *ptrs[CONFIG_MAX_ALLOCATEDPTRS];
bool ptrsAllocated[CONFIG_MAX_ALLOCATEDPTRS];
char *tmpdir;
configmodule_status_t *status; // allocated in debug mode only
} configmodule_interface_t;
#ifdef CONFIG_LOADCONFIG_MAIN
@@ -89,16 +107,19 @@ static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbgl[debugfl
incp parameter can be used to define the include path used for config files (@include directive)\n \
defaults is set to the path of the main config file.\n";
#define CONFIG_SECTIONNAME "config"
#define CONFIGPARAM_DEBUGFLAGS_IDX 0
#define CONFIG_HELP_TMPDIR "<Repository to create temporary file>"
#define CONFIG_SECTIONNAME "config"
#define CONFIGP_DEBUGFLAGS "debugflags"
#define CONFIGP_TMPDIR "tmpdir"
static paramdef_t Config_Params[] = {
/*-----------------------------------------------------------------------------------------------------------------------*/
/* config parameters for config module */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-----------------------------------------------------------------------------------------------------------------------*/
{"debugflags", config_helpstr, 0, uptr:NULL, defintval:0, TYPE_MASK, 0},
/*--------------------------------------------------------------------------------------------------------------------------*/
/* config parameters for config module */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------*/
{CONFIGP_DEBUGFLAGS, config_helpstr, 0, uptr:NULL, defintval:0, TYPE_MASK, 0},
{CONFIGP_TMPDIR, CONFIG_HELP_TMPDIR,PARAMFLAG_NOFREE, strptr:NULL, defstrval:"/tmp" ,TYPE_STRING, 0},
};
#else
@@ -113,6 +134,7 @@ extern configmodule_interface_t *cfgptr;
#define CONFIG_ENABLECMDLINEONLY (1<<1)
extern configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags);
extern void end_configmodule(void);
extern void write_parsedcfg(void);
#define CONFIG_PRINTF_ERROR(f, x... ) if (isLogInitDone ()) { LOG_E(ENB_APP,f,x);} else {printf(f,x);}; if ( !CONFIG_ISFLAGSET(CONFIG_NOABORTONCHKF) ) exit_fun("exit because configuration failed\n");

View File

@@ -46,6 +46,7 @@
#define PARAMFLAG_NOFREE (1 << 3) // don't free parameter in end function
#define PARAMFLAG_BOOL (1 << 4) // integer param can be 0 or 1
#define PARAMFLAG_CMDLINE_NOPREFIXENABLED (1 << 5) // on the command line, allow a parameter to be specified without the prefix
#define PARAMFLAG_CMDLINEONLY (1 << 6) // this parameter cannot be specified in config file
/* Flags used by config modules to return info to calling modules and/or to for internal usage*/
#define PARAMFLAG_MALLOCINCONFIG (1 << 15) // parameter allocated in config module

View File

@@ -237,6 +237,9 @@ int config_get(paramdef_t *params, int numparams, char *prefix) {
if (ret >= 0) {
config_process_cmdline(params, numparams, prefix);
if ( cfgif->rtflags & CONFIG_SAVERUNCFG ) {
config_get_if()->set(params, numparams, prefix);
}
config_execcheck(params, numparams, prefix);
}
@@ -271,9 +274,11 @@ int config_getlist(paramlist_def_t *ParamList, paramdef_t *params, int numparams
char cfgpath[MAX_OPTNAME_SIZE*2 + 6]; /* prefix.listname.[listindex] */
for (int i = 0; i < ParamList->numelt; ++i) {
// TODO config_process_cmdline?
sprintf(cfgpath, "%s.[%i]", newprefix, i);
config_process_cmdline(ParamList->paramarray[i],numparams,cfgpath);
if ( config_get_if()->rtflags & CONFIG_SAVERUNCFG ) {
config_get_if()->set(ParamList->paramarray[i], numparams,cfgpath );
}
config_execcheck(ParamList->paramarray[i], numparams, cfgpath);
}

View File

@@ -34,8 +34,11 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <libgen.h>
#include <time.h>
#include <libgen.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <netdb.h>
#include "config_libconfig.h"
#include "config_libconfig_private.h"
@@ -87,8 +90,222 @@ int read_intarray(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpat
return cfgoptions->numelt;
}
int config_libconfig_setparams(paramdef_t *cfgoptions, int numoptions, config_setting_t * asetting, char * prefix) {
int status;
int errors=0;
int notused=0;
int emptyla=0;
#define LIBCONFIG_NOTUSED_PARAMS "Not used? (NULL value ptr)"
char *secprefix=(prefix==NULL)?"":prefix;
for(int i=0; i<numoptions; i++) {
if (cfgoptions[i].paramflags & PARAMFLAG_CMDLINEONLY) {
continue;
printf_params("[LIBCONFIG] setting %s.%s skipped (command line only) \n",secprefix,cfgoptions[i].optname);
}
status=CONFIG_FALSE;
config_setting_t * psetting;
char *spath=malloc(((prefix==NULL)?0:strlen(prefix))+strlen(cfgoptions[i].optname)+10);
sprintf(spath,"%s%s%s",secprefix, (prefix==NULL)?"":".", cfgoptions[i].optname);
psetting = config_lookup(&(libconfig_privdata.runtcfg),spath);
free(spath);
if (psetting != NULL) {
printf_params("[LIBCONFIG] setting %s.%s already created \n",secprefix,cfgoptions[i].optname);
continue;
}
switch(cfgoptions[i].type) {
case TYPE_STRING:
psetting =config_setting_add(asetting,cfgoptions[i].optname,CONFIG_TYPE_STRING);
if (psetting!= NULL) {
char *value;
if (cfgoptions[i].strptr == NULL) {
notused++;
value=LIBCONFIG_NOTUSED_PARAMS;
} else {
if (cfgoptions[i].numelt == 0 ) {
value = *(cfgoptions[i].strptr);
} else {
value = (char *)(cfgoptions[i].strptr);
}
}
status=config_setting_set_string(psetting, value);
}
break;
case TYPE_STRINGLIST:
psetting =config_setting_add(asetting,cfgoptions[i].optname,CONFIG_TYPE_LIST);
if (psetting!= NULL)
{
if(cfgoptions[i].numelt <= 0) {
emptyla++;
printf_params("[LIBCONFIG], no element in list %s\n",cfgoptions[i].optname);
status=CONFIG_TRUE;
}
for (int j=0; j<cfgoptions[i].numelt ; j++) {
config_setting_t *elemsetting=config_setting_set_string_elem(psetting, -1,cfgoptions[i].strptr[j] );
if (elemsetting == NULL) {
fprintf(stderr,"[LIBCONFIG] Error: Creating list %s element %i value %s\n",cfgoptions[i].optname,j,cfgoptions[i].strptr[j]);
break;
} else
status=CONFIG_TRUE;
}
}
break;
case TYPE_UINT8:
case TYPE_INT8:
case TYPE_UINT16:
case TYPE_INT16:
case TYPE_UINT32:
case TYPE_INT32:
case TYPE_MASK:
psetting =config_setting_add(asetting,cfgoptions[i].optname,CONFIG_TYPE_INT);
if (psetting!= NULL)
status=config_setting_set_int(psetting, (int)*(cfgoptions[i].iptr) );
break;
case TYPE_UINT64:
case TYPE_INT64:
psetting =config_setting_add(asetting,cfgoptions[i].optname,CONFIG_TYPE_INT64);
if (psetting!= NULL)
status=config_setting_set_int64(psetting, (int64_t)*(cfgoptions[i].i64ptr) );
break;
case TYPE_UINTARRAY:
case TYPE_INTARRAY:
psetting =config_setting_add(asetting,cfgoptions[i].optname,CONFIG_TYPE_ARRAY);
if (psetting!= NULL) {
if(cfgoptions[i].numelt <= 0) {
emptyla++;
printf_params("[LIBCONFIG], no element in array %s.%s\n",secprefix,cfgoptions[i].optname);
status=CONFIG_TRUE;
}
for (int j=0; j<cfgoptions[i].numelt ; j++) {
config_setting_t *elemsetting=config_setting_set_int_elem(psetting, -1,(int)(cfgoptions[i].iptr[j]) );
if (elemsetting == NULL) {
fprintf(stderr,"[LIBCONFIG] Error: Creating array %s.%s, at index %i value %i\n",secprefix,cfgoptions[i].optname,j,(int)(cfgoptions[i].iptr[j]));
break;
} else
status=CONFIG_TRUE;
}
}
break;
case TYPE_DOUBLE:
psetting =config_setting_add(asetting,cfgoptions[i].optname,CONFIG_TYPE_FLOAT);
if (psetting!= NULL)
status=config_setting_set_float(psetting, (double)*(cfgoptions[i].dblptr) );
break;
case TYPE_IPV4ADDR:
psetting =config_setting_add(asetting,cfgoptions[i].optname,CONFIG_TYPE_STRING);
if (psetting!= NULL) {
char ipstr[INET_ADDRSTRLEN];
if (inet_ntop(AF_INET, cfgoptions[i].uptr, ipstr, INET_ADDRSTRLEN) == NULL) {
notused++;
sprintf(ipstr,"undef");
} else {
status=config_setting_set_string(psetting, ipstr);
}
}
break;
case TYPE_LIST:
break;
default:
fprintf(stderr,"[LIBCONFIG] %s.%s type %i not supported\n",secprefix,cfgoptions[i].optname ,cfgoptions[i].type);
status=CONFIG_FALSE;
break;
} /* switch on param type */
if (status != CONFIG_TRUE) {
errors++;
fprintf(stderr,"[LIBCONFIG] Error creating setting %i: %s.%s type %i\n",i,secprefix,cfgoptions[i].optname ,cfgoptions[i].type);
}
}
printf_params("[LIBCONFIG], in group \"%s\" %i settings \n",secprefix,numoptions);
if (notused > 0)
printf_params("[LIBCONFIG], ..... %i settings with NULL value pointer\n",notused);
if (errors >0)
fprintf(stderr,"[LIBCONFIG] .....%i settings creation errors \n",errors);
if (emptyla >0)
fprintf(stderr,"[LIBCONFIG] .....%i empty lists or arrays settings \n",emptyla);
if ( cfgptr->status ) {
cfgptr->status->num_err_nullvalue += notused;
cfgptr->status->num_err_write += errors;
cfgptr->status->num_write += numoptions;
cfgptr->status->emptyla += emptyla;
}
return errors;
}
int config_libconfig_set(paramdef_t *cfgoptions, int numoptions, char *prefix ) {
char *tokctx1=NULL;
int listidx=-1;
char *prefixbck=NULL;
char *prefix_elem1=NULL;
config_setting_t * asetting = config_root_setting (&(libconfig_privdata.runtcfg));
if (prefix != NULL) {
prefixbck=strdup(prefix);
prefix_elem1 = strtok_r(prefixbck, ".", &tokctx1);
}
printf_params("[LIBCONFIG], processing prefix %s\n",(prefix==NULL)?"NULL":prefix);
/* parse the prefix , possibly creating groups, lists and list elements */
while (prefix_elem1 != NULL) {
int n1=strlen(prefix_elem1);
char *prefix_elem2 = prefix_elem1+n1+1 ;
printf_params("[LIBCONFIG], processing elem1 %s elem2 %s\n",prefix_elem1,prefix_elem2);
/* prefix (the path to the parameter name) may contain groups and elements from a list, which are specified with [] */
if (prefix_elem2[0] != '[') { // not a list
config_setting_t *tmpset = config_setting_lookup(asetting,prefix_elem1);
if (tmpset == NULL)
asetting = config_setting_add (asetting, prefix_elem1, CONFIG_TYPE_GROUP);
else
asetting = tmpset;
printf_params("[LIBCONFIG], creating or looking for group %s: %s\n",prefix_elem1,(asetting==NULL)?"NOK":"OK");
} else { // a list
listidx=(int)strtol(prefix_elem2+1,NULL,10);
if (errno == EINVAL || errno == ERANGE) {
printf_params("[LIBCONFIG], Error %s looking for list index in %s \n",strerror(errno), prefix_elem2);
break;
}
config_setting_t *tmpset = config_setting_lookup(asetting,prefix_elem1);
if (tmpset == NULL)
asetting = config_setting_add (asetting, prefix_elem1, CONFIG_TYPE_LIST);
else
asetting = tmpset;
printf_params("[LIBCONFIG], creating or looking for list %s: %s\n",prefix_elem1,(asetting==NULL)?"NOK":"OK");
if (asetting != NULL) {
tmpset = config_setting_get_elem (asetting, listidx);
if (tmpset == NULL)
asetting = config_setting_add (asetting, NULL, CONFIG_TYPE_GROUP);
else
asetting = tmpset;
printf_params("[LIBCONFIG], creating or looking for list element %i: %s\n",listidx,(asetting==NULL)?"NOK":"OK");
}
prefix_elem1 = strtok_r(NULL, ".", &tokctx1); //skip the [x] elements we already took care of it
if (prefix_elem1 == NULL) {
fprintf(stderr, "[LICONFIG] End of parsing %s \n",prefix);
break;
}
}
if (asetting == NULL) {
fprintf(stderr,"[LIBCONFIG] Error creating setting %s %s %i\n",prefix_elem1,prefix_elem2,listidx);
}
prefix_elem1 = strtok_r(NULL, ".", &tokctx1);
}
free(prefixbck);
if (asetting != NULL) {
config_libconfig_setparams(cfgoptions, numoptions,asetting,prefix);
printf_params("[LIBCONFIG] %i settings added in group %s\n",numoptions,(prefix==NULL)?"":prefix);
return 0;
} else {
fprintf(stderr,"[LIBCONFIG] Error parsing %s params, skipped...\n",(prefix==NULL)?"":prefix);
return -1;
}
}
int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
@@ -376,14 +593,43 @@ int config_libconfig_init(char *cfgP[], int numP) {
free(tmppath);
return -1;
}
/* possibly init a libconfig struct for saving really used params */
if( cfgptr->rtflags & CONFIG_SAVERUNCFG ) {
config_init ( &(libconfig_privdata.runtcfg));
// config_set_options (&(libconfig_privdata.runtcfg), CONFIG_OPTION_ALLOW_OVERRIDES, CONFIG_TRUE);
}
free(tmppath);
return 0;
}
void config_libconfig_write_parsedcfg(void) {
if( cfgptr->rtflags & CONFIG_SAVERUNCFG ) {
char *fname=strdup(libconfig_privdata.configfile);
int newcfgflen = strlen( libconfig_privdata.configfile) + strlen(cfgptr->tmpdir) + 20;
cfgptr->status->debug_cfgname = realloc(cfgptr->status->debug_cfgname, newcfgflen);
time_t t = time(NULL);
struct tm tm = *localtime(&t);
snprintf (cfgptr->status->debug_cfgname,newcfgflen, "%s/%s-run%d_%02d_%02d_%02d%02d",cfgptr->tmpdir,basename(fname),
tm.tm_year + 1900,tm.tm_mon + 1,tm.tm_mday, tm.tm_hour, tm.tm_min);
if ( config_write_file (&(libconfig_privdata.runtcfg) , cfgptr->status->debug_cfgname) != CONFIG_TRUE) {
fprintf(stderr,"[LIBCONFIG] %s %d file %s - line %d: %s\n",__FILE__, __LINE__,
cfgptr->status->debug_cfgname, config_error_line(&(libconfig_privdata.runtcfg)),
config_error_text(&(libconfig_privdata.runtcfg)));
} else {
printf("[LIBCONFIG] file %s created successfully\n", cfgptr->status->debug_cfgname);
}
free(fname);
} else {
printf("[LIBCONFIG] Cannot create config file after parsing: CONFIG_SAVERUNCFG flag not specified\n");
}
}
void config_libconfig_end(void ) {
config_destroy(&(libconfig_privdata.cfg));
if( cfgptr->rtflags & CONFIG_SAVERUNCFG ) {
config_destroy(&(libconfig_privdata.runtcfg));
}
if ( libconfig_privdata.configfile != NULL ) {
free(libconfig_privdata.configfile);
libconfig_privdata.configfile=NULL;

View File

@@ -40,12 +40,11 @@ extern "C"
#include "common/config/config_paramdesc.h"
typedef struct libconfig_privatedata {
char *configfile;
config_t cfg;
config_t runtcfg;
} libconfig_privatedata_t;
#ifdef __cplusplus

View File

@@ -302,8 +302,8 @@ void log_getconfig(log_t *g_log)
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_PREDEF_COMPONENTS; i++) {
if(g_log->log_component[i].name == NULL) {
g_log->log_component[i].name = malloc(16);
sprintf((char *)g_log->log_component[i].name,"comp%i?",i);
g_log->log_component[i].name = calloc(1,16);
snprintf((char *)g_log->log_component[i].name,15,"undefcomp%i",i);
logparams_logfile[i].paramflags = PARAMFLAG_DONOTREAD;
logparams_level[i].paramflags = PARAMFLAG_DONOTREAD;
}

View File

@@ -80,6 +80,7 @@ paramdef_t telnetoptions[] = {
{"loopdelay", "<loop command delay (ms)>\n", 0, uptr:&(telnetparams.loopdelay), defuintval:5000, TYPE_UINT, 0 },
{"histfile", "<history file name>\n", PARAMFLAG_NOFREE, strptr:&(telnetparams.histfile), defstrval:"oaitelnet.history", TYPE_STRING, 0 },
{"histsize", "<history sizes>\n", 0, iptr:&(telnetparams.histsize), defuintval:50, TYPE_INT, 0 },
{"logfile", "log file hen redirecting", PARAMFLAG_NOFREE, strptr:&(telnetparams.logfile), defstrval:"oaisoftmodem.log", TYPE_STRING, 0 },
{"phypbsize", "<phy dump buff size (bytes)>\n",0, uptr:&(telnetparams.phyprntbuff_size),defuintval:65000, TYPE_UINT, 0 },
{TELNETSRV_OPTNAME_STATICMOD, "<static modules selection>\n", 0, strlistptr:NULL, defstrlistval:telnet_defstatmod,TYPE_STRINGLIST,(sizeof(telnet_defstatmod)/sizeof(char *))},
{TELNETSRV_OPTNAME_SHRMOD, "<dynamic modules selection>\n", 0, strlistptr:NULL, defstrlistval:NULL,TYPE_STRINGLIST,0 }
@@ -90,25 +91,31 @@ int get_phybsize(void) {
};
int add_telnetcmd(char *modulename,telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd );
int setoutput(char *buff, int debug, telnet_printfunc_t prnt);
int wsetoutput(char *buff, int debug, telnet_printfunc_t prnt, ... );
int setparam(char *buff, int debug, telnet_printfunc_t prnt);
int wsetparam(char *buff, int debug, telnet_printfunc_t prnt, ... );
int history_cmd(char *buff, int debug, telnet_printfunc_t prnt);
telnetshell_vardef_t telnet_vardef[] = {
{"debug",TELNET_VARTYPE_INT32,&telnetparams.telnetdbg},
{"prio",TELNET_VARTYPE_INT32,&telnetparams.priority},
{"loopc",TELNET_VARTYPE_INT32,&telnetparams.loopcount},
{"loopd",TELNET_VARTYPE_INT32,&telnetparams.loopdelay},
{"phypb",TELNET_VARTYPE_INT32,&telnetparams.phyprntbuff_size},
{"hsize",TELNET_VARTYPE_INT32,&telnetparams.histsize},
{"hfile",TELNET_VARTYPE_STRING,&telnetparams.histfile},
{"",0,NULL}
{"debug", TELNET_VARTYPE_INT32,0,&telnetparams.telnetdbg},
{"prio", TELNET_VARTYPE_INT32,0,&telnetparams.priority},
{"loopc", TELNET_VARTYPE_INT32,0,&telnetparams.loopcount},
{"loopd", TELNET_VARTYPE_INT32,0,&telnetparams.loopdelay},
{"phypb", TELNET_VARTYPE_INT32,0,&telnetparams.phyprntbuff_size},
{"hsize", TELNET_VARTYPE_INT32,0,&telnetparams.histsize},
{"hfile", TELNET_VARTYPE_STRING,TELNET_CHECKVAL_RDONLY,&telnetparams.histfile},
{"logfile",TELNET_VARTYPE_STRING,0,&telnetparams.logfile},
{"",0,0,NULL}
};
telnetshell_cmddef_t telnet_cmdarray[] = {
{"redirlog","[here,file,off]",setoutput},
{"param","[prio]",setparam},
{"history","[list,reset]",history_cmd},
{"","",NULL},
{"redirlog","[here,file,off]",setoutput,{NULL},TELNETSRV_CMDFLAG_TELNETONLY,NULL},
{"redirlog file","",setoutput,{NULL},TELNETSRV_CMDFLAG_WEBSRVONLY,NULL},
{"redirlog off","",setoutput,{NULL},TELNETSRV_CMDFLAG_WEBSRVONLY,NULL},
{"param","[prio]",setparam,{wsetparam},0,NULL},
{"history","[list,reset]",history_cmd,{NULL},TELNETSRV_CMDFLAG_TELNETONLY,NULL},
{"","",NULL,{NULL},0,NULL},
};
@@ -127,36 +134,40 @@ void client_printf(const char *message, ...) {
return ;
}
#define NICE_MAX 19
#define NICE_MIN -20
void set_sched(pthread_t tid, int pid, int priority) {
int rt;
struct sched_param schedp;
int policy;
char strpolicy[10];
int niceval=0;
//sched_get_priority_max(SCHED_FIFO)
if (priority < NICE_MIN) {
if (priority < -100 && priority > -200) { //RR priority 1 to 99 (high) mapped to oai priority -101 to -199 (high)
policy=SCHED_RR;
sprintf(strpolicy,"%s","RR");
schedp.sched_priority= -(priority + 100 );
} else if (priority < 0 && priority > -100 ) {
policy=SCHED_FIFO;
sprintf(strpolicy,"%s","fifo");
schedp.sched_priority= NICE_MIN - priority ;
if ( (schedp.sched_priority < sched_get_priority_min(SCHED_FIFO)) ||
(schedp.sched_priority > sched_get_priority_max(SCHED_FIFO)) ) {
client_printf("Error: %i invalid prio, should be %i to %i, \n",
priority, NICE_MIN -sched_get_priority_min(SCHED_FIFO),
NICE_MIN - sched_get_priority_max(SCHED_FIFO) );
}
} else if (priority > NICE_MAX) {
schedp.sched_priority= -priority ;//fifo priority 1 to 99 (high) mapped to oai priority -1 to -99 (high)
} else if (priority >= 0 && priority <= (NICE_MAX-NICE_MIN)) { // other (normal) nice value -20 to 19 mapped to oai priority 0 to 39
policy=SCHED_OTHER;
sprintf(strpolicy,"%s","other");
schedp.sched_priority=0;
niceval=priority+NICE_MIN;
} else if (priority > NICE_MAX-NICE_MIN && priority <= (2*(NICE_MAX-NICE_MIN)+1) ) {// batch (normal) nice value -20 to 19 mapped to oai priority 40 to 79
policy=SCHED_BATCH;
sprintf(strpolicy,"%s","batch");
niceval=priority+NICE_MIN-(NICE_MAX-NICE_MIN+1);
schedp.sched_priority=0;
} else if (priority > (2*(NICE_MAX-NICE_MIN)+1)){// fifo mapped to oai priority 80
policy=SCHED_IDLE;
sprintf(strpolicy,"%s","idle");
schedp.sched_priority=0;
} else {
policy=SCHED_OTHER;
sprintf(strpolicy,"%s","other");
schedp.sched_priority=0;
client_printf("Error: %i invalid priority \n",priority );
return;
}
if( tid != 0) {
rt = pthread_setschedparam(tid, policy, &schedp);
} else if(pid > 0) {
@@ -172,15 +183,15 @@ void set_sched(pthread_t tid, int pid, int priority) {
} else {
client_printf("policy set to %s, priority %i\n",strpolicy,schedp.sched_priority);
if ( policy==SCHED_OTHER) {
if ( policy==SCHED_OTHER || policy==SCHED_BATCH ) {
rt = getpriority(PRIO_PROCESS,tid);
if (rt != -1) {
rt = setpriority(PRIO_PROCESS,tid,priority);
rt = setpriority(PRIO_PROCESS,tid,niceval);
if (rt < 0) {
client_printf("Error %i: %s trying to set nice value of thread %u to %i\n",
errno,strerror(errno),tid,priority);
errno,strerror(errno),tid,niceval);
}
} else {
client_printf("Error %i: %s trying to get nice value of thread %u \n",
@@ -189,17 +200,17 @@ void set_sched(pthread_t tid, int pid, int priority) {
}
}
if ( policy == SCHED_OTHER) {
if ( policy == SCHED_OTHER || policy==SCHED_BATCH) {
if ( tid > 0 && tid != pthread_self()) {
client_printf("setting nice value using a thread id not implemented....\n");
} else if (pid > 0) {
errno=0;
rt = setpriority(PRIO_PROCESS,pid,priority);
rt = setpriority(PRIO_PROCESS,pid,niceval);
if (rt != 0) {
client_printf("Error %i: %s calling setpriority, \n",errno,strerror(errno));
} else {
client_printf("nice value set to %i\n",priority);
client_printf("nice value set to %i\n",niceval);
}
}
}
@@ -236,20 +247,29 @@ void redirstd(char *newfname,telnet_printfunc_t prnt ) {
fd=freopen(newfname, "w", stdout);
if (fd == NULL) {
prnt("ERROR: stdout redir to %s error %s",strerror(errno));
prnt("ERROR: stdout redir to %s error %s\n",strerror(errno));
} else {
prnt("stdout redirected to %s\n",newfname);
}
fd=freopen(newfname, "w", stderr);
if (fd == NULL) {
prnt("ERROR: stderr redir to %s error %s",strerror(errno));
prnt("ERROR: stderr redir to %s error %s\n",strerror(errno));
} else {
prnt("stderr redirected to %s\n",newfname);
}
}
int wsetoutput(char *buffer, int debug, telnet_printfunc_t prnt, ... ) {
return 0;
}
int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
char *logfname;
char stdout_str[64];
#define LOGFILE "logfile.log"
memset(cmds,0,sizeof(cmds));
sscanf(buff,"%9s %32s %9s %9s %9s", cmds[0],cmds[1],cmds[2],cmds[3],cmds[4] );
@@ -265,10 +285,10 @@ int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
if (strncasecmp(cmds[0],"file",4) == 0) {
if (cmds[1][0] == 0)
logfname=LOGFILE;
logfname=telnetparams.logfile;
else
logfname=cmds[1];
prnt("Log output redirected to (%s)\n",logfname);
fflush(stdout);
redirstd(logfname,prnt);
}
@@ -281,6 +301,10 @@ int setoutput(char *buff, int debug, telnet_printfunc_t prnt) {
return CMDSTATUS_FOUND;
} /* setoutput */
int wsetparam(char *buff, int debug, telnet_printfunc_t prnt, ...) {
return 0;
}
int setparam(char *buff, int debug, telnet_printfunc_t prnt) {
char cmds[TELNET_MAX_MSGLENGTH/TELNET_CMD_MAXSIZE][TELNET_CMD_MAXSIZE];
memset(cmds,0,sizeof(cmds));
@@ -344,6 +368,98 @@ int history_cmd(char *buff, int debug, telnet_printfunc_t prnt) {
/*
generic commands available for all modules loaded by the server
*/
char *telnet_getvarvalue(telnetshell_vardef_t *var, int varindex) {
char *val;
switch(var[varindex].vartype) {
case TELNET_VARTYPE_INT32:
val=malloc(64);
snprintf(val,64,"%i",*(int32_t *)(var[varindex].varvalptr));
break;
case TELNET_VARTYPE_INT64:
val=malloc(128);
snprintf(val,128,"%lli",(long long)*(int64_t *)(var[varindex].varvalptr));
break;
case TELNET_VARTYPE_INT16:
val=malloc(16);
snprintf(val,16,"%hi",*(short *)(var[varindex].varvalptr));
break;
case TELNET_VARTYPE_INT8:
val=malloc(16);
snprintf(val,16,"%i",(int)(*(int8_t *)(var[varindex].varvalptr)));
break;
case TELNET_VARTYPE_UINT:
val=malloc(64);
snprintf(val,64,"%u",*(unsigned int *)(var[varindex].varvalptr));
break;
case TELNET_VARTYPE_DOUBLE:
val=malloc(32);
snprintf(val,32,"%g\n",*(double *)(var[varindex].varvalptr));
break;
case TELNET_VARTYPE_STRING:
val = strdup(*(char **)(var[varindex].varvalptr));
break;
default:
val=malloc(64);
snprintf(val,64,"ERR:var %i unknown type",varindex);
break;
}
return val;
}
int telnet_setvarvalue(telnetshell_vardef_t *var,char *strval, telnet_printfunc_t prnt ) {
int st=0;
switch(var->vartype) {
case TELNET_VARTYPE_INT32:
*(int *)(var->varvalptr) = (int)strtol(strval,NULL,0);
if (prnt != NULL)
prnt("%i\n",*(int *)(var->varvalptr));
break;
case TELNET_VARTYPE_INT16:
*(short *)(var->varvalptr) = (short)strtol(strval,NULL,0);
if (prnt != NULL)
prnt("%hi\n",*(short *)(var->varvalptr));
break;
case TELNET_VARTYPE_INT8:
*(char *)(var->varvalptr) = (char)strtol(strval,NULL,0);
if (prnt != NULL)
prnt("%i\n",*(int *)(var->varvalptr));
break;
case TELNET_VARTYPE_UINT:
*(unsigned int *)(var->varvalptr) = (unsigned int)strtol(strval,NULL,0);
if (prnt != NULL)
prnt("%u\n",*(unsigned int *)(var->varvalptr));
break;
case TELNET_VARTYPE_DOUBLE:
*(double *)(var->varvalptr) = strtod(strval,NULL);
if (prnt != NULL)
prnt("%g\n",*(double *)(var->varvalptr));
break;
case TELNET_VARTYPE_STRING:
sprintf(*(char **)(var->varvalptr),"%s", strval);
if (prnt != NULL)
prnt("\"%s\"\n",*(char **)(var->varvalptr));
break;
default:
if (prnt != NULL)
prnt("unknown type\n");
st=-1;
break;
}
return st;
}
int setgetvar(int moduleindex,char getorset,char *params) {
int n,i;
@@ -357,81 +473,15 @@ int setgetvar(int moduleindex,char getorset,char *params) {
if (n > 0 && (getorset == 'g' || getorset == 'G')) {
client_printf("%s, %s = ", telnetparams.CmdParsers[moduleindex].module,
telnetparams.CmdParsers[moduleindex].var[i].varname );
switch(telnetparams.CmdParsers[moduleindex].var[i].vartype) {
case TELNET_VARTYPE_INT32:
client_printf("%i\n",*(int32_t *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
break;
case TELNET_VARTYPE_INT64:
client_printf("%lli\n",*(int64_t *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
break;
case TELNET_VARTYPE_INT16:
client_printf("%hi\n",*(short *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
break;
case TELNET_VARTYPE_INT8:
client_printf("%i\n",(int)(*(int8_t *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr)));
break;
case TELNET_VARTYPE_UINT:
client_printf("%u\n",*(unsigned int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
break;
case TELNET_VARTYPE_DOUBLE:
client_printf("%g\n",*(double *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
break;
case TELNET_VARTYPE_STRING:
client_printf("\"%s\"\n",*(char **)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
break;
default:
client_printf("unknown type\n");
break;
}
char *strval=telnet_getvarvalue(telnetparams.CmdParsers[moduleindex].var, i);
client_printf("%s\n",strval);
free(strval);
}
if (n > 1 && (getorset == 's' || getorset == 'S')) {
client_printf("%s, %s set to \n", telnetparams.CmdParsers[moduleindex].module,
telnetparams.CmdParsers[moduleindex].var[i].varname);
telnet_setvarvalue(&(telnetparams.CmdParsers[moduleindex].var[i]),varval, client_printf);
switch(telnetparams.CmdParsers[moduleindex].var[i].vartype) {
case TELNET_VARTYPE_INT32:
*(int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr) = (int)strtol(varval,NULL,0);
client_printf("%i\n",*(int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
break;
case TELNET_VARTYPE_INT16:
*(short *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr) = (short)strtol(varval,NULL,0);
client_printf("%hi\n",*(short *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
break;
case TELNET_VARTYPE_INT8:
*(char *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr) = (char)strtol(varval,NULL,0);
client_printf("%i\n",*(int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
break;
case TELNET_VARTYPE_UINT:
*(unsigned int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr) = (unsigned int)strtol(varval,NULL,0);
client_printf("%u\n",*(unsigned int *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
break;
case TELNET_VARTYPE_DOUBLE:
*(double *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr) = strtod(varval,NULL);
client_printf("%g\n",*(double *)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
break;
case TELNET_VARTYPE_STRING:
sprintf(*(char **)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr),"%s", varval);
client_printf("\"%s\"\n",*(char **)(telnetparams.CmdParsers[moduleindex].var[i].varvalptr));
break;
default:
client_printf("unknown type\n");
break;
}
}
}
}
@@ -442,6 +492,13 @@ int setgetvar(int moduleindex,char getorset,char *params) {
return CMDSTATUS_VARNOTFOUND;
}
void telnetsrv_freetbldata(webdatadef_t *wdata) {
for(int i=0;i< wdata->numlines; i++)
for(int j=0;j< wdata->numcols ; j++)
if ( wdata->columns[j].coltype & TELNET_VAR_NEEDFREE )
free(wdata->lines[i].val[j]);
}
/*----------------------------------------------------------------------------------------------------*/
char *get_time(char *buff,int bufflen) {
struct tm tmstruct;
@@ -449,6 +506,16 @@ char *get_time(char *buff,int bufflen) {
strftime (buff, bufflen, "%Y-%m-%d %H:%M:%S.000", localtime_r(&now,&tmstruct));
return buff;
}
void telnet_pushcmd(telnetshell_cmddef_t *cmd, char *cmdbuff, telnet_printfunc_t prnt) {
notifiedFIFO_elt_t *msg =newNotifiedFIFO_elt(sizeof(telnetsrv_qmsg_t),0,NULL,NULL);
telnetsrv_qmsg_t *cmddata=NotifiedFifoData(msg);
cmddata->cmdfunc=(qcmdfunc_t)cmd->cmdfunc;
cmddata->prnt=prnt;
cmddata->debug=telnetparams.telnetdbg;
if (cmdbuff != NULL)
cmddata->cmdbuff=strdup(cmdbuff);
pushNotifiedFIFO(cmd->qptr, msg);
}
int process_command(char *buf) {
int i,j,k;
@@ -459,7 +526,7 @@ int process_command(char *buf) {
int rt;
memset(modulename,0,sizeof(modulename));
memset(cmd,0,sizeof(cmd));
extern char **environ;
if (strncasecmp(buf,"ex",2) == 0)
return CMDSTATUS_EXIT;
@@ -474,6 +541,8 @@ int process_command(char *buf) {
}
for(j=0; telnetparams.CmdParsers[i].cmd[j].cmdfunc != NULL ; j++) {
if ( telnetparams.CmdParsers[i].cmd[j].cmdflags & TELNETSRV_CMDFLAG_WEBSRVONLY )
continue;
client_printf(" %s %s %s\n",
telnetparams.CmdParsers[i].module,telnetparams.CmdParsers[i].cmd[j].cmdname,
telnetparams.CmdParsers[i].cmd[j].helpstr);
@@ -489,7 +558,7 @@ int process_command(char *buf) {
j = sscanf(buf,"%19s %19s %m[^\t\n]",modulename,cmd,&cmdb);
if (telnetparams.telnetdbg > 0)
printf("process_command: %i words, module=%s cmd=%s, parameters= %s\n",j,modulename,cmd,cmdb);
printf("process_command: %i words, module=%s cmd=%s, parameters= %s\n",j,modulename,cmd,(cmdb==NULL)?"":cmdb);
for (i=0; j>=2 && telnetparams.CmdParsers[i].var != NULL && telnetparams.CmdParsers[i].cmd != NULL; i++) {
if ( (strncasecmp(telnetparams.CmdParsers[i].module,modulename,strlen(telnetparams.CmdParsers[i].module)) == 0)) {
@@ -504,14 +573,10 @@ int process_command(char *buf) {
} else {
for (k=0 ; telnetparams.CmdParsers[i].cmd[k].cmdfunc != NULL ; k++) {
if (strncasecmp(cmd, telnetparams.CmdParsers[i].cmd[k].cmdname,sizeof(telnetparams.CmdParsers[i].cmd[k].cmdname)) == 0) {
if (telnetparams.CmdParsers[i].cmd[k].cmdflags & TELNETSRV_CMDFLAG_WEBSRVONLY)
continue;
if (telnetparams.CmdParsers[i].cmd[k].qptr != NULL) {
notifiedFIFO_elt_t *msg =newNotifiedFIFO_elt(sizeof(telnetsrv_qmsg_t),0,NULL,NULL);
telnetsrv_qmsg_t *cmddata=NotifiedFifoData(msg);
cmddata->cmdfunc=(qcmdfunc_t)telnetparams.CmdParsers[i].cmd[k].cmdfunc;
cmddata->prnt=client_printf;
cmddata->debug=telnetparams.telnetdbg;
cmddata->cmdbuff=strdup(cmdb);
pushNotifiedFIFO(telnetparams.CmdParsers[i].cmd[k].qptr, msg);
telnet_pushcmd(&(telnetparams.CmdParsers[i].cmd[k]), cmdb,client_printf );
} else {
telnetparams.CmdParsers[i].cmd[k].cmdfunc(cmdb, telnetparams.telnetdbg, client_printf);
}
@@ -859,12 +924,14 @@ int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmdde
strncpy(telnetparams.CmdParsers[i].module,modulename,sizeof(telnetparams.CmdParsers[i].module)-1);
telnetparams.CmdParsers[i].cmd = cmd;
telnetparams.CmdParsers[i].var = var;
if (cmd->cmdflags & TELNETSRV_CMDFLAG_PUSHINTPOOLQ) {
for (int j=0; cmd[j].cmdfunc != NULL ;j++) {
if (cmd[j].cmdflags & TELNETSRV_CMDFLAG_PUSHINTPOOLQ) {
if (afifo == NULL) {
afifo = malloc(sizeof(notifiedFIFO_t));
initNotifiedFIFO(afifo);
}
cmd->qptr = afifo;
cmd[j].qptr = afifo;
}
}
printf("[TELNETSRV] Telnet server: module %i = %s added to shell\n",
i,telnetparams.CmdParsers[i].module);
@@ -894,10 +961,16 @@ int telnetsrv_checkbuildver(char *mainexec_buildversion, char **shlib_buildvers
}
int telnetsrv_getfarray(loader_shlibfunc_t **farray) {
*farray=malloc(sizeof(loader_shlibfunc_t)*2);
*farray=malloc(sizeof(loader_shlibfunc_t)*3);
(*farray)[0].fname=TELNET_ADDCMD_FNAME;
(*farray)[0].fptr=(int (*)(void) )add_telnetcmd;
(*farray)[1].fname=TELNET_POLLCMDQ_FNAME;
(*farray)[1].fptr=(int (*)(void) )poll_telnetcmdq;
return ( 2);
(*farray)[2].fname=TELNET_PUSHCMD_FNAME;
(*farray)[2].fptr=(int (*)(void) )telnet_pushcmd;
return ( 3);
}
/* for webserver interface, needs access to some telnet server paramaters */
telnetsrv_params_t *get_telnetsrv_params(void) {
return &telnetparams;
}

View File

@@ -48,19 +48,55 @@
#define CMDSTATUS_VARNOTFOUND 3
#define CMDSTATUS_NOTFOUND 4
/* definitions to store 2 dim table, used to store command results before */
/* displaying them either on console or web page */
#define TELNET_MAXLINE_NUM 100
#define TELNET_MAXCOL_NUM 10
typedef struct col {
char coltitle[TELNET_CMD_MAXSIZE];
unsigned int coltype;
} acol_t;
typedef struct line {
char *val[TELNET_MAXCOL_NUM];
} aline_t;
typedef struct webdatadef {
char tblname[TELNET_HELPSTR_SIZE];
int numlines;
int numcols;
acol_t columns[TELNET_MAXCOL_NUM];
aline_t lines[TELNET_MAXLINE_NUM];
} webdatadef_t;
/*----------------------------------------------------------------------------*/
/* structure to be used when adding a module to the telnet server */
/* This is the second parameter of the add_telnetcmd function, which can be used */
/* to add a set of new command to the telnet server shell */
typedef void(*telnet_printfunc_t)(const char* format, ...);
typedef int(*cmdfunc_t)(char*, int, telnet_printfunc_t prnt);
typedef int(*webfunc_t)(char *cmdbuff, int debug, telnet_printfunc_t prnt, ... );
typedef int(*webfunc_getdata_t)(char *cmdbuff, int debug, void *data,telnet_printfunc_t prnt);
typedef int(*qcmdfunc_t)(char*, int, telnet_printfunc_t prnt,void *arg);
#define TELNETSRV_CMDFLAG_PUSHINTPOOLQ (1<<0) // ask the telnet server to push the command in a thread pool queue
#define TELNETSRV_CMDFLAG_PUSHINTPOOLQ (1<<0) // ask the telnet server to push the command in a thread pool queue
#define TELNETSRV_CMDFLAG_GETWEBDATA (1<<1) // When called from web server, use the getdata variant of the function
#define TELNETSRV_CMDFLAG_TELNETONLY (1<<2) // Command only for telnet client connections
#define TELNETSRV_CMDFLAG_WEBSRVONLY (1<<3) // Command only for web server connections
#define TELNETSRV_CMDFLAG_CONFEXEC (1<<4) // Ask for confirm before exec
#define TELNETSRV_CMDFLAG_GETWEBTBLDATA (1<<8) // When called from web server, use the get table data variant of the function
#define TELNETSRV_CMDFLAG_PRINTWEBTBLDATA (1<<9) // websrv Print as a single column table
#define TELNETSRV_CMDFLAG_NEEDPARAM (1<<10) // websrv: The command needs a parameter
#define TELNETSRV_CMDFLAG_WEBSRV_SETRETURNTBL (1<<11) // websrv: set callback returns a new table
#define TELNETSRV_CMDFLAG_AUTOUPDATE (1<<12) // command can be re-submitted automatically for result update
typedef struct cmddef {
char cmdname[TELNET_CMD_MAXSIZE];
char helpstr[TELNET_HELPSTR_SIZE];
cmdfunc_t cmdfunc;
cmdfunc_t cmdfunc;
union {
webfunc_t webfunc;
webfunc_getdata_t webfunc_getdata;
};
unsigned int cmdflags;
void *qptr;
} telnetshell_cmddef_t;
@@ -78,6 +114,8 @@ typedef struct telnetsrv_qmsg {
/*structure to be used when adding a module to the telnet server */
/* This is the first parameter of the add_telnetcmd function, which can be used */
/* to add a set of new variables which can be got/set from the telnet server shell */
/* var type: bits 0-3, type value (1 to 15)
* type modifier, bits 4-31 */
#define TELNET_VARTYPE_INT32 1
#define TELNET_VARTYPE_INT16 2
#define TELNET_VARTYPE_INT64 3
@@ -85,10 +123,18 @@ typedef struct telnetsrv_qmsg {
#define TELNET_VARTYPE_DOUBLE 5
#define TELNET_VARTYPE_INT8 6
#define TELNET_VARTYPE_UINT 7
#define TELNET_CHECKVAL_RDONLY 16
#define TELNET_CHECKVAL_BOOL 32
#define TELNET_VAR_NEEDFREE 64
#define TELNET_CHECKVAL_LOGLVL 128
#define TELNET_CHECKVAL_SIMALGO 256
typedef struct variabledef {
char varname[TELNET_CMD_MAXSIZE];
char vartype;
char checkval;
void *varvalptr;
} telnetshell_vardef_t;
@@ -113,6 +159,7 @@ typedef struct {
int priority; // server running priority
char *histfile; // command history
int histsize; // command history length
char *logfile; // filename to use when redirecting output to file
int new_socket; // socket of the client connection
int logfilefd; // file id of the log file when log output is redirected to a file
int saved_stdout; // file id of the previous stdout, used to be able to restore original stdout
@@ -145,14 +192,25 @@ VT escape sequence definition, for smarter display....
#define STDFMT "\x1b[0m"
/*---------------------------------------------------------------------------------------------*/
#define TELNET_ADDCMD_FNAME "add_telnetcmd"
#define NICE_MAX 19
#define NICE_MIN -20
#define TELNET_ADDCMD_FNAME "add_telnetcmd"
#define TELNET_POLLCMDQ_FNAME "poll_telnetcmdq"
#define TELNET_PUSHCMD_FNAME "telnet_pushcmd"
typedef int(*add_telnetcmd_func_t)(char *, telnetshell_vardef_t *, telnetshell_cmddef_t *);
typedef void(*poll_telnetcmdq_func_t)(void *qid,void *arg);
typedef void(*push_telnetcmd_func_t)(telnetshell_cmddef_t *cmd, char *cmdbuff, telnet_printfunc_t prnt);
#ifdef TELNETSERVERCODE
int add_telnetcmd(char *modulename, telnetshell_vardef_t *var, telnetshell_cmddef_t *cmd);
void set_sched(pthread_t tid, int pid,int priority);
void set_affinity(pthread_t tid, int pid, int coreid);
extern int get_phybsize(void);
#endif
#ifdef WEBSERVERCODE
extern void telnet_pushcmd(telnetshell_cmddef_t *cmd, char *cmdbuff, telnet_printfunc_t prnt);
extern telnetsrv_params_t *get_telnetsrv_params(void);
extern char *telnet_getvarvalue(telnetshell_vardef_t *var, int varindex);
extern int telnet_setvarvalue(telnetshell_vardef_t *var,char *strval, telnet_printfunc_t prnt ) ;
extern void telnetsrv_freetbldata(webdatadef_t *wdata);
#endif
#endif

View File

@@ -30,6 +30,6 @@ endforeach()
install(TARGETS telnetsrv DESTINATION bin)
if (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")
install(TARGETS telnetsrv DESTINATION ${OPENAIR_BUILD_DIR}/ran_build/build)
endif (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")
if (EXISTS "${OPENAIR_CMAKE}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_CMAKE}/ran_build/build")
install(TARGETS telnetsrv DESTINATION ${OPENAIR_CMAKE}/ran_build/build)
endif (EXISTS "${OPENAIR_CMAKE}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_CMAKE}/ran_build/build")

View File

@@ -110,9 +110,8 @@ int dump_phyvars(char *buf, int debug, telnet_printfunc_t prnt) {
telnetshell_cmddef_t phy_cmdarray[] = {
{"disp","[phycnt,uedump,uestat UE<x>]", dump_phyvars},
{"","",NULL},
{"disp","[phycnt,uedump,uestat UE<x>]", dump_phyvars,{NULL},0,NULL},
{"","",NULL,{NULL},0,NULL},
};

View File

@@ -42,24 +42,29 @@
int loader_show_cmd(char *buff, int debug, telnet_printfunc_t prnt);
telnetshell_cmddef_t loader_cmdarray[] = {
{"show","[params,modules]",loader_show_cmd},
{"","",NULL},
{"show","[params,modules]",loader_show_cmd,{(webfunc_t)loader_show_cmd},0,NULL},
{"","",NULL,{NULL},0,NULL},
};
/*-------------------------------------------------------------------------------------*/
int loader_show_cmd(char *buff, int debug, telnet_printfunc_t prnt)
{
if (buff == NULL) {
prnt("ERROR wrong loader SHOW command...\n");
return 0;
}
if (debug > 0)
prnt( "loader_show_cmd received %s\n",buff);
if (strcasestr(buff,"params") != NULL) {
prnt( "loader parameters:\n");
prnt( " Main executable build version: \"%s\"\n", loader_data.mainexec_buildversion);
prnt( " Default shared lib path: \"%s\"\n", loader_data.shlibpath);
prnt( " Max number of shared lib : %i\n", loader_data.maxshlibs);
}
else if (strcasestr(buff,"modules") != NULL) {
else if (strcasestr(buff,"modules") != NULL || buff[0]==0 || strcasestr(buff,"show") != NULL) {
prnt( "%i shared lib have been dynamicaly loaded by the oai loader\n", loader_data.numshlibs);
for (int i=0 ; i<loader_data.numshlibs ; i++) {
prnt( " Module %i: %s\n", i,loader_data.shlibs[i].name);

View File

@@ -39,11 +39,11 @@
telnetshell_vardef_t loader_globalvardef[] = {
{"mainversion",TELNET_VARTYPE_STRING,&(loader_data.mainexec_buildversion)},
{"defpath",TELNET_VARTYPE_STRING,&(loader_data.shlibpath)},
{"maxshlibs",TELNET_VARTYPE_INT32,&(loader_data.maxshlibs)},
{"numshlibs",TELNET_VARTYPE_INT32,&(loader_data.numshlibs)},
{"",0,NULL}
{"mainversion",TELNET_VARTYPE_STRING,TELNET_CHECKVAL_RDONLY, &(loader_data.mainexec_buildversion)},
{"defpath",TELNET_VARTYPE_STRING,TELNET_CHECKVAL_RDONLY,&(loader_data.shlibpath)},
{"maxshlibs",TELNET_VARTYPE_INT32,TELNET_CHECKVAL_RDONLY,&(loader_data.maxshlibs)},
{"numshlibs",TELNET_VARTYPE_INT32,TELNET_CHECKVAL_RDONLY,&(loader_data.numshlibs)},
{"",0,0,NULL}
};
telnetshell_vardef_t *loader_modulesvardef;

View File

@@ -92,7 +92,7 @@ telnetshell_cmddef_t measur_cmdarray[] = {
};
telnetshell_vardef_t measur_vardef[] = {
{"",0,NULL}
{"",0,0,NULL}
};
/* function to be implemented in any telnetsrv_xxx_measurements.c sources
to allow common measurment code to access measurments data */

View File

@@ -53,7 +53,7 @@ telnetshell_vardef_t phy_vardef[] = {
//{"txshift",TELNET_VARTYPE_INT32,NULL},
//{"rachemin",TELNET_VARTYPE_INT32,NULL},
//{"rachdmax",TELNET_VARTYPE_INT32,NULL},
{"",0,NULL}
{"",0,0,NULL}
};
#else

View File

@@ -57,89 +57,121 @@
#include "openair1/PHY/phy_extern.h"
#include "telnetsrv_proccmd.h"
void decode_procstat(char *record, int debug, telnet_printfunc_t prnt)
void decode_procstat(char *record, int debug, telnet_printfunc_t prnt,webdatadef_t *tdata)
{
char prntline[160];
char *procfile_fiels;
char *procfile_fields;
char *strtokptr;
char *lptr;
int fieldcnt;
char toksep[2];
fieldcnt=0;
procfile_fiels =strtok_r(record," ",&strtokptr);
procfile_fields =strtok_r(record," ",&strtokptr);
lptr= prntline;
/*http://man7.org/linux/man-pages/man5/proc.5.html gives the structure of the stat file */
while( procfile_fiels != NULL && fieldcnt < 42) {
int priority=0;
int nice=0;
while( procfile_fields != NULL && fieldcnt < 42) {
long int policy;
if (strlen(procfile_fiels) == 0)
if (strlen(procfile_fields) == 0)
continue;
fieldcnt++;
sprintf(toksep," ");
switch(fieldcnt) {
case 1: /* id */
lptr+=sprintf(lptr,"%9.9s ",procfile_fiels);
sprintf(toksep,")");
if (tdata != NULL) {
tdata->lines[tdata->numlines].val[0]=strdup(procfile_fields);
}
lptr+=sprintf(lptr,"%9.9s ",procfile_fields);
sprintf(toksep,")");
break;
case 2: /* name */
lptr+=sprintf(lptr,"%20.20s ",procfile_fiels+1);
if (tdata != NULL) {
tdata->lines[tdata->numlines].val[1]=strdup(procfile_fields);
}
lptr+=sprintf(lptr,"%20.20s ",procfile_fields+1);
break;
case 3: //thread state
lptr+=sprintf(lptr," %c ",procfile_fiels[0]);
lptr+=sprintf(lptr," %c ",procfile_fields[0]);
break;
case 14: //time in user mode
case 15: //time in kernel mode
lptr+=sprintf(lptr,"%9.9s ",procfile_fiels);
lptr+=sprintf(lptr,"%9.9s ",procfile_fields);
break;
case 18: //priority
case 19: //nice
lptr+=sprintf(lptr,"%3.3s ",procfile_fiels);
case 18: //priority column index 2 in tdata, -2 to -100 (1, min to 99, highest prio)
priority=strtol(procfile_fields,NULL,0);
case 19: //nice column index 3 in tdata 0 to 39 (-20, highest prio, to 19)
if (tdata != NULL) {
tdata->lines[tdata->numlines].val[fieldcnt-16]=strdup(procfile_fields);
}
lptr+=sprintf(lptr,"%3.3s ",procfile_fields);
nice=strtol(procfile_fields,NULL,0);
break;
case 23: //vsize
lptr+=sprintf(lptr,"%9.9s ",procfile_fiels);
lptr+=sprintf(lptr,"%9.9s ",procfile_fields);
break;
case 39: //processor
lptr+=sprintf(lptr," %2.2s ",procfile_fiels);
case 39: //processor
if (tdata != NULL) {
tdata->lines[tdata->numlines].val[4]=strdup(procfile_fields);
}
lptr+=sprintf(lptr," %2.2s ",procfile_fields);
break;
case 41: //policy
lptr+=sprintf(lptr,"%3.3s ",procfile_fiels);
policy=strtol(procfile_fiels,NULL,0);
lptr+=sprintf(lptr,"%3.3s ",procfile_fields);
policy=strtol(procfile_fields,NULL,0);
char strschedp[64];
switch(policy) {
case SCHED_FIFO:
lptr+=sprintf(lptr,"%s ","rt: fifo");
snprintf(strschedp,sizeof(strschedp),"%s ","rt:fifo");
priority= priority+1; //in /proc file system priority 1 to 99 mapped to -2 to -100
break;
case SCHED_OTHER:
lptr+=sprintf(lptr,"%s ","other");
snprintf(strschedp,sizeof(strschedp),"%s ","other");
priority=nice-NICE_MIN; // linux nice is -20 to 19
break;
case SCHED_IDLE:
lptr+=sprintf(lptr,"%s ","idle");
snprintf(strschedp,sizeof(strschedp),"%s ","idle");
priority=2*(NICE_MAX-NICE_MIN+1);
break;
case SCHED_BATCH:
lptr+=sprintf(lptr,"%s ","batch");
snprintf(strschedp,sizeof(strschedp),"%s ","batch");
priority=(NICE_MAX-NICE_MIN+1)+nice-NICE_MIN;
break;
case SCHED_RR:
lptr+=sprintf(lptr,"%s ","rt: rr");
snprintf(strschedp,sizeof(strschedp),"%s ","rt:rr");
priority= priority-99 ;
break;
#ifdef SCHED_DEADLINE
case SCHED_DEADLINE:
lptr+=sprintf(lptr,"%s ","rt: deadline");
snprintf(strschedp,sizeof(strschedp),"%s ","rt:deadline");
break;
#endif
default:
lptr+=sprintf(lptr,"%s ","????");
snprintf(strschedp,sizeof(strschedp),"%s ","????");
break;
}
lptr+=sprintf(lptr,"%s ",strschedp);
if (tdata != NULL) {
tdata->lines[tdata->numlines].val[5]=strdup(strschedp);
tdata->lines[tdata->numlines].val[6]=malloc(10);
snprintf(tdata->lines[tdata->numlines].val[6],9,"%i",priority);
}
break;
default:
break;
}/* switch on fieldcnr */
procfile_fiels =strtok_r(NULL,toksep,&strtokptr);
procfile_fields =strtok_r(NULL,toksep,&strtokptr);
} /* while on proc_fields != NULL */
prnt("%s\n",prntline);
if (tdata != NULL) {
tdata->numlines++;
}
} /*decode_procstat */
void read_statfile(char *fname,int debug, telnet_printfunc_t prnt)
void read_statfile(char *fname,int debug, telnet_printfunc_t prnt, webdatadef_t *tdata)
{
FILE *procfile;
char arecord[1024];
@@ -157,21 +189,55 @@ char arecord[1024];
return;
}
fclose(procfile);
decode_procstat(arecord, debug, prnt);
decode_procstat(arecord, debug, prnt,tdata);
}
void print_threads(char *buf, int debug, telnet_printfunc_t prnt)
int nullprnt(char *fmt,...) {
return 0;
}
void proccmd_get_threaddata(char *buf, int debug, telnet_printfunc_t fprnt,webdatadef_t *tdata)
{
char aname[256];
DIR *proc_dir;
struct dirent *entry;
telnet_printfunc_t prnt = (fprnt != NULL)?fprnt:(telnet_printfunc_t)nullprnt;
if (tdata != NULL) {
tdata->numcols=7;
snprintf(tdata->columns[0].coltitle,sizeof(tdata->columns[0].coltitle),"thread id");
tdata->columns[0].coltype=TELNET_VARTYPE_STRING|TELNET_CHECKVAL_RDONLY|TELNET_VAR_NEEDFREE;
snprintf(tdata->columns[1].coltitle,sizeof(tdata->columns[1].coltitle),"thread name");
tdata->columns[1].coltype=TELNET_VARTYPE_STRING|TELNET_CHECKVAL_RDONLY|TELNET_VAR_NEEDFREE;
snprintf(tdata->columns[2].coltitle,sizeof(tdata->columns[2].coltitle),"priority");
tdata->columns[2].coltype=TELNET_VARTYPE_STRING|TELNET_CHECKVAL_RDONLY|TELNET_VAR_NEEDFREE;
snprintf(tdata->columns[3].coltitle,sizeof(tdata->columns[3].coltitle),"nice");
tdata->columns[3].coltype=TELNET_VARTYPE_STRING|TELNET_CHECKVAL_RDONLY|TELNET_VAR_NEEDFREE;
snprintf(tdata->columns[4].coltitle,sizeof(tdata->columns[4].coltitle),"core");
tdata->columns[4].coltype=TELNET_VARTYPE_STRING|TELNET_VAR_NEEDFREE;
snprintf(tdata->columns[5].coltitle,sizeof(tdata->columns[5].coltitle),"sched policy");
tdata->columns[5].coltype=TELNET_VARTYPE_STRING|TELNET_CHECKVAL_RDONLY|TELNET_VAR_NEEDFREE;
snprintf(tdata->columns[5].coltitle,sizeof(tdata->columns[5].coltitle),"sched policy");
tdata->columns[6].coltype=TELNET_VARTYPE_STRING|TELNET_VAR_NEEDFREE;
snprintf(tdata->columns[6].coltitle,sizeof(tdata->columns[6].coltitle),"oai priority");
tdata->numlines=0;
}
unsigned int eax=11,ebx=0,ecx=1,edx=0;
asm volatile("cpuid"
: "=a" (eax),
"=b" (ebx),
"=c" (ecx),
"=d" (edx)
: "0" (eax), "2" (ecx)
: );
prnt("System has %d cores %d threads %d Actual threads",eax,ebx,edx);
prnt(" id name state USRmod KRNmod prio nice vsize proc pol \n\n");
prnt("\n id name state USRmod KRNmod prio nice vsize proc pol \n\n");
snprintf(aname, sizeof(aname), "/proc/%d/stat", getpid());
read_statfile(aname,debug,prnt);
read_statfile(aname,debug,prnt,NULL);
prnt("\n");
snprintf(aname, sizeof(aname), "/proc/%d/task", getpid());
proc_dir = opendir(aname);
@@ -181,20 +247,150 @@ struct dirent *entry;
return;
}
while ((entry = readdir(proc_dir)) != NULL)
{
if(entry->d_name[0] == '.')
continue;
snprintf(aname, sizeof(aname), "/proc/%d/task/%.*s/stat", getpid(),(int)(sizeof(aname)-24),entry->d_name);
read_statfile(aname,debug,prnt);
} /* while entry != NULL */
while ((entry = readdir(proc_dir)) != NULL){
if(entry->d_name[0] != '.') {
snprintf(aname, sizeof(aname), "/proc/%d/task/%.*s/stat", getpid(),(int)(sizeof(aname)-24),entry->d_name);
read_statfile(aname,debug,prnt,tdata);
}
} /* while entry != NULL */
closedir(proc_dir);
} /* print_threads */
void print_threads(char *buf, int debug, telnet_printfunc_t prnt) {
proccmd_get_threaddata(buf,debug,prnt,NULL);
}
int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data, telnet_printfunc_t prnt) {
webdatadef_t *logsdata = ( webdatadef_t *) data;
if (strncmp(cmdbuff,"set",3) == 0) {
telnet_printfunc_t printfunc = (prnt != NULL)?prnt:( telnet_printfunc_t)printf;
if (strcasestr(cmdbuff,"loglvl") != NULL) {
int level=map_str_to_int(log_level_names,logsdata->lines[0].val[1]);
int enabled=(strcmp(logsdata->lines[0].val[2],"true")==0)?1:0;
int loginfile=(strcmp(logsdata->lines[0].val[3],"true")==0)?1:0;
set_log(logsdata->numlines, level);
if (enabled==0)
set_log(logsdata->numlines, OAILOG_DISABLE);
if ( loginfile == 1 ) {
set_component_filelog(logsdata->numlines);
} else {
close_component_filelog(logsdata->numlines);
}
printfunc("%s log level %s is %s, output to %s\n",logsdata->lines[0].val[0],
logsdata->lines[0].val[1], enabled?"enabled":"disabled",loginfile?g_log->log_component[logsdata->numlines].filelog_name :"stdout");
}
if (strcasestr(cmdbuff,"logopt") != NULL) {
int optbit=map_str_to_int(log_options,logsdata->lines[0].val[0]);
if (optbit < 0) {
printfunc("option %s unknown\n",logsdata->lines[0].val[0]);
} else {
if(strcmp(logsdata->lines[0].val[1],"true")==0) {
SET_LOG_OPTION(optbit);
} else {
CLEAR_LOG_OPTION(optbit);
}
printfunc("%s log option %s\n",logsdata->lines[0].val[0],(strcmp(logsdata->lines[0].val[1],"true")==0)?"enabled":"disabled");
}
}
if (strcasestr(cmdbuff,"dbgopt") != NULL) {
int optbit=map_str_to_int(log_maskmap,logsdata->lines[0].val[0]);
if (optbit < 0) {
printfunc("debug option %s unknown\n",logsdata->lines[0].val[0]);
} else {
if(strcmp(logsdata->lines[0].val[1],"true")==0)
SET_LOG_DEBUG(optbit);
else
CLEAR_LOG_DEBUG(optbit);
if(strcmp(logsdata->lines[0].val[2],"true")==0)
SET_LOG_DUMP(optbit);
else
CLEAR_LOG_DUMP(optbit);
printfunc("%s debug %s dump %s\n",logsdata->lines[0].val[0],
(strcmp(logsdata->lines[0].val[1],"true")==0)?"enabled":"disabled",
(strcmp(logsdata->lines[0].val[2],"true")==0)?"enabled":"disabled");
}
}
if (strcasestr(cmdbuff,"threadsched") != NULL) {
unsigned int tid=strtoll(logsdata->lines[0].val[0],NULL,0);
unsigned int core=strtoll(logsdata->lines[0].val[4],NULL,0);
int priority=strtoll(logsdata->lines[0].val[6],NULL,0);
printfunc("Thread %s id %u set affinity to core %u\n",logsdata->lines[0].val[0],tid,core);
set_affinity( 0,(pid_t)tid, core) ;
set_sched(0, (pid_t)tid, priority) ;
}
} else { /* end of set, => show */
if (strcasestr(cmdbuff,"loglvl") != NULL) {
logsdata->numcols=4;
logsdata->numlines=0;
snprintf(logsdata->columns[0].coltitle,TELNET_CMD_MAXSIZE,"component");
logsdata->columns[0].coltype = TELNET_VARTYPE_STRING | TELNET_CHECKVAL_RDONLY;
snprintf(logsdata->columns[1].coltitle,TELNET_CMD_MAXSIZE,"level");
logsdata->columns[1].coltype = TELNET_VARTYPE_STRING|TELNET_CHECKVAL_LOGLVL;
snprintf(logsdata->columns[2].coltitle,TELNET_CMD_MAXSIZE,"enabled");
logsdata->columns[2].coltype = TELNET_CHECKVAL_BOOL;
snprintf(logsdata->columns[3].coltitle,TELNET_CMD_MAXSIZE,"in file");
logsdata->columns[3].coltype = TELNET_CHECKVAL_BOOL;
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
if (g_log->log_component[i].name != NULL) {
logsdata->numlines++;
logsdata->lines[i].val[0]= (char *)(g_log->log_component[i].name);
logsdata->lines[i].val[1]=map_int_to_str(log_level_names,(g_log->log_component[i].level>=0)?g_log->log_component[i].level:g_log->log_component[i].savedlevel);
logsdata->lines[i].val[2]=(g_log->log_component[i].level>=0)?"true":"false";
logsdata->lines[i].val[3]=(g_log->log_component[i].filelog>0)?"true":"false";
}
}
}
if (strcasestr(cmdbuff,"dbgopt") != NULL) {
webdatadef_t *logsdata = ( webdatadef_t *) data;
logsdata->numcols=3;
logsdata->numlines=0;
snprintf(logsdata->columns[0].coltitle,TELNET_CMD_MAXSIZE,"module");
logsdata->columns[0].coltype = TELNET_VARTYPE_STRING | TELNET_CHECKVAL_RDONLY;
snprintf(logsdata->columns[1].coltitle,TELNET_CMD_MAXSIZE,"debug");
logsdata->columns[1].coltype = TELNET_CHECKVAL_BOOL;
snprintf(logsdata->columns[2].coltitle,TELNET_CMD_MAXSIZE,"dump");
logsdata->columns[2].coltype = TELNET_CHECKVAL_BOOL;
for (int i=0; log_maskmap[i].name != NULL ; i++) {
logsdata->numlines++;
logsdata->lines[i].val[0]= log_maskmap[i].name;
logsdata->lines[i].val[1]= (g_log->debug_mask & log_maskmap[i].value)?"true":"false";
logsdata->lines[i].val[2]=(g_log->dump_mask & log_maskmap[i].value)?"true":"false";
}
}
if (strcasestr(cmdbuff,"logopt") != NULL) {
webdatadef_t *logsdata = ( webdatadef_t *) data;
logsdata->numcols=2;
logsdata->numlines=0;
snprintf(logsdata->columns[0].coltitle,TELNET_CMD_MAXSIZE,"option");
logsdata->columns[0].coltype = TELNET_VARTYPE_STRING | TELNET_CHECKVAL_RDONLY;
snprintf(logsdata->columns[1].coltitle,TELNET_CMD_MAXSIZE,"enabled");
logsdata->columns[1].coltype = TELNET_CHECKVAL_BOOL;
for (int i=0; log_options[i].name != NULL; i++) {
logsdata->numlines++;
logsdata->lines[i].val[0]=log_options[i].name;
logsdata->lines[i].val[1]=(g_log->flag & log_options[i].value)?"true":"false";
}
}
if (strcasestr(cmdbuff,"threadsched") != NULL) {
proccmd_get_threaddata(cmdbuff, debug, prnt, ( webdatadef_t *) data);
}
} // show
return 0;
}
int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
{
if (buf == NULL) {
prnt("ERROR wrong softmodem SHOW command...\n");
return 0;
}
if (debug > 0)
prnt(" proccmd_show received %s\n",buf);
if (strcasestr(buf,"thread") != NULL) {
@@ -270,6 +466,10 @@ int bv1,bv2;
int res;
char sv1[64];
if (buf == NULL) {
prnt("ERROR wrong thread command...\n");
return 0;
}
bv1=0;
bv2=0;
sv1[0]=0;
@@ -284,7 +484,7 @@ char sv1[64];
prnt(" proccmd_thread: %i params = %i,%s,%i\n",res,bv1,sv1,bv2);
if(res != 3)
{
prnt("softmodem thread needs 3 params, %i received\n",res);
print_threads(buf, debug, prnt);
return 0;
}
@@ -307,11 +507,20 @@ int proccmd_exit(char *buf, int debug, telnet_printfunc_t prnt)
{
if (debug > 0)
prnt("process module received %s\n",buf);
end_configmodule();
exit_fun("telnet server received exit command\n");
return 0;
}
int proccmd_restart(char *buf, int debug, telnet_printfunc_t prnt)
{
if (debug > 0)
prnt("process module received %s\n",buf);
end_configmodule();
configmodule_interface_t *cfg = config_get_if();
execvpe(cfg->argv[0],cfg->argv ,environ);
return 0;
}
int proccmd_log(char *buf, int debug, telnet_printfunc_t prnt)
{
@@ -396,7 +605,7 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
SET_LOG_DUMP(optbit);
else
CLEAR_LOG_DUMP(optbit);
proccmd_show("dbgopt",debug,prnt);
proccmd_show("dump",debug,prnt);
}
}
if (logparam != NULL) free(logparam);
@@ -435,7 +644,7 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
} else {
prnt("%s%s unknown log sub command \n",logparam, tmpstr);
}
} else {
} else {level=map_str_to_int(log_level_names,tmpstr);
prnt("%s unknown log sub command \n",logsubcmd);
}
if (logparam != NULL) free(logparam);
@@ -459,6 +668,7 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
return 0;
}
/*-------------------------------------------------------------------------------------*/
void add_softmodem_cmds(void)

View File

@@ -44,9 +44,11 @@
extern int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt);
extern int proccmd_thread(char *buf, int debug, telnet_printfunc_t prnt);
extern int proccmd_exit(char *buf, int debug, telnet_printfunc_t prnt);
extern int proccmd_restart(char *buf, int debug, telnet_printfunc_t prnt);
extern int proccmd_log(char *buf, int debug, telnet_printfunc_t prnt);
extern int proccmd_websrv_getdata(char *cmdbuff, int debug, void *data,telnet_printfunc_t prnt);
telnetshell_vardef_t proc_vardef[] = {
{"",0,NULL}
{"",0,0,NULL}
};
#define PROCCMD_LOG_HELP_STRING " log sub commands: \n\
show: display current log configuration \n\
@@ -65,18 +67,26 @@ telnetshell_vardef_t proc_vardef[] = {
#define PROCCMD_THREAD_HELP_STRING " thread sub commands: \n\
<thread id> aff <core> : set affinity of thread <thread id> to core <core> \n\
<thread id> prio <prio> : set scheduling parameters for thread <thread id> \n\
if prio < -20: linux scheduling policy set to FIFO, \n\
with priority = -20 - prio \n\
if prio > 19: linux scheduling policy set to OTHER, \n\
with priority (nice value) = prio \n\
-100 < prio < 0: linux scheduling policy set to FIFO, priority -prio, \n\
-200 < prio < -100: linux scheduling policy set to RR, priority -(prio+100), \n\
0 <= prio < 40: linux scheduling policy set to NORMAL, nice value prio-20 \n\
40 <= prio < 80: linux scheduling policy set to BATCH, nice value prio-60 \n\
prio >=80: linux scheduling policy set to IDLE \n\
use \"softmodem show thread\" to get <thread id> \n"
telnetshell_cmddef_t proc_cmdarray[] = {
{"show","loglvl|thread|config", proccmd_show},
{"log","(enter help for details)", proccmd_log},
{"thread","(enter help for details)", proccmd_thread},
{"exit","", proccmd_exit},
{"show","loglvl|thread|config", proccmd_show,{(webfunc_t)proccmd_websrv_getdata},TELNETSRV_CMDFLAG_TELNETONLY,NULL},
{"log","(enter help for details)", proccmd_log, {NULL},TELNETSRV_CMDFLAG_TELNETONLY,NULL},
{"show loglvl","", proccmd_log,{(webfunc_t)proccmd_websrv_getdata}, TELNETSRV_CMDFLAG_WEBSRVONLY|TELNETSRV_CMDFLAG_GETWEBTBLDATA,NULL},
{"show logopt","", proccmd_log,{(webfunc_t)proccmd_websrv_getdata}, TELNETSRV_CMDFLAG_WEBSRVONLY|TELNETSRV_CMDFLAG_GETWEBTBLDATA,NULL},
{"show dbgopt","", proccmd_log,{(webfunc_t)proccmd_websrv_getdata}, TELNETSRV_CMDFLAG_WEBSRVONLY|TELNETSRV_CMDFLAG_GETWEBTBLDATA,NULL},
{"show config","", proccmd_show,{(webfunc_t)proccmd_show}, TELNETSRV_CMDFLAG_WEBSRVONLY,NULL},
{"show thread","", proccmd_thread,{(webfunc_t)proccmd_show},TELNETSRV_CMDFLAG_WEBSRVONLY|TELNETSRV_CMDFLAG_AUTOUPDATE,NULL},
{"thread","(enter help for details)",proccmd_thread,{NULL},TELNETSRV_CMDFLAG_TELNETONLY,NULL},
{"show threadsched","",proccmd_show,{(webfunc_t)proccmd_websrv_getdata}, TELNETSRV_CMDFLAG_WEBSRVONLY|TELNETSRV_CMDFLAG_GETWEBTBLDATA,NULL},
{"exit","", proccmd_exit,{NULL},TELNETSRV_CMDFLAG_CONFEXEC,NULL},
{"restart","",proccmd_restart,{NULL},TELNETSRV_CMDFLAG_CONFEXEC,NULL},
{"","",NULL},
};
#else

View File

@@ -0,0 +1,7 @@
The oai web server is an optional monitoring and debugging tool. It gives access to the same functionalities as the telnet server via a web interface
* [Using the web server](webserverusage.md)
* [enhancing the webserver](webserverdevcmd.md)
* [web server architecture ](webserverarch.md)
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)

View File

@@ -0,0 +1,31 @@
# telnet server principles
The oai telnet server is implemented in shared libraries to be loaded by the [oai shared library loader](loader). `libtelnetsrv.so ` contains the code common to all oai softmodem executables, where `libtelnetsrv_<app>.so` contains the code specific to the executable identified by `app`.
| `<app>` | executable |
| :-----: | :---------------: |
| enb | `lte-softmodem` |
| gnb | `nr-softmodem` |
| 4Gue | `lte-uesoftmodem` |
| 5Gue | `nr-uesoftmodem` |
The implementation includes a `telnetsrv_autoinit` function which is automatically called at load time, starts the telnet server and registers a first set of commands, which are delivered with the server (telnet, softmodem, loader). it also uses the `get_softmodem_function` call to retrieve the running executable id and possibly loads the corresponding `libtelnetsrv_<app>.so`library.
Currently the telnet server only supports one user connection. The same dedicated thread is used to wait for a user connection and process the input received from this connection.
The telnet server provides an API which can be used by any oai component to add new CLI commands to the server. A pre-defined command can be used to get or set a list of variables.
# telnet server source files
telnet server source files are located in [common/utils/telnetsrv](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/telnetsrv)
1. [telnetsrv.c](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/telnetsrv/telnetsrv.c) contains the telnet server implementation, including the implementation of the `telnet` CLI command. This implementation is compatible with all softmodem executables and is in charge of loading any additional `libtelnetsrv_<app> .so` containing code specific to the running executables.
1. [telnetsrv.h](https://gitlab.eurecom.fr/oai/openairinterface5g/tree/develop/common/utils/telnetsrv/telnetsrv.h) is the telnet server include file containing both private and public data type definitions. It also contains API prototypes for functions that are used to register a new command in the server.
1. `telnetsrv_<XXX\>.c`: implementation of \<XXX\> CLI command which are delivered with the telnet server and are common to all softmodem executables.
1. `telnetsrv_<XXX\>.h`: include file for the implementation of XXX CLI command. Usually included only in the corresponding `.c`file
1. `telnetsrv_<app>_<XXX>.c`: implementation of \<XXX\> CLI command specific to the executable identified by \<app\>.These sources are used to create `libtelnetsrv_<app>.so` at build time.
1. [telnetsrv_CMakeLists.txt](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/utils/telnetsrv/telnetsrv_CMakeLists.txt): CMakelists file containing the cmake instructions to build the telnet server. this file is included in the [global oai CMakelists](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/cmake_targets/CMakeLists.txt).
[oai telnet server home](telnetsrv.md)

View File

@@ -0,0 +1,40 @@
# starting the softmodem with the telnet server
By default the embedded telnet server, which is implemented in a shared library, is not built. It can be built after compiling the softmodem executable using the `build_oai` script:
```bash
cd \<oai repository\>/openairinterface5g
source oaienv
cd cmake_targets
./build_oai --build-lib telnetsrv
```
This will create the `libtelnetsrv.so` and `libtelnetsrv_<app> file in the `targets/bin` and `cmake_targets/ran_build/build` sub directories of the oai repository. <app> can be "enb", "gnb", "4GUE" or "5GUE", each library containing functions specific to a given executable.
When starting the softmodem, you must specify the **_\-\-telnetsrv_** option to load and start the telnet server. The telnet server is loaded via the [oai shared library loader](loader).
# using the Command Line Interface
By default the telnet server listen on all the ip addresses configured on the system and on port 9090. This behavior can be changed using the `listenaddr` and `listenport` parameters.
The telnet server includes a basic help, listing available commands and some commands also provide a specific detailed help sub-command.
Below are examples of telnet sessions:
* [getting help](telnethelp.md)
* [using the history](telnethist.md)
* [using the get and set commands](telnetgetset.md)
* [using the loop command](telnetloop.md)
* [loader command](telnetloader.md)
* [log command](telnetlog.md)
* [measur command](telnetmeasur.md)
# telnet server parameters
The telnet server is using the [oai configuration module](Config/Rtusage). Telnet parameters must be specified in the `telnetsrv` section. Some parameters can be modified via the telnet telnet server command, as specified in the last column of the following table.
| name | type | default | description | dynamic |
|:---:|:---:|:---:|:----|:----:|
| `listenaddr` | `ipV4 address, ascii format` | "0.0.0.0" | local address the server is listening on| N |
| `listenport` | `integer` | 9090 | port number the server is listening on | N |
| `loopcount` | `integer` | 10 | number of iterations for the loop command | Y |
| `loopdelay` | `integer` | 5000 | delay (in ms) between 2 loop command iterations | Y |
| `histfile` | `character string` | "oaitelnet.history" | file used for command history persistency | Y |
| `histfsize` | `integer` | 50 | maximum number of commands saved in the history | Y |
[oai telnet server home](telnetsrv.md)

View File

@@ -0,0 +1,17 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

View File

@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.ts]
quote_type = single
[*.md]
max_line_length = off
trim_trailing_whitespace = false

View File

@@ -0,0 +1,50 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"common/utils/websrv/frontend/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}

50
common/utils/websrv/frontend/.gitignore vendored Normal file
View File

@@ -0,0 +1,50 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
/artifacts
/builds
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db
config.toml

View File

@@ -0,0 +1 @@
# SoftModemNgx

View File

@@ -0,0 +1,108 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false,
"schematicCollections": [
"@angular-eslint/schematics"
]
},
"version": 1,
"newProjectRoot": "projects",
"projects": {
"softmodemngx": {
"projectType": "application",
"schematics": {
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/softmodem-ngx",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/purple-green.css",
"src/styles.css"
],
"scripts": [],
"allowedCommonJsDependencies": [
"@firebase/auth",
"firebase"
]
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "1.5mb",
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "softmodemngx:build:production"
},
"development": {
"browserTarget": "softmodemngx:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "softmodemngx:build"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
}
}

View File

@@ -0,0 +1,40 @@
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');
/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['--headless', '--no-sandbox']
}
},
directConnect: true,
SELENIUM_PROMISE_MANAGER: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function () { }
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: StacktraceOption.PRETTY
}
}));
}
};

View File

@@ -0,0 +1,37 @@
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');
/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome'
},
directConnect: true,
SELENIUM_PROMISE_MANAGER: false,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function () { }
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: StacktraceOption.PRETTY
}
}));
}
};

View File

@@ -0,0 +1,23 @@
import { browser, logging } from 'protractor';
import { AppPage } from './app.po';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
// it('should display welcome message', async () => {
// await page.navigateTo();
// expect(await page.getTitleText()).toEqual('example app is running!');
// });
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});

View File

@@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';
export class AppPage {
async navigateTo(): Promise<unknown> {
return browser.get(browser.baseUrl);
}
async getTitleText(): Promise<string> {
return element(by.css('app-root .content span')).getText();
}
}

View File

@@ -0,0 +1,10 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es2018",
"types": ["jasmine", "node"]
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,65 @@
{
"name": "softmodemngx",
"version": "2.0.0",
"scripts": {
"lint": "ng lint",
"build": "ng build",
"dev": "ng serve --configuration=development",
"prod": "ng serve --configuration=production"
},
"private": true,
"dependencies": {
"@angular-slider/ngx-slider": "^2.0.4",
"@angular/animations": "^14.1.0",
"@angular/cdk": "^14.1.0",
"@angular/common": "^14.1.0",
"@angular/compiler": "^14.1.0",
"@angular/core": "^14.1.0",
"@angular/flex-layout": "^14.0.0-beta.40",
"@angular/forms": "^14.1.0",
"@angular/material": "^14.1.0",
"@angular/platform-browser": "^14.1.0",
"@angular/platform-browser-dynamic": "^14.1.0",
"@angular/router": "^14.1.0",
"chart.js": "^3.8.2",
"moment": "^2.29.3",
"ng2-charts": "^4.0.0",
"rxjs": "^6.6.6",
"tslib": "^2.0.0",
"zone.js": "^0.11.4"
},
"devDependencies": {
"@angular-devkit/architect": "^0.1401.0",
"@angular-devkit/build-angular": "^14.1.0",
"@angular-eslint/builder": "14.0.2",
"@angular-eslint/eslint-plugin": "14.0.2",
"@angular-eslint/eslint-plugin-template": "14.0.2",
"@angular-eslint/schematics": "14.0.2",
"@angular-eslint/template-parser": "14.0.2",
"@angular/cli": "^14.1.0",
"@angular/compiler-cli": "^14.1.0",
"@angular/language-service": "^14.1.0",
"@types/node": "^12.20.23",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"fs-extra": "^10.0.0",
"fuzzy": "^0.1.3",
"husky": "^5.1.3",
"inquirer": "^6.2.2",
"inquirer-autocomplete-prompt": "^1.0.1",
"jasmine-core": "~3.7.1",
"jasmine-spec-reporter": "~5.0.0",
"jsonc-parser": "^3.0.0",
"open": "^7.0.3",
"ts-node": "^8.10.2",
"tslint-angular": "^3.0.3",
"typescript": "~4.6.4"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged && ng lint && ng test",
"pre-push": "ng build --aot true"
}
}
}

View File

@@ -0,0 +1,116 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
export interface IInfo {
name: string;
value: string;
type: IArgType;
modifiable: boolean; //set command ?
}
export interface IModule {
name: string;
}
export enum ILogLvl {
error = "error",
warn = "warn",
analysis = "analysis",
info = "info",
debug = "debug",
trace = "trace"
}
export enum ILogOutput {
stdout = "stdout",
telnet = "telnet",
web = "web",
file = "/tmp/<component>.log",
}
export enum IArgType {
boolean = "boolean",
list = "list",
loglvl = "loglvl",
range = "range",
number = "number",
string = "string",
configfile = "configfile",
simuTypes = "simuTypes",
}
export enum ICommandOptions {
update = "update", // result can be updated, triggers update button on result page when set
}
export interface IVariable {
name: string;
value: string;
type: IArgType;
modifiable: boolean; //set command ?
}
export interface ICommand {
name: string;
confirm?: string;
question?: IQuestion;
param?: IVariable;
options?: ICommandOptions[];
}
export interface ITable {
columns: IColumn[];
rows: string[];
}
export interface IQuestion {
display: string;
pname: string;
type: IArgType;
}
export interface IResp {
display: string[],
table?: ITable
}
export interface IParam {
value: string,
col: IColumn
}
export interface IColumn { //should use IVariable ?
name: string;
type: IArgType;
modifiable: boolean; //set command ?
}
export interface IRow {
params: IParam[],
rawIndex: number,
cmdName: string
}
export const route = 'oaisoftmodem/';
@Injectable({
providedIn: 'root',
})
export class CommandsApi {
constructor(private httpClient: HttpClient) { }
public readInfos$ = () => this.httpClient.get<IInfo[]>('http://' + environment.backend + route + 'variables/');
public setInfo$ = (info: IInfo) => this.httpClient.post<IResp>('http://' + environment.backend + route + 'variables/', info);
public readModules$ = () => this.httpClient.get<IModule[]>('http://' + environment.backend + route + 'commands/');
public readVariables$ = (moduleName: string) => this.httpClient.get<IInfo[]>('http://' + environment.backend + route + moduleName + '/variables/');
public readCommands$ = (moduleName: string) => this.httpClient.get<ICommand[]>('http://' + environment.backend + route + moduleName + '/commands/');
public runCommand$ = (command: ICommand, moduleName: string) => this.httpClient.post<IResp>('http://' + environment.backend + route + moduleName + '/commands/', command);
public setCmdVariable$ = (variable: IInfo, moduleName: string) => this.httpClient.post<IResp>('http://' + environment.backend + route + moduleName + '/variables/', variable);
public setCmdParams$ = (row: IRow, moduleName: string) => this.httpClient.post<IResp>('http://' + environment.backend + route + moduleName + '/set/', row);
}

View File

@@ -0,0 +1,47 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
export enum IScopeGraphType {
IQs = "IQs",
LLR = "LLR",
WF = "WF",
UNSUP = "UNSUP"
}
export interface IGraphDesc {
title: string;
type: IScopeGraphType;
id: number;
srvidx: number;
}
export interface IScopeDesc {
title: string;
graphs: IGraphDesc[];
}
export interface IScopeCmd {
name: string;
graphid?: number; // the graph srvidx
value: string;
}
export interface ISigDesc {
target_id: number;
antenna_id: number;
}
const route = 'oaisoftmodem/scopectrl/';
@Injectable({
providedIn: 'root',
})
export class ScopeApi {
constructor(private httpClient: HttpClient) { }
public getScopeInfos$ = () => this.httpClient.get<IScopeDesc>('http://' + environment.backend + route);
public setScopeParams$ = (cmd: IScopeCmd) => this.httpClient.post('http://' + environment.backend + route, cmd);
}

View File

@@ -0,0 +1,16 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { CommandsComponent } from './components/commands/commands.component';
const routes: Routes = [
{ path: '', redirectTo: '/websrv', pathMatch: 'full' },
{ path: 'websrv', component: AppComponent },
{ path: '**', redirectTo: '' },
];
@NgModule({
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })],
exports: [RouterModule],
})
export class AppRoutingModule { }

View File

@@ -0,0 +1,11 @@
.mat-tab-group {
margin-bottom: 10px;
}
.mat-ink-bar{
height: 8px !important;
}
.mat-tab-label-active
{
color: #000000 !important;
}

View File

@@ -0,0 +1,11 @@
<mat-tab-group backgroundColor="primary" color="accent">
<mat-tab label="Commands">
<app-commands></app-commands>
</mat-tab>
<mat-tab label={{scopelabel}} disabled={{!isscopeavailable}}>
<app-scope (ScopeEnabled)="onScopeEnabled($event)"></app-scope>
</mat-tab>
<mat-tab label="Logger">
<app-logger></app-logger>
</mat-tab>
</mat-tab-group>

View File

@@ -0,0 +1,22 @@
import { Component } from '@angular/core';
import { MatTabsModule } from '@angular/material/tabs';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
title = 'oai softmodem';
isscopeavailable = false;
scopelabel = '';
constructor() {
this.scopelabel = '';
this.isscopeavailable=false;
}
onScopeEnabled( enabled: boolean) {
this.isscopeavailable= enabled;
this.scopelabel= enabled ? 'Scope' : '';
}
}

View File

@@ -0,0 +1,88 @@
import { DragDropModule } from '@angular/cdk/drag-drop';
import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { FlexLayoutModule } from '@angular/flex-layout';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatChipsModule } from '@angular/material/chips';
import { MatDialogModule } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatGridListModule } from '@angular/material/grid-list';
import { MatInputModule } from '@angular/material/input';
import { MatListModule } from '@angular/material/list';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatSelectModule } from '@angular/material/select';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatSliderModule } from '@angular/material/slider';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatTableModule } from '@angular/material/table';
import { MatTabsModule } from '@angular/material/tabs';
import { MatToolbarModule } from '@angular/material/toolbar';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgChartsModule } from 'ng2-charts';
import { CommandsApi } from './api/commands.api';
import { ScopeApi } from './api/scope.api';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { CommandsComponent } from './components/commands/commands.component';
import { ConfirmDialogComponent } from './components/confirm/confirm.component';
import { DialogComponent } from './components/dialog/dialog.component';
import { QuestionDialogComponent } from './components/question/question.component';
import { ScopeComponent } from './components/scope/scope.component';
import { InterceptorProviders } from './interceptors/interceptors';
import { LoadingService } from './services/loading.service';
import { WebSocketService } from './services/websocket.service';
import { LoggerComponent } from './components/logger/logger.component';
@NgModule({
declarations: [
AppComponent,
CommandsComponent,
ConfirmDialogComponent,
QuestionDialogComponent,
DialogComponent,
ScopeComponent,
LoggerComponent
],
imports: [
BrowserModule,
AppRoutingModule,
FormsModule,
ReactiveFormsModule,
BrowserAnimationsModule,
HttpClientModule,
MatButtonModule,
FlexLayoutModule,
MatDialogModule,
DragDropModule,
MatSliderModule,
MatFormFieldModule,
MatInputModule,
MatChipsModule,
MatProgressSpinnerModule,
MatToolbarModule,
MatTableModule,
MatListModule,
MatSelectModule,
MatSnackBarModule,
MatSlideToggleModule,
MatGridListModule,
MatCardModule,
MatTabsModule,
NgChartsModule,
],
providers: [
// services
LoadingService,
WebSocketService,
// api
CommandsApi,
ScopeApi,
// interceptors
InterceptorProviders,
],
bootstrap: [AppComponent]
})
export class AppModule { }

View File

@@ -0,0 +1,127 @@
<div class="grid-container" >
<mat-grid-list cols="2" rowHeight="15vh" >
<mat-grid-tile [colspan]="1" [rowspan]="2" >
<mat-card class="dashboard-card">
<mat-card-header >
<mat-card-title>Connection info</mat-card-title>
</mat-card-header>
<mat-card-content class="dashboard-card-content">
<div *ngIf="infos$ | async as infos">
<div class="spaceddiv" *ngFor="let info of infos">
<mat-form-field class="scrollablefield" >
<mat-label>{{ info.nameFC.value }}</mat-label>
<input matInput [formControl]="info.valueFC" [readonly]="!info.modifiableFC.value" />
</mat-form-field>
<button mat-raised-button color="primary" [disabled]="!info.modifiableFC.value"
(click)="onInfoSubmit(info)">
{{ info.btnTxtFC }}
</button>
</div>
</div>
</mat-card-content>
</mat-card>
</mat-grid-tile>
<mat-grid-tile [colspan]="1" [rowspan]="2">
<mat-card class="dashboard-card">
<mat-card-header>
<mat-card-title>Softmodem commands</mat-card-title>
</mat-card-header>
<mat-card-content class="dashboard-card-content">
<div class="spaceddiv" *ngIf="modules$ | async as modules" fxLaypout="row">
<mat-form-field>
<mat-label>Module</mat-label>
<mat-select (selectionChange)="onModuleSelect($event.value)" [(value)]="selectedModule">
<mat-option *ngFor="let module of modules" [value]="module"> {{ module.name }}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div *ngIf="cmds$ | async as cmds">
<div *ngIf="cmds.length">
<mat-chip-list>
<mat-chip *ngFor="let cmd of cmds" (click)="onCmdSubmit(cmd)"> {{cmd.nameFC.value}}
</mat-chip>
</mat-chip-list>
</div>
</div>
</mat-card-content>
</mat-card>
</mat-grid-tile>
<mat-grid-tile *ngIf="vars$ | async as vars" [colspan]="1" [rowspan]="4">
<mat-card *ngIf="vars.length" class="dashboard-card">
<mat-card-header>
<mat-card-title>{{ selectedModule!.name }} variables</mat-card-title>
</mat-card-header>
<mat-card-content class="dashboard-card-content">
<div class="spaceddiv" *ngFor="let variable of vars">
<mat-form-field class="scrollablefield">
<mat-label>{{ variable.nameFC.value }}</mat-label>
<input matInput [formControl]="variable.valueFC" [readonly]="!variable.modifiableFC.value" />
</mat-form-field>
<button mat-raised-button color="primary" [disabled]="!variable.modifiableFC.value"
(click)="onVarsubmit(variable)">
set
</button>
</div>
</mat-card-content>
</mat-card>
</mat-grid-tile>
<mat-grid-tile *ngIf="(rows$ | async)?.length" [colspan]="1" [rowspan]="4">
<mat-card class="dashboard-card">
<mat-card-header>
<mat-card-title>{{ selectedModule!.name }} {{ selectedCmd!.name }} </mat-card-title>
</mat-card-header>
<mat-card-content class="dashboard-card-content">
<div >
<mat-table mat-table [dataSource]="rows$" multiTemplateDataRows class="mat-elevation-z8">
<div class="TableRowdiv" *ngFor="let col of columns; index as colIndex" matColumnDef="{{col.name}}">
<mat-header-cell *matHeaderCellDef fxLayoutAlign="start center">
<div>
<h4>{{ col.name }}</h4>
</div>
</mat-header-cell>
<mat-cell *matCellDef="let row">
<div [ngSwitch]="col.type" [formGroup]="row" fxLayoutAlign="start center">
<mat-slide-toggle *ngSwitchCase="IArgType.boolean" [formControl]="row.paramsCtrls[colIndex].valueFC"
[checked]="row.paramsCtrls[colIndex].valueFC.value">
</mat-slide-toggle>
<mat-list-item role="listitem">
<mat-form-field *ngSwitchCase="IArgType.loglvl">
<mat-select [formControl]="row.paramsCtrls[colIndex].valueFC"
[(value)]="row.paramsCtrls[colIndex].valueFC.value">
<mat-option *ngFor="let level of logLvlValues" [value]="level"> {{ level }}
</mat-option>
</mat-select>
</mat-form-field>
</mat-list-item>
<div *ngSwitchDefault>
<mat-form-field>
<input matInput [formControl]="row.paramsCtrls[colIndex].valueFC" [readonly]="!col.modifiable" />
</mat-form-field>
</div>
</div>
</mat-cell>
</div>
<div matColumnDef="button">
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
<mat-cell *matCellDef="let row" fxLayoutAlign="center">
<button class="TableBtn" mat-raised-button color="primary" (click)="onParamSubmit(row)" [disabled]="row.pristine"> set
</button>
</mat-cell>
</div>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
</mat-table>
</div>
</mat-card-content>
</mat-card>
</mat-grid-tile>
</mat-grid-list>
</div>

View File

@@ -0,0 +1,80 @@
.spaceddiv {
height: 45px;
width: 40vw;
display: flex;
justify-content: space-between;
margin: 0 auto;
padding: 10px 0;
}
.TableRowdiv {
height: 38px;
display: flex;
/* justify-content: space-between;*/
margin: 2px;
width: 95%;
.item:nth-child(1n){
width: 10%;
}
.item {
width: 4%;
margin: 10px;
}
}
.TableBtn {
height: 25px;
width: 35p;
display:flex;
padding-bottom:8px;
}
.TableText {
display: flex;
width: 8em;
overflow-x: auto;
}
.scrollablefield {
width: 80%;
height: 20px;
.mat-input-element {
overflow-x: auto;
}
}
.mat-card {
height: 95%;
overflow-y: auto;
overflow-x: scroll;
}
.status {
color: green;
font-weight: 800;
}
.ng-invalid .status {
color: red;
}
.grid-container {
margin: 20px;
}
.dashboard-card {
position: absolute;
top: 15px;
left: 15px;
right: 15px;
bottom: 15px;
}
.more-button {
position: absolute;
top: 5px;
right: 10px;
}
.dashboard-card-content {
text-align: center;
}

View File

@@ -0,0 +1,197 @@
import { Component } from '@angular/core';
import { UntypedFormArray } from '@angular/forms';
import { BehaviorSubject, forkJoin, timer } from 'rxjs';
import { Observable } from 'rxjs';
import { of } from 'rxjs';
import { filter } from 'rxjs/operators';
import { map } from 'rxjs/operators';
import { tap } from 'rxjs/operators';
import { switchMap } from 'rxjs/operators';
import { CommandsApi, IArgType, IColumn, ICommand, IInfo, ILogLvl, IParam, IRow } from 'src/app/api/commands.api';
import { CmdCtrl } from 'src/app/controls/cmd.control';
import { InfoCtrl } from 'src/app/controls/info.control';
import { ModuleCtrl } from 'src/app/controls/module.control';
import { RowCtrl } from 'src/app/controls/row.control';
import { VarCtrl } from 'src/app/controls/var.control';
import { DialogService } from 'src/app/services/dialog.service';
import { DownloadService } from 'src/app/services/download.service';
import { LoadingService } from 'src/app/services/loading.service';
import { ViewEncapsulation } from '@angular/core';
const CHANNEL_MOD_MODULE = "channelmod"
const PREDEF_CMD = "show predef"
@Component({
selector: 'app-commands',
templateUrl: './commands.component.html',
styleUrls: ['./commands.component.scss'],
encapsulation: ViewEncapsulation.None,
})
export class CommandsComponent {
IArgType = IArgType;
logLvlValues = Object.values(ILogLvl)
// softmodem
infos$: Observable<VarCtrl[]>
modules$: Observable<ModuleCtrl[]>
// module
selectedModule?: ModuleCtrl
vars$?: Observable<VarCtrl[]>
cmds$?: Observable<CmdCtrl[]>
// command
selectedCmd?: ICommand
displayedColumns: string[] = []
rows$: BehaviorSubject<RowCtrl[]> = new BehaviorSubject<RowCtrl[]>([])
columns: IColumn[] = []
constructor(
public commandsApi: CommandsApi,
public loadingService: LoadingService,
public dialogService: DialogService,
public downloadService: DownloadService,
) {
this.infos$ = this.commandsApi.readInfos$().pipe(
map((infos) => infos.map(info => new InfoCtrl(info)))
);
this.modules$ = this.commandsApi.readModules$().pipe(
map(imodules => imodules.map(imodule => new ModuleCtrl(imodule))),
filter(controls => controls.length > 0),
tap(controls => this.onModuleSelect(controls[0]))
);
}
// get types$() {
// return this.modules$.pipe(
// filter(modules => modules.map(module => module.name).includes(CHANNEL_MOD_MODULE)),
// mergeMap(modules => this.commandsApi.readCommands$(modules[0]!.name)),
// map(icmds => icmds.filter(cmd => cmd.name === PREDEF_CMD)),
// filter(icmds => icmds.length > 0),
// map(icmds => new CmdCtrl(icmds[0])),
// mergeMap(control => this.commandsApi.runCommand$(control.api(), CHANNEL_MOD_MODULE)),
// map(resp => resp.display.map(line => line.match('/\s*[0-9]*\s*(\S*)\n/gm')![0])),
// tap(types => console.log(types.join(', ')))
// );
// }
onInfoSubmit(control: InfoCtrl) {
let info: IInfo = control.api();
if (info.type === IArgType.configfile) {
this.downloadService.getFile(info.value)
} else {
this.commandsApi.setInfo$(info).subscribe();
}
}
onModuleSelect(module: ModuleCtrl) {
this.selectedModule = module
this.selectedCmd = undefined
this.cmds$ = this.commandsApi.readCommands$(module.name).pipe(
map(icmds => icmds.map(icmd => new CmdCtrl(icmd))),
map(cmds => {
module.cmdsFA = new UntypedFormArray(cmds)
return module.cmdsFA.controls as CmdCtrl[]
})
)
this.vars$ = this.commandsApi.readVariables$(module.name).pipe(
map(ivars => ivars.map(ivar => new VarCtrl(ivar))),
map(vars => {
module.varsFA = new UntypedFormArray(vars)
return module.varsFA.controls as VarCtrl[]
})
)
}
onVarsubmit(control: VarCtrl) {
this.commandsApi.setCmdVariable$(control.api(), this.selectedModule!.name)
.pipe(
map(resp => this.dialogService.openVarRespDialog(resp))
).subscribe();
}
onCmdSubmit(control: CmdCtrl) {
this.selectedCmd = control.api()
const obsparam$ = forkJoin([control.confirm
? this.dialogService.openConfirmDialog(control.confirm)
: control.question
? this.dialogService.openQuestionDialog(this.selectedModule! + " " + this.selectedModule!.name, control)
: of(true)]);
obsparam$.pipe(
switchMap(results => {
if (!results[0])
return of(null);
if (control.isResUpdatable())
control.ResUpdTimer = timer(2000, 1000);
return this.execCmd$(control);
}))
.subscribe();
}
private execCmd$(control: CmdCtrl) {
if (control.isResUpdatable() && control.ResUpdTimer) {
if (!(control.ResUpdTimerSubscriber)) {
control.ResUpdTimerSubscriber = control.ResUpdTimer.subscribe(iteration => {
console.log("Update timer fired" + iteration);
if (control.updbtnname === "Stop update")
this.execCmd$(control);
});
}
}
this.commandsApi.runCommand$(control!.api(), this.selectedModule!.name).subscribe(resp => {
if (resp.display[0]) this.dialogService.updateCmdDialog(control, resp, 'cmd ' + control.nameFC.value + ' response:')
// else return of(resp)
const controls: RowCtrl[] = []
this.displayedColumns = []
if (resp.table) {
this.columns = resp.table.columns
this.displayedColumns = this.columns.map(col => col.name)
this.displayedColumns.push('button')
for (let rawIndex = 0; rawIndex < resp.table.rows.length; rawIndex++) {
let params: IParam[] = []
for (let i = 0; i < this.columns.length; i = i + 1) {
params.push({
value: resp.table.rows[rawIndex][i],
col: this.columns[i]
})
}
const irow: IRow = {
params: params,
rawIndex: rawIndex,
cmdName: this.selectedCmd!.name
}
controls[rawIndex] = new RowCtrl(irow)
}
}
this.rows$.next(controls)
},
err => console.error('execCmd error: ' + err),
() => console.log('execCmd completed: '),
) // map resp
return of(null);
}
onParamSubmit(control: RowCtrl) {
this.commandsApi.setCmdParams$(control.api(), this.selectedModule!.name).subscribe(() => this.execCmd$(new CmdCtrl(this.selectedCmd!)));
}
}

View File

@@ -0,0 +1,5 @@
<h3>{{ data.title }}</h3>
<div fxLayoutGap="10px" mat-dialog-actions fxLayout="row" fxLayoutAlign="center start">
<button mat-button [mat-dialog-close]="true" cdkFocusInitial>Ok</button>
<button mat-button (click)="onNoClick()">Cancel</button>
</div>

View File

@@ -0,0 +1,21 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { Component, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
@Component({
selector: 'app-confirm',
templateUrl: './confirm.component.html',
styleUrls: ['./confirm.component.css']
})
export class ConfirmDialogComponent {
constructor(
public dialogRef: MatDialogRef<void>,
@Inject(MAT_DIALOG_DATA) public data: any) {
}
onNoClick() {
this.dialogRef.close();
}
}

View File

@@ -0,0 +1,34 @@
/* icon that can be used to drag a dialog */
::ng-deep.dialogdrag-handle {
top: 1px;
left: 1px;
color: #ccc;
cursor: move;
width: 24px;
height: 24px;
}
/* make dialog for command response using the display field scrollable */
::ng-deep.cmdRespDialog {
resize: both;
overflow: scroll;
}
/* make only the dialog for command response using the display field movable */
/* (hide the close button and the drag icon) */
::ng-deep.varRespDialog #dialogclose {
display:none ;
}
::ng-deep.varRespDialog #dialogdrag {
display:none;
}
::ng-deep.errRespDialog #dialogclose {
display:none ;
}
::ng-deep.errRespDialog #dialogdrag {
display:none;
}

View File

@@ -0,0 +1,17 @@
<div id="dialogdrag" cdkDrag cdkDragRootElement=".cdk-overlay-pane">
<div class="dialogdrag-handle" cdkDragHandle>
<svg width="24px" fill="currentColor" viewBox="0 0 24 24">
<path
d="M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2l-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z">
</path>
<path d="M0 0h24v24H0z" fill="none"></path>
</svg>
</div>
</div>
<h3> {{ data.title }}</h3>
<pre [innerHTML]="data.body"></pre>
<mat-dialog-actions fxLayoutAlign="end">
<button id="dialogclose" mat-button mat-dialog-close>Close</button>
<button id="dialogupdate" mat-button (click)="onUpdate(data.control)"
*ngIf="data.updatable">{{data.control.updbtnname}}</button>
</mat-dialog-actions>

View File

@@ -0,0 +1,23 @@
import { Component, ViewChild, ElementRef, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { DialogService } from 'src/app/services/dialog.service';
import { CmdCtrl } from 'src/app/controls/cmd.control';
@Component({
selector: 'app-dialog',
templateUrl: './dialog.component.html',
styleUrls: ['./dialog.component.css'],
})
export class DialogComponent {
constructor(@Inject(MAT_DIALOG_DATA) public data: any) {
}
onUpdate(control: CmdCtrl) {
if ( control.updbtnname==="Stop update" ){
control.stopUpdate();
} else {
control.startUpdate();
}
}
}

View File

@@ -0,0 +1,5 @@
<div id="logDisplay">
<ul>
<li *ngFor="let msg of messages">{{JSON.stringify(msg)}}</li>
</ul>
</div>

View File

@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LoggerComponent } from './logger.component';
describe('LoggerComponent', () => {
let component: LoggerComponent;
let fixture: ComponentFixture<LoggerComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LoggerComponent ]
})
.compileComponents();
fixture = TestBed.createComponent(LoggerComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,29 @@
import { Component, OnInit } from '@angular/core';
import { Subscription } from 'rxjs';
import { Message, WebSocketService } from 'src/app/services/websocket.service';
@Component({
selector: 'app-logger',
templateUrl: './logger.component.html',
styleUrls: ['./logger.component.css']
})
export class LoggerComponent implements OnInit {
JSON = JSON
// websocket service object and related subscription for message reception
wsSubscription?: Subscription;
messages: Message[] = [];
constructor(
private wsService: WebSocketService
) { }
ngOnInit(): void {
this.wsSubscription = this.wsService.subject$.subscribe(
(msg: Message) => this.messages.push(msg)
)
}
}

View File

@@ -0,0 +1,11 @@
<h3>{{ data.title }}</h3>
<div mat-dialog-content >
<mat-form-field appearance="fill">
<label for="answer">{{data.control.question?.display}}</label>
<input id="answer" type="text" style="width:10vw" [formControl]="data.control.answerFC">
</mat-form-field>
</div>
<div fxLayoutGap=" 10px" mat-dialog-actions fxLayout="row" fxLayoutAlign="center start">
<button mat-button [mat-dialog-close]="true" cdkFocusInitial>Ok</button>
<button mat-button [mat-dialog-close]="false">Cancel</button>
</div>

View File

@@ -0,0 +1,24 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { Component, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { CmdCtrl } from 'src/app/controls/cmd.control';
export interface QuestionDialogData {
title: string;
control: CmdCtrl;
}
@Component({
selector: 'app-question',
templateUrl: './question.component.html',
styleUrls: ['./question.component.css']
})
export class QuestionDialogComponent {
constructor(
public dialogRef: MatDialogRef<QuestionDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: QuestionDialogData,
) { }
onNoClick() {
this.dialogRef.close();
}
}

View File

@@ -0,0 +1,42 @@
mat-form-field {
width: 80%;
}
.status {
color: green;
font-weight: 800;
}
.ng-invalid .status {
color: red;
}
.grid-container {
margin: 20px;
}
.dashboard-card {
position: absolute;
top: 15px;
left: 15px;
right: 15px;
bottom: 15px;
}
.more-button {
position: absolute;
top: 5px;
right: 10px;
}
.dashboard-card-content {
text-align: center;
}
.scope-slider {
width: 90%;
}
.mat-mini-fab.mat-started {
background-color: #00a825;
}

View File

@@ -0,0 +1,204 @@
<div class="grid-container">
<mat-grid-list cols="11" rowHeight="100px">
<!-- top fullwidth area for scope status display -->
<mat-grid-tile [colspan]="11" [rowspan]="1">
<mat-card class="dashboard-card">
<mat-card-header>
<mat-card-title>{{ scopetitle }} {{ scopesubtitle }}</mat-card-title>
</mat-card-header>
<mat-card-content class="dashboard-card-content">
<div FxLayoutAlign="row">
<label>{{ scopetime }} {{ scopestatus }} &nbsp; &nbsp; </label>
</div>
</mat-card-content>
</mat-card>
</mat-grid-tile>
<!-- left full heigth, narrow width area, for global scope controls -->
<mat-grid-tile [colspan]="1" [rowspan]="8">
<mat-card class="dashboard-card">
<mat-card-header>
<mat-card-title>Scope control</mat-card-title>
</mat-card-header>
<mat-card-content class="dashboard-card-content">
<button mat-mini-fab color={{startstop_color}} (click)="startorstop()">{{startstop}}</button>
<br><br>
<div class="scope-slider-div">
<label id="scope-slider-refrate-labelid" class="scope-slider-label">refresh rate</label>
<label class="scope-slider-value-label"> {{rfrate}} </label>
</div>
<mat-slider class="scope-slider" min=".1" max="10" step="0.1" [value]="rfrate"
aria-labelledby="scope-slider-refrate-labelid" vertical="true" thumbLabel="true"
[(ngModel)]="rfrate" (change)="OnRefrateChange()" >
</mat-slider>
<br><br>
<mat-list-item class="sigselect" role="listitem">
<mat-form-field class="select-form">
<mat-select placeholder="sig select" name="SigSelect" class="SigSelect" [value]="selected_sig.target_id" (selectionChange)="SigChanged($event.value)" >
<mat-option *ngFor="let targetid of sig_list" [value]="targetid.target_id" >
{{targetid.target_id}}
</mat-option>
</mat-select>
</mat-form-field>
</mat-list-item>
<br><br>
<mat-slide-toggle [checked]="data_ACK" (change)="onDataACKchange()" [(ngModel)]="data_ACK">data ack
</mat-slide-toggle>
</mat-card-content>
</mat-card>
</mat-grid-tile>
<!-- area for watter fall data display -->
<mat-grid-tile [colspan]="7" [rowspan]="3">
<mat-card class="dashboard-card">
<mat-card-content class="dashboard-card-content">
<div fxLayout="column">
<!-- area for the chart -->
<div fxFlex="1 1 90% " style="width:100%">
<canvas baseChart id="wf"
[datasets]="WFDatasets"
[options]="WFOptions"
[type]="'scatter'">
</canvas>
</div>
<br><br>
<!-- area for the control used to select WF data -->
<div fxFlex="0 1 10%" style="width:60%">
<mat-list-item class="WFselect" role="listitem">
<mat-form-field class="select-form">
<mat-select placeholder="select data" name="WFSelect" class="WFSelect" [value]="selected_WF" (selectionChange)="WFChanged($event.value)" >
<mat-option *ngFor="let graph of WFgraph_list" [value]="graph.title" >
{{graph.title}}
</mat-option>
<mat-option>none</mat-option>
</mat-select>
</mat-form-field>
</mat-list-item>
</div>
</div>
</mat-card-content>
</mat-card>
</mat-grid-tile>
<!-- right area for -->
<mat-grid-tile [colspan]="3" [rowspan]="2">
<mat-card class="dashboard-card">
<mat-card-content class="dashboard-card-content">
</mat-card-content>
</mat-card>
</mat-grid-tile>
<!-- area for LLR data display -->
<mat-grid-tile [colspan]="5" [rowspan]="4">
<mat-card class="dashboard-card">
<mat-card-content class="dashboard-card-content">
<div fxLayout="column">
<div fxFlex="1 1 90% ">
<canvas baseChart id="llr" width="90%"
[datasets]=" LLRDatasets"
[options]="LLROptions"
[type]="'scatter'">
</canvas>
</div>
<div fxFlex="0 1 5%" style="width:100%">
<div class="form-group" fxFlex="50%"> <mat-list-item class="llrchannelselect" role="listitem">
<mat-form-field class="select-form">
<mat-select placeholder="Channels(llr view)" name="llrChannelsSelect" class="ChannelsSelect" multiple [value]="selected_llrchannels" (selectionChange)="llrchannelsChanged($event.value)" >
<mat-option *ngFor="let graph of llrgraph_list" [value]="graph.title" >
{{graph.title}}
</mat-option>
</mat-select>
</mat-form-field>
</mat-list-item> </div>
<div class="form-group" fxFlex="50%">
<div class="scope-slider-div">
<label id="scope-slider-ythresh-labelid" class="scope-slider-label">y threshold </label>
<label class="scope-slider-value-label"> {{llrythresh}} </label>
</div>
<mat-slider class="scope-slider" min="0" max="100" step="1" [value]="llrythresh"
aria-labelledby="scope-slider-ythresh-labelid" thumbLabel="true"
[(ngModel)]="llrythresh" (change)="OnYthreshChange()" >
</mat-slider>
</div>
</div>
<div fxFlex="0 1 5%">
<div class="form-group" fxFlex="25%">
<mat-form-field appearance="fill">
<mat-label>xmin</mat-label>
<input matInput type="number" (change)="OnLLRxminChange()" [value]="llrxmin" [(ngModel)]="llrxmin" min="llrmin" [max]="llrmax">
</mat-form-field>
</div>
<div class="form-group" fxFlex="25%">
<mat-form-field appearance="fill">
<mat-label>xmax</mat-label>
<input matInput type="number" (change)="OnLLRxmaxChange()" [value]="llrxmax" [(ngModel)]="llrxmax" min="llrmin" [max]="llrmax">
</mat-form-field>
</div>
</div>
</div>
</mat-card-content>
</mat-card>
</mat-grid-tile> <!-- end of LLR area -->
<!-- area for iq constellation data display -->
<mat-grid-tile [colspan]="5" [rowspan]="6">
<mat-card class="dashboard-card">
<mat-card-content>
<div fxLayout="column">
<!-- area for the chart -->
<div fxFlex="1 1 80% " style="width:60%">
<canvas baseChart id="iqc"
[datasets]="IQDatasets"
[options]="IQOptions"
[type]="'scatter'">
</canvas>
</div>
<br><br>
<!-- area for the control used to select channel's -->
<div fxFlex="0 1 10%" style="width:60%">
<mat-list-item class="channelselect" role="listitem">
<mat-form-field class="select-form">
<mat-select placeholder="Channels(IQ view)" name="ChannelsSelect" class="ChannelsSelect" multiple [value]="selected_channels" (selectionChange)="channelsChanged($event.value)" >
<mat-option *ngFor="let graph of iqgraph_list" [value]="graph.title" >
{{graph.title}}
</mat-option>
</mat-select>
</mat-form-field>
</mat-list-item>
</div>
<!-- area for the 4 controls used to select x and y limits for data -->
<div fxFlex="0 1 5%">
<div class="form-group" fxFlex="25%">
<mat-form-field appearance="fill">
<mat-label>xmin</mat-label>
<input matInput type="number" (change)="OnIQxminChange()" [value]="iqxmin" [(ngModel)]="iqxmin" min="iqmin" [max]="iqmax">
</mat-form-field>
</div>
<div class="form-group" fxFlex="25%">
<mat-form-field appearance="fill">
<mat-label>xmax</mat-label>
<input matInput type="number" (change)="OnIQxmaxChange()" [value]="iqxmax" [(ngModel)]="iqxmax" min="iqmin" [max]="iqmax">
</mat-form-field>
</div>
<div class="form-group" fxFlex="25%">
<mat-form-field appearance="fill">
<mat-label>ymin</mat-label>
<input matInput type="number" (change)="OnIQyminChange()" [value]="iqymin" [(ngModel)]="iqymin" min="iqmin" [max]="iqmax">
</mat-form-field>
</div>
<div class="form-group" fxFlex="25%">
<mat-form-field appearance="fill">
<mat-label>ymax</mat-label>
<input matInput type="number" (change)="OnIQymaxChange()" [value]="iqymax" [(ngModel)]="iqymax" min="iqmin" [max]="iqmax">
</mat-form-field>
</div>
</div>
</div>
</mat-card-content>
</mat-card>
</mat-grid-tile> <!-- end of iq area -->
</mat-grid-list>
</div>

View File

@@ -0,0 +1,584 @@
import { Component, EventEmitter, OnDestroy, OnInit, Output, QueryList, ViewChildren } from "@angular/core";
import { Chart, ChartConfiguration } from 'chart.js';
import { BaseChartDirective } from 'ng2-charts';
import { Subscription } from 'rxjs';
import { IGraphDesc, IScopeDesc, IScopeGraphType, ISigDesc, ScopeApi } from 'src/app/api/scope.api';
import { arraybuf_data_offset, Message, WebSocketService, webSockSrc } from "src/app/services/websocket.service";
export interface RxScopeMessage {
msgtype: number;
chartid: number;
dataid: number;
segnum: number;
update: boolean;
content: ArrayBuffer;
}
const deserialize = (fullbuff: ArrayBuffer): RxScopeMessage => {
const header = new DataView(fullbuff, 0, arraybuf_data_offset);
return {
// source: src.getUint8(0), //header
msgtype: header.getUint8(1), //header
chartid: header.getUint8(3), //header
dataid: header.getUint8(4), //header
segnum: header.getUint8(2), //header
update: (header.getUint8(5) == 1) ? true : false, //header
content: fullbuff.slice(arraybuf_data_offset) // data
};
}
const serialize = (msg: TxScopeMessage): ArrayBuffer => {
const byteArray = new TextEncoder().encode(msg.content);
let arr = new Uint8Array(byteArray.byteLength + arraybuf_data_offset);
arr.set(byteArray, arraybuf_data_offset) //data
let buffview = new DataView(arr.buffer);
buffview.setUint8(1, msg.msgtype); //header
return buffview.buffer;
}
export interface TxScopeMessage {
msgtype: number;
content: string;
}
/*------------------------------------*/
/* constants that must match backend (websrv.h or phy_scope.h) */
const SCOPEMSG_TYPE_STATUSUPD = 1;
const SCOPEMSG_TYPE_REFRATE = 2;
const SCOPEMSG_TYPE_TIME = 3;
const SCOPEMSG_TYPE_DATA = 10;
const SCOPEMSG_TYPE_DATAACK = 11;
const SCOPEMSG_DATA_IQ = 1;
const SCOPEMSG_DATA_LLR = 2;
const SCOPEMSG_DATA_WF = 3;
/*---------------------------------------*/
@Component({
selector: 'app-scope',
templateUrl: './scope.component.html',
styleUrls: ['./scope.component.css'],
})
export class ScopeComponent implements OnInit, OnDestroy {
//data for scope status area
scopetitle = '';
scopesubtitle = '';
scopetime = '';
scopestatus = 'stopped';
//data for scope control area
startstop = 'start';
startstop_color = 'warn';
rfrate = 2;
data_ACK = false;
//data for scope iq constellation area
iqgraph_list: IGraphDesc[] = [];
selected_channels = [""];
iqmax = 32767;
iqmin = -32767;
iqxmin = this.iqmin;
iqymin = this.iqmin;
iqxmax = this.iqmax;
iqymax = this.iqmax;
//data for scope LLR area
llrgraph_list: IGraphDesc[] = [];
selected_llrchannels = [""];
sig_list: ISigDesc[] = [{ target_id: 0, antenna_id: 0 },
{ target_id: 1, antenna_id: 0 },
{ target_id: 2, antenna_id: 0 },
{ target_id: 3, antenna_id: 0 },
];
selected_sig: ISigDesc = { target_id: 0, antenna_id: 0 };
llrythresh = 5;
llrmin = 0;
llrmax = 200000;
llrxmin = this.llrmin;
llrxmax = this.llrmax;
//data for scope WatterFall area
WFgraph_list: IGraphDesc[] = [];
selected_WF = "";
llrchart?: Chart;
iqcchart?: Chart;
wfchart?: Chart;
nwf: number[] = [0, 0, 0, 0];
// websocket service object and related subscription for message reception
wsSubscription?: Subscription;
@Output() ScopeEnabled = new EventEmitter<boolean>();
@ViewChildren(BaseChartDirective) charts?: QueryList<BaseChartDirective>;
public IQDatasets: ChartConfiguration<'scatter'>['data']['datasets'] = [
{
data: [],
label: 'C1',
pointRadius: 0.5,
showLine: false,
animation: false,
fill: false,
pointStyle: 'circle',
pointBackgroundColor: 'yellow',
backgroundColor: 'yellow',
borderWidth: 0,
pointBorderColor: 'yellow',
// parsing: false,
},
{
data: [],
label: 'C2',
pointRadius: 0.5,
showLine: false,
animation: false,
pointStyle: 'circle',
pointBackgroundColor: 'cyan',
backgroundColor: 'cyan',
borderWidth: 0,
pointBorderColor: 'cyan',
// parsing: false,
},
{
data: [],
label: 'C3',
pointRadius: 0.5,
showLine: false,
animation: false,
pointStyle: 'circle',
pointBackgroundColor: 'red',
backgroundColor: 'red',
borderWidth: 0,
pointBorderColor: 'red',
// parsing: false,
}
];
public LLRDatasets: ChartConfiguration<'scatter'>['data']['datasets'] = [
{
data: [],
label: 'LLR1',
pointRadius: 0.5,
showLine: false,
animation: false,
fill: false,
pointStyle: 'circle',
pointBackgroundColor: 'yellow',
backgroundColor: 'yellow',
borderWidth: 0,
pointBorderColor: 'yellow',
// parsing: false,
},
{
data: [],
label: 'LL2',
pointRadius: 0.5,
showLine: false,
animation: false,
pointStyle: 'circle',
pointBackgroundColor: 'cyan',
backgroundColor: 'cyan',
borderWidth: 0,
pointBorderColor: 'cyan',
parsing: false,
},
{
data: [],
label: 'LLR3',
pointRadius: 0.5,
showLine: false,
animation: false,
pointStyle: 'circle',
pointBackgroundColor: 'red',
backgroundColor: 'red',
borderWidth: 0,
pointBorderColor: 'red',
parsing: false,
}
];
public WFDatasets: ChartConfiguration<'scatter'>['data']['datasets'] = [
{
data: [],
label: 'WFblue',
pointRadius: 0.5,
showLine: false,
animation: false,
fill: false,
pointStyle: 'circle',
pointBackgroundColor: 'blue',
backgroundColor: 'blue',
borderWidth: 0,
pointBorderColor: 'blue',
// parsing: false,
},
{
data: [],
label: 'WFgreen',
pointRadius: 0.5,
showLine: false,
animation: false,
pointStyle: 'circle',
pointBackgroundColor: 'green',
backgroundColor: 'green',
borderWidth: 0,
pointBorderColor: 'green',
// parsing: false,
},
{
data: [],
label: 'WFyellow',
pointRadius: 0.5,
showLine: false,
animation: false,
pointStyle: 'circle',
pointBackgroundColor: 'yellow',
backgroundColor: 'yellow',
borderWidth: 0,
pointBorderColor: 'yellow',
// parsing: false,
},
{
data: [],
label: 'WFred',
pointRadius: 0.5,
showLine: false,
animation: false,
pointStyle: 'circle',
pointBackgroundColor: 'red',
backgroundColor: 'red',
borderWidth: 0,
pointBorderColor: 'red',
// parsing: false,
}
];
public IQOptions: ChartConfiguration<'scatter'>['options'] = {
responsive: true,
aspectRatio: 1,
// scales: {
// xAxes: {
// min: -5,
// max:5,
// }
// },
plugins: { legend: { display: true, labels: { boxWidth: 10, boxHeight: 10 } }, tooltip: { enabled: false, }, },
};
public LLROptions: ChartConfiguration<'scatter'>['options'] = {
responsive: true,
aspectRatio: 3,
scales: {
xAxes: {
min: 0,
},
// yAxes: {
// min: -100,
// max: 100
// }
},
plugins: { legend: { display: true, labels: { boxWidth: 10, boxHeight: 10 } }, tooltip: { enabled: false, }, },
};
public WFOptions: ChartConfiguration<'scatter'>['options'] = {
responsive: true,
aspectRatio: 5,
scales: {
xAxes: {
min: 0,
// max:800,
},
yAxes: {
min: 0,
max: 80,
reverse: true,
}
},
plugins: { legend: { display: true, labels: { boxWidth: 10, boxHeight: 10 } }, tooltip: { enabled: false, }, },
}
constructor(
private scopeApi: ScopeApi,
private wsService: WebSocketService
) {
console.log("Scope constructor ");
}
ngOnInit() {
console.log("Scope ngOnInit ");
this.scopeApi.getScopeInfos$().subscribe(resp => {
this.configScope(resp);
});
}
ngOnDestroy() {
console.log("Scope ngOnDestroy ");
this.wsSubscription?.unsubscribe();
}
DecodScopeBinmsgToString(message: ArrayBuffer) {
const enc = new TextDecoder("utf-8");
return enc.decode(message);
}
private configScope(resp: IScopeDesc) {
if (resp.title === "none") {
this.ScopeEnabled.emit(false);
} else {
this.ScopeEnabled.emit(true);
this.scopetitle = resp.title;
this.iqgraph_list.length = 0;
this.llrgraph_list.length = 0;
for (let graphIndex = 0; graphIndex < resp.graphs.length; graphIndex++) {
if (resp.graphs[graphIndex].type == IScopeGraphType.IQs) {
this.iqgraph_list.push(resp.graphs[graphIndex]);
this.IQDatasets[this.iqgraph_list.length - 1].label = resp.graphs[graphIndex].title;
}
if (resp.graphs[graphIndex].type == IScopeGraphType.LLR) {
this.llrgraph_list.push(resp.graphs[graphIndex]);
this.LLRDatasets[this.llrgraph_list.length - 1].label = resp.graphs[graphIndex].title;
}
if (resp.graphs[graphIndex].type == IScopeGraphType.WF) {
this.WFgraph_list.push(resp.graphs[graphIndex]);
}
}
this.charts?.forEach((child) => {
child.chart?.update()
});
}
}
private ProcessScopeMsg(message: RxScopeMessage) {
if (this.scopestatus === "starting") {
this.scopestatus = 'started';
this.startstop = 'stop';
this.startstop_color = 'started';
}
let d = 0;
let x = 0;
let y = 0;
switch (message.msgtype) {
case SCOPEMSG_TYPE_TIME:
this.scopetime = this.DecodScopeBinmsgToString(message.content);
break;
case SCOPEMSG_TYPE_DATA:
const bufferview = new DataView(message.content);
switch (message.chartid) {
case SCOPEMSG_DATA_IQ:
this.IQDatasets[message.dataid].data.length = 0;
if (message.update) {
console.log("Starting scope update chart " + message.chartid.toString() + ", dataset " + message.dataid.toString());
}
for (let i = 0; i < bufferview.byteLength; i = i + 4) {
this.IQDatasets[message.dataid].data[i / 4] = { x: bufferview.getInt16(i, true), y: bufferview.getInt16(i + 2, true) };
}
if (message.update) {
this.iqcchart!.update();
}
break;
case SCOPEMSG_DATA_LLR:
if (message.update) {
console.log("Starting scope update chart " + message.chartid.toString() + ", dataset " + message.dataid.toString());
}
this.LLRDatasets[message.dataid].data.length = 0;
let xoffset = 0;
d = 0;
for (let i = 4; i < (bufferview.byteLength - 2); i = i + 4) {
xoffset = xoffset + bufferview.getInt16(i + 2, true);
this.LLRDatasets[message.dataid].data[d] = { x: xoffset, y: bufferview.getInt16(i, true) };
d++;
}
this.LLRDatasets[message.dataid].data[d] = { x: bufferview.getInt32(0, true), y: 0 };
if (message.update) {
this.llrchart!.update();
}
break;
case SCOPEMSG_DATA_WF:
if (message.update) {
console.log("Starting scope update chart " + message.chartid.toString() + ", dataset " + message.dataid.toString());
if (message.segnum == 0) {
for (let i = 0; i < this.WFDatasets.length; i++) {
this.nwf[i] = 0;
this.WFDatasets[i].data.length = 0;
}
}
}
for (let i = 2; i < bufferview.byteLength - 2; i = i + 4) {// first 16 bits in buffer contains the number of points in the message
x = bufferview.getInt16(i, true);
y = bufferview.getInt16(i + 2, true);
this.wfchart!.scales.xAxes.max = bufferview.getInt16(bufferview.byteLength - 4, true);
this.WFDatasets[message.dataid].data[this.nwf[message.dataid]] = { x: x, y: y };
this.nwf[message.dataid]++;
}
if (message.update) {
this.wfchart!.update();
console.log(" scope update completed " + d.toString() + "points, ");
}
break;
default:
break;
}
this.sendMsg(SCOPEMSG_TYPE_DATAACK, "Chart " + message.chartid.toString() + ", dataset " + message.dataid.toString());
break;
default:
break;
}
}
private sendMsg(type: number, strmessage: string) {
this.wsService.send({
source: webSockSrc.softscope,
fullbuff: serialize({
msgtype: type,
content: strmessage
})
});
console.log("Scope sent msg type " + type.toString() + " " + strmessage);
}
private SendScopeParams(name: string, value: string, graphid: number) {
this.scopeApi.setScopeParams$({ name: name, value: value, graphid: graphid }).subscribe();
}
startorstop() {
if (this.scopestatus === 'stopped') {
this.scopeApi.setScopeParams$({ name: "startstop", value: "start" }).subscribe(
() => {
this.llrchart = Chart.getChart("llr");
this.iqcchart = Chart.getChart("iqc");
this.wfchart = Chart.getChart("wf");
this.IQDatasets.forEach((dataset) => { dataset.data.length = 0 });
this.LLRDatasets.forEach((dataset) => { dataset.data.length = 0 });
this.charts?.forEach((child, index) => { child.chart?.update() });
this.scopestatus = 'starting';
this.SigChanged(this.selected_sig.target_id);
this.OnRefrateChange();
this.OnIQxminChange();
this.OnIQxmaxChange();
this.OnIQyminChange();
this.OnIQymaxChange();
this.OnYthreshChange();
this.OnLLRxminChange();
this.OnLLRxmaxChange();
this.channelsChanged(this.selected_channels);
this.llrchannelsChanged(this.selected_llrchannels);
this.WFChanged(this.selected_WF);
for (let i = 0; i < this.WFDatasets.length; i++) {
this.nwf[i] = 0;
this.WFDatasets[i].data.length = 0;
}
this.wsSubscription = this.wsService.subject$.subscribe(
(msg: Message) => this.ProcessScopeMsg(deserialize(msg.fullbuff))
)
},
err => {
}
);
} else {
this.scopeApi.setScopeParams$({ name: "startstop", value: "stop" }).subscribe(
() => {
if (this.wsSubscription)
this.wsSubscription.unsubscribe();
this.scopestatus = 'stopped';
this.startstop = 'start';
this.startstop_color = 'warn';
this.charts?.forEach((child, index) => { child.chart?.update() });
},
err => {
}
);
}
}
OnRefrateChange() {
this.SendScopeParams("refrate", (this.rfrate * 10).toString(), 0);
}
OnLLRxminChange() {
this.SendScopeParams("llrxmin", (this.llrxmin).toString(), 0);
}
OnLLRxmaxChange() {
this.SendScopeParams("llrxmax", (this.llrxmax).toString(), 0);
}
OnIQxminChange() {
this.SendScopeParams("xmin", (this.iqxmin).toString(), 0);
}
OnIQxmaxChange() {
this.SendScopeParams("xmax", (this.iqxmax).toString(), 0);
}
OnIQyminChange() {
this.SendScopeParams("ymin", (this.iqymin).toString(), 0);
}
OnIQymaxChange() {
this.SendScopeParams("ymax", (this.iqymax).toString(), 0);
}
channelsChanged(titles: string[]) {
this.selected_channels = titles;
this.iqgraph_list.forEach(graph => {
const [enabled] = titles.filter(value => graph.title === value)
this.SendScopeParams("enabled", enabled ? "true" : "false", graph.srvidx);
})
}
llrchannelsChanged(titles: string[]) {
this.selected_llrchannels = titles;
this.llrgraph_list.forEach(graph => {
const [enabled] = titles.filter(value => graph.title === value)
this.SendScopeParams("enabled", enabled ? "true" : "false", graph.srvidx);
})
}
SigChanged(value: number) {
this.selected_sig.target_id = value;
if (this.scopetitle === "gNB")
this.scopesubtitle = " - sig from UE" + value.toString() + " antenna" + this.selected_sig.antenna_id;
else
this.scopesubtitle = " - sig from gNB" + value.toString() + " antenna" + this.selected_sig.antenna_id;;
this.SendScopeParams("TargetSelect", value.toString(), 0);
}
WFChanged(value: string) {
this.selected_WF = value;
for (let i = 0; i < this.WFgraph_list.length; i++) {
if (this.WFgraph_list[i].title === value) {
this.SendScopeParams("enabled", "true", this.WFgraph_list[i].srvidx);
this.WFDatasets[0].label = value;
this.WFDatasets[1].label = "(>avg*2)";
this.WFDatasets[2].label = "(>avg*10)";
this.WFDatasets[3].label = "(>avg*100)";
} else {
this.SendScopeParams("enabled", "false", this.WFgraph_list[i].srvidx);
}
}
for (let i = 0; i < this.WFDatasets.length; i++) {
this.nwf[i] = 0;
this.WFDatasets[i].data.length = 0;
}
}
onDataACKchange() {
this.SendScopeParams("DataAck", this.data_ACK.toString(), 0);
}
OnYthreshChange() {
this.SendScopeParams("llrythresh", this.llrythresh.toString(), 0);
}
}

View File

@@ -0,0 +1,95 @@
import { UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { Subscription } from 'rxjs';
import { Observable } from 'rxjs/internal/Observable';
import { ICommand, ICommandOptions, IQuestion } from 'src/app/api/commands.api';
const enum CmdFCN {
name = 'name',
vars = 'variables',
confirm = 'confirm',
answer = "answer"
}
export class CmdCtrl extends UntypedFormGroup {
confirm?: string
question?: IQuestion
cmdname: string
options?: ICommandOptions[]
public ResUpdTimer?: Observable<number>
public ResUpdTimerSubscriber?: Subscription
updbtnname: string
constructor(cmd: ICommand) {
super({});
this.addControl(CmdFCN.name, new UntypedFormControl(cmd.name));
this.addControl(CmdFCN.answer, new UntypedFormControl(""));
this.addControl(CmdFCN.vars, new UntypedFormArray([]));
this.confirm = cmd.confirm;
this.question = cmd.question;
this.cmdname = cmd.name;
this.options = cmd.options;
this.updbtnname = "Start update"
}
api() {
const doc: ICommand = {
name: this.nameFC.value,
param: this.question
? { name: this.question!.pname, value: this.answerFC.value, type: this.question!.type, modifiable: false }
: undefined,
options: this.options
};
return doc;
}
isResUpdatable(): boolean {
if (this.options) {
for (let opt = 0; opt < this.options.length; opt++) {
if (this.options[opt] == ICommandOptions.update)
return true;
}
} else {
return false;
}
return false;
}
stopUpdate() {
if (this.ResUpdTimerSubscriber) {
this.ResUpdTimerSubscriber.unsubscribe();
this.updbtnname = "Start update"
}
}
startUpdate() {
if (this.ResUpdTimerSubscriber && this.ResUpdTimer) {
this.ResUpdTimerSubscriber = this.ResUpdTimer.subscribe();
this.updbtnname = "Stop update"
}
}
get nameFC() {
return this.get(CmdFCN.name) as UntypedFormControl;
}
set nameFC(fc: UntypedFormControl) {
this.setControl(CmdFCN.name, fc);
}
get answerFC() {
return this.get(CmdFCN.answer) as UntypedFormControl;
}
get varsFA() {
return this.get(CmdFCN.vars) as UntypedFormArray;
}
set varsFA(fa: UntypedFormArray) {
this.setControl(CmdFCN.vars, fa);
}
}

View File

@@ -0,0 +1,74 @@
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { IInfo } from '../api/commands.api';
import { IArgType } from '../api/commands.api';
const enum InfosFCN {
name = 'name',
value = "value",
type = "type",
modifiable = "modifiable"
}
export class InfoCtrl extends UntypedFormGroup {
type: IArgType;
constructor(ivar: IInfo) {
super({});
this.type = ivar.type;
this.addControl(InfosFCN.name, new UntypedFormControl(ivar.name));
this.addControl(InfosFCN.value, new UntypedFormControl(ivar.value));
this.addControl(InfosFCN.type, new UntypedFormControl(ivar.type));
this.addControl(InfosFCN.modifiable, new UntypedFormControl(ivar.modifiable));
}
api() {
const doc: IInfo = {
name: this.nameFC.value,
value: String(this.valueFC.value), //FIXME
type: this.typeFC.value,
modifiable: this.modifiableFC.value
};
return doc;
}
get nameFC() {
return this.get(InfosFCN.name) as UntypedFormControl;
}
set nameFC(control: UntypedFormControl) {
this.setControl(InfosFCN.name, control);
}
get valueFC() {
return this.get(InfosFCN.value) as UntypedFormControl;
}
set valueFC(control: UntypedFormControl) {
this.setControl(InfosFCN.value, control);
}
get typeFC() {
return this.get(InfosFCN.type) as UntypedFormControl;
}
set typeFC(control: UntypedFormControl) {
this.setControl(InfosFCN.type, control);
}
get modifiableFC() {
return this.get(InfosFCN.modifiable) as UntypedFormControl;
}
set modifiableFC(control: UntypedFormControl) {
this.setControl(InfosFCN.modifiable, control);
}
get btnTxtFC() {
if (this.type != IArgType.configfile)
return "set"
else
return "download"
}
}

View File

@@ -0,0 +1,38 @@
import { UntypedFormArray, UntypedFormGroup } from '@angular/forms';
import { IModule } from '../api/commands.api';
const enum ModuleFCN {
vars = 'variables',
cmds = 'commands'
}
export class ModuleCtrl extends UntypedFormGroup {
name: string
constructor(imodule: IModule) {
super({})
this.name = imodule.name
this.addControl(ModuleFCN.vars, new UntypedFormArray([]))
this.addControl(ModuleFCN.cmds, new UntypedFormArray([]))
}
get varsFA() {
return this.get(ModuleFCN.vars) as UntypedFormArray;
}
set varsFA(fa: UntypedFormArray) {
this.setControl(ModuleFCN.vars, fa);
}
get cmdsFA() {
return this.get(ModuleFCN.cmds) as UntypedFormArray;
}
set cmdsFA(fa: UntypedFormArray) {
this.setControl(ModuleFCN.cmds, fa);
}
}

View File

@@ -0,0 +1,67 @@
import { UntypedFormControl, UntypedFormGroup } from "@angular/forms";
import { IArgType, IColumn, IParam } from "../api/commands.api";
enum ParamFCN {
value = 'value',
}
export class ParamCtrl extends UntypedFormGroup {
col: IColumn
constructor(public param: IParam) {
super({})
this.col = param.col
let control: UntypedFormControl
switch (param.col.type) {
case IArgType.boolean:
control = new UntypedFormControl((param.value === 'true') ? true : false);
break;
case IArgType.loglvl:
control = new UntypedFormControl(param.value);
break;
default:
control = new UntypedFormControl(param.value)
}
if (!param.col.modifiable) control.disable()
this.addControl(ParamFCN.value, control)
}
get valueFC() {
return this.get(ParamFCN.value) as UntypedFormControl
}
set valueFC(fc: UntypedFormControl) {
this.setControl(ParamFCN.value, fc);
}
api() {
let value: string
switch (this.col.type) {
case IArgType.boolean:
value = String(this.valueFC.value);
break;
default:
value = this.valueFC.value
}
const doc: IParam = {
value: value,
col: this.col
}
return doc
}
}

View File

@@ -0,0 +1,51 @@
import { UntypedFormArray, FormControl, UntypedFormGroup } from '@angular/forms';
import { IArgType, IParam, IRow } from '../api/commands.api';
import { ParamCtrl } from './param.control';
enum RowFCN {
paramsFA = 'params',
}
export class RowCtrl extends UntypedFormGroup {
cmdName: string
rawIndex: number
constructor(row: IRow) {
super({})
this.cmdName = row.cmdName
this.rawIndex = row.rawIndex
this.addControl(RowFCN.paramsFA, new UntypedFormArray(row.params.map(param => new ParamCtrl(param))))
}
get paramsFA() {
return this.get(RowFCN.paramsFA) as UntypedFormArray
}
set paramsFA(fa: UntypedFormArray) {
this.setControl(RowFCN.paramsFA, fa);
}
get paramsCtrls(): ParamCtrl[] {
return this.paramsFA.controls as ParamCtrl[]
}
api() {
const doc: IRow = {
rawIndex: this.rawIndex,
cmdName: this.cmdName,
params: this.paramsCtrls.map(control => control.api())
}
return doc
}
}

View File

@@ -0,0 +1,74 @@
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { IInfo } from '../api/commands.api';
import { IArgType } from '../api/commands.api';
const enum VariablesFCN {
name = 'name',
value = "value",
type = "type",
modifiable = "modifiable"
}
export class VarCtrl extends UntypedFormGroup {
type: IArgType;
constructor(ivar: IInfo) {
super({});
this.type = ivar.type;
this.addControl(VariablesFCN.name, new UntypedFormControl(ivar.name));
this.addControl(VariablesFCN.value, new UntypedFormControl(ivar.value));
this.addControl(VariablesFCN.type, new UntypedFormControl(ivar.type));
this.addControl(VariablesFCN.modifiable, new UntypedFormControl(ivar.modifiable));
}
api() {
const doc: IInfo = {
name: this.nameFC.value,
value: String(this.valueFC.value), //FIXME
type: this.typeFC.value,
modifiable: this.modifiableFC.value
};
return doc;
}
get nameFC() {
return this.get(VariablesFCN.name) as UntypedFormControl;
}
set nameFC(control: UntypedFormControl) {
this.setControl(VariablesFCN.name, control);
}
get valueFC() {
return this.get(VariablesFCN.value) as UntypedFormControl;
}
set valueFC(control: UntypedFormControl) {
this.setControl(VariablesFCN.value, control);
}
get typeFC() {
return this.get(VariablesFCN.type) as UntypedFormControl;
}
set typeFC(control: UntypedFormControl) {
this.setControl(VariablesFCN.type, control);
}
get modifiableFC() {
return this.get(VariablesFCN.modifiable) as UntypedFormControl;
}
set modifiableFC(control: UntypedFormControl) {
this.setControl(VariablesFCN.modifiable, control);
}
get btnTxtFC() {
if (this.type != IArgType.configfile)
return "set"
else
return "download"
}
}

View File

@@ -0,0 +1,55 @@
import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable, throwError } from 'rxjs';
import { catchError, tap } from 'rxjs/operators';
import { DialogService as DialogService } from '../services/dialog.service';
@Injectable()
export class ErrorInterceptor implements HttpInterceptor {
constructor(public dialogService: DialogService) { }
intercept(request: HttpRequest<unknown>, next: HttpHandler) {
return next.handle(request).pipe(
// tap((event: HttpEvent<any>) => {
// if (event instanceof HttpResponse) {
// switch (event.status) {
// case 200:
// case 201:
// this.log(GREEN, request.method + ' ' + event.status + ' Success');
// this.dialogService.openSnackBar(request.method + ' ' + event.status + ' Success');
// break;
// default:
// break;
// }
// // return throwError(event.body);
// }
// }),
catchError((error: HttpErrorResponse) => {
switch (error.status) {
case 400:
case 403:
case 501:
case 500:
this.log(YELLOW, request.method + ' ' + error.status + ' Error: ' + error.error);
this.dialogService.openErrorDialog(error);
break;
default:
break;
}
return throwError(error.error);
}),
);
}
private log = (color: string, txt: string) => console.log(color, '[API] ' + txt);
}
const RED = '\x1b[31m%s\x1b[0m';
const GREEN = '\x1b[32m%s\x1b[0m';
const YELLOW = '\x1b[33m%s\x1b[0m';
const MAGENTA = '\x1b[35m%s\x1b[0m';
const CYAN = '\x1b[36m%s%s\x1b[0m';

View File

@@ -0,0 +1,8 @@
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { ErrorInterceptor } from './error.interceptor';
import { SpinnerInterceptor } from './spinner.interceptor';
export const InterceptorProviders = [
{ provide: HTTP_INTERCEPTORS, useClass: SpinnerInterceptor, multi: true },
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
];

Some files were not shown because too many files have changed in this diff Show More