Compare commits

...

711 Commits

Author SHA1 Message Date
Yalu Zhang
530cca802a Remove unnecessary dependencies in package dectmngr 2020-11-13 16:32:38 +01:00
Anjan Chanda
d7f6c6a9f7 ieee1905: 2.1.0 2020-11-13 16:32:38 +01:00
Jakob Olsson
1416a64348 ieee1905: 20.0.30 - release-5.3 branch 2020-11-13 16:32:38 +01:00
Jakob Olsson
611d6bcee9 Revert "ieee1905: 20.0.30"
This reverts commit f01bd18ffc.
2020-11-13 16:32:38 +01:00
Jakob Olsson
8dba98e282 ieee1905: 20.0.30 2020-11-13 16:32:38 +01:00
Omar Kallel
febad86760 icwmp: 5.0-2020-10-13 2020-11-13 16:32:38 +01:00
Amin Ben Ramdhane
a56f8d7be9 bbf: 2.5-2020-10-26 2020-11-13 16:32:38 +01:00
Arun Muthusamy
5ea8207cef Add Libreswan package 2020-11-13 16:32:38 +01:00
Amin Ben Ramdhane
1dfba64bde bbf: 2.5-2020-10-23 2020-11-13 16:32:38 +01:00
Sukru Senli
bcbc7999cd iop: config: selectm miniupnpc by default 2020-11-13 16:32:38 +01:00
Jakob Olsson
5c78b83ac8 map-1905: 0.0.13 2020-11-13 16:32:38 +01:00
Rahul
ef8c6eb8c9 qosmngr: add log
Syslog added to log non-availability of traffic policing on the wan
port on 63138, this is a chip level limitation.
2020-11-13 16:32:38 +01:00
Rahul
7e7867becf qosmngr: add support for dhcp option as classification criteria
DHCP option value 60, 61 and 77 can now be used to identify lan
clients. Details of UCI as follows:

config classify
    option src_vendor_class_id 'abc' // DHCP option 60.
    option dst_vendor_class_id 'abc' // DHCP option 60.
    option src_client_id 'xyz'       // DHCP option 61
    option dst_client_id 'xyz'       // DHCP option 61
    option src_user_class_id 'dfg'   // DHCP option 77
    option dst_user_class_id 'dfg'   // DHCP option 77
2020-11-13 16:32:38 +01:00
Rahul
a03a91f858 qosmngr: add support for upstream policing on dg400prime
This patch adds support for upstream policing on dg400prime.
Downstream policing still seems to be an issue for which ticket
has been re-opened on broadcom.

Test:
Upstream policing test script passes on both panther and dg400prime.
2020-11-13 16:32:38 +01:00
Amin Ben Ramdhane
370d03eaf6 bbf: fix SentOption segfault issue 2020-11-13 16:32:38 +01:00
Amin Ben Ramdhane
e142514135 bbf: fix DHCPv4 MaxAddress 2020-11-13 16:32:38 +01:00
Sukru Senli
7e19d3550a bbf: 2.4-2020-10-10 2020-11-13 16:32:38 +01:00
Sukru Senli
b0cc223750 icwmp: keep cwmp session backup xml file over upgrade 2020-11-13 16:32:38 +01:00
Omar Kallel
bf8c210f3b Rename uci notify options && remove ubus call tr069 notify from the init 2020-11-13 16:32:38 +01:00
Omar Kallel
493d8b05cd icwmp: 09-10-2020 2020-11-13 16:32:38 +01:00
Omar Kallel
13b5958852 Add new notification feature & delete icwmp_notifd 2020-11-13 16:32:38 +01:00
Sukru Senli
02ff58d9c2 iop: select rsync; needed by upgrade script
rsync is GPLv3 so we need to make upgrade script independent of it
2020-11-13 16:32:38 +01:00
Amin Ben Ramdhane
59dc9afe0f bbf: 2.4-2020-10-09 2020-11-13 16:32:38 +01:00
Omar
70f9fc7854 icwmp: 5.0-2020-10-09 2020-11-13 16:32:38 +01:00
sverma
da43c27174 wfadatad: Misc Fixes.
* Added mandatory profile-2 tlvs
	* Topology query responded only when it's having map-2 provile TLV
	* Added support for ieee1905.neighbor event
2020-11-13 16:32:38 +01:00
Raphael Derensy
82b06b2365 iop: select atftp and atftpd as modules 2020-11-13 16:32:38 +01:00
vdutta
ad64108ada map-1905: Fix parsing of channel preference tlv 2020-11-13 16:32:38 +01:00
nevadita.chatterjee
9108ff44bc map-topology:Added version 2020-11-13 16:32:38 +01:00
Omar Kallel
0915525fd0 icwmp: 5.0-2020-10-07 2020-11-13 16:32:38 +01:00
Omar Kallel
958ff29190 bbf: 2.4-2020-10-07 2020-11-13 16:32:38 +01:00
Sukru Senli
cc32f540d4 iop: deselect some gplv3 packages 2020-11-13 16:32:38 +01:00
Jakob Olsson
b2823a6b1d rulengd: add regex match to event name 2020-11-13 16:32:38 +01:00
Sukru Senli
d3d0584056 icwmp: remove unnecessary parts from init script 2020-11-13 16:32:38 +01:00
vdutta
8372c9c7ad ieee1905: Fix crash in ex400 2020-11-13 16:32:38 +01:00
vdutta
faa39d1d15 map-1905: Multiple fixes
- Change structure for countrycode in CAC capability
 - Fix segfault in timestamp tlv
2020-11-13 16:32:38 +01:00
Omar Kallel
e0b38245e1 bbf: 2020-10-02 2020-11-13 16:32:38 +01:00
Omar Kallel
f40d078a3b icwmp: 2020-10-02 2020-11-13 16:32:38 +01:00
Jakob Olsson
87cf33663c wifimngr: 8.2.9 2020-11-13 16:32:38 +01:00
Jakob Olsson
99e5dd1443 easy-soc-libs: 5.3.15 2020-11-13 16:32:38 +01:00
Yalu Zhang
7f53336a83 Rename package dspg_test_app to dectmngr
Also rename cmbs_tcx to dectmngr
2020-11-13 15:21:01 +01:00
Yalu Zhang
32479eab89 Update makefile to generate libdect.so 2020-10-22 11:58:17 +02:00
Yalu Zhang
7e607d8e09 Add .config file which enables ALSA kernel modules, libraries and utilities
arecord and aplay can be used to record and play during a call between DECT phone and CPE
which is initiated by pressing 'o' from the test application

~/git/iopsyswrt$ cat .config|egrep -i "alsa|sound|audio|usb"|grep -v "not set"
CONFIG_DEFAULT_asterisk-sounds=y
CONFIG_AUDIO_SUPPORT=y
CONFIG_USB_SUPPORT=y
CONFIG_BUSYBOX_CONFIG_LSUSB=y
CONFIG_PACKAGE_alsa-lib=y
CONFIG_PACKAGE_libffmpeg-audio-dec=y
CONFIG_PACKAGE_libusb-1.0=y
CONFIG_PACKAGE_libusb-compat=y
CONFIG_PACKAGE_asterisk-sounds=y
CONFIG_PACKAGE_alsa-utils=y
CONFIG_PACKAGE_alsa-utils-seq=y
CONFIG_PACKAGE_alsa-utils-tests=y
CONFIG_PACKAGE_usb-modeswitch=y
CONFIG_PACKAGE_usbreset=y

iopsyswrt/build_dir/target-arm_xscale_musl_eabi/linux-iopsys-brcm63xx-arm/linux-dev_iopsys_eu_broadcom_bcmlinux_git-HEAD$ cat .config |egrep -i "alsa|sound|audio|usb"|grep -v "not set"|grep -v "#"
CONFIG_SOUND=y
CONFIG_SOUND_OSS_CORE=y # Perhaps not needed
CONFIG_SOUND_OSS_CORE_PRECLAIM=y # Perhaps not needed
CONFIG_SND_USB=y
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_SUPPORT=y
CONFIG_USB_COMMON=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB=y
CONFIG_USB_DEFAULT_PERSIST=y
2020-10-14 14:35:53 +02:00
Yalu Zhang
7528a4a11f Improve load_sound_modules.sh a bit 2020-10-14 12:01:41 +02:00
Yalu Zhang
77b306d598 Add a script to load/unload Linux sound kermodules 2020-10-14 11:55:52 +02:00
Yalu Zhang
575a88afdd Make it easier to compile in Linux other than iopsyswrt 2020-10-14 11:55:52 +02:00
Yalu Zhang
6741df8952 Remove unused source files
- folder frame/vone
- cfr_coma.c
2020-10-14 11:55:52 +02:00
Yalu Zhang
60f9815721 Remove unused source files in the folder frame/vone 2020-10-08 10:46:27 +02:00
Yalu Zhang
4cab43e30d Add DSPG test application version 4.13_build_6rc7
The contents in foler src/ are imported from DSPG's tarball.
2020-10-01 17:07:01 +02:00
Rahul
342bec0b25 qosmngr: add support for traffic policing
Support for traffic policing added to allow configuration of
ingress rate limiting.

Test (on panther):
- ingress rate limiting on per lan port basis for US traffic.
- ingress rate limiting on wan port for DS traffic.
- when ingress rate limiting is applied on traffic in one direction,
  then traffic in other direction remains un-affected, that is, if
  ingress rate limiting is applied in DS, then US traffic on the port
  is unaffected

Note: Autotest are ready and will be merge for now with the tag not_ready.
Once devel is ready or if we decide to merge this to release-5.3, the same
can be tagged ready and executed as part of nightly suite.
2020-09-30 09:10:39 +02:00
Anjan Chanda
3942b33e1e wifimngr: 8.2.8 2020-09-29 21:51:19 +02:00
Anjan Chanda
3c3608e87c easy-soc-libs: 5.3.14 2020-09-29 21:51:04 +02:00
Amin Ben Ramdhane
aaf0029500 bbf: 2.4-2020-09-29 2020-09-29 19:20:14 +01:00
Amin Ben Ramdhane
7b80bcf104 icwmp: 5.0-2020-09-29 2020-09-29 19:18:18 +01:00
Raphael Derensy
f419a955f6 iop: select vsftpd-tls as module 2020-09-29 11:40:08 +02:00
Suru Dissanaike
d644ce7be6 iop: config, change rsync to module 2020-09-28 11:10:32 +02:00
Amin Ben Ramdhane
887ff49b95 bbf: 2.3-2020-09-26 2020-09-26 17:30:01 +01:00
Amin Ben Ramdhane
9c6533f45f bbf: 2.2-2020-09-24 2020-09-24 16:15:38 +01:00
Jakob Olsson
08f903e2c1 wifimngr: 8.2.7 2020-09-24 15:02:56 +02:00
Jakob Olsson
833837cea1 easy-soc-libs: 5.3.9 2020-09-24 15:01:22 +02:00
vdutta
dabf83ea1d uspd: B#3272 improvements in resolving paths 2020-09-24 13:48:33 +05:30
Anjan Chanda
0e6146f105 map-topology: 1.5.5 - notify topology change event 2020-09-24 09:33:04 +02:00
Amin Ben Ramdhane
220a4efbf7 Ticket refs #3228: QEMU - ICWMP is segfaulting
Fix missing objects
2020-09-23 19:21:14 +01:00
vdutta
e5d8d81019 ieee1905: Get auth mode from bss.security 2020-09-23 19:07:59 +05:30
vdutta
70442e891f ieee1905: Remove redundant info from ubus objects 2020-09-22 19:52:21 +05:30
Sukru Senli
ec021d54f5 iop: genconfig: comment out mediatek open parts 2020-09-22 12:33:08 +02:00
Amin Ben Ramdhane
421e633094 bbf: 2.1-2020-09-21 2020-09-21 18:16:25 +01:00
Jakob Olsson
068308f052 rearrange start orders for topology and ieee1905 2020-09-21 16:15:39 +02:00
Omar Kallel
8809a7aba7 bbf: fix segfault 2020-09-21 14:05:15 +02:00
Omar Kallel
7575dccbc0 icwmp: 5.0-2020-09-21 2020-09-21 14:04:53 +02:00
Jakob Olsson
871831fdac wfadatad: use service_running hook to wait for ieee1905 object 2020-09-21 09:12:27 +02:00
Amin Ben Ramdhane
db41d298c3 bbf: 2.0-2020-09-21 2020-09-21 09:09:54 +02:00
Jakob Olsson
ad372152d5 ieee1905: config trigger to reload 2020-09-21 09:01:11 +02:00
Jakob Olsson
926648b090 ieee1905: change start order from 99 to 13 2020-09-21 08:49:34 +02:00
Jakob Olsson
240bdc5bb8 wfadatad: wait up to 2 seconds if ieee1905 is not up before start 2020-09-21 08:49:14 +02:00
Amin Ben Ramdhane
45e0b4f2ed bbf: 2.0-2020-09-18 2020-09-18 15:19:14 +01:00
Jakob Olsson
332a90d087 map-topology: iterate til ieee1905 object is up 2020-09-18 16:13:32 +02:00
Anjan Chanda
09937f540a ieee1905d: enable map plugin in default config 2020-09-18 15:17:57 +02:00
Anjan Chanda
af8f27ef65 wfadatad: 2.3.0 2020-09-18 15:13:12 +02:00
Jakob Olsson
8a799f183b easy-soc-libs: libeasy: include debug.h 2020-09-18 14:34:00 +02:00
sverma
2dbf38c06c wfadatad: Changes UBUS objects name 2020-09-18 13:35:17 +02:00
Anjan Chanda
b1fcc12599 wifimngr: 8.2.3 2020-09-18 13:31:04 +02:00
Anjan Chanda
9041f616e7 easy-soc-libs: 5.3.3 2020-09-18 13:30:32 +02:00
Anjan Chanda
dc14b18428 map-topology: 1.5.1 2020-09-18 13:29:33 +02:00
Amin Ben Ramdhane
e41f973953 xmpp, udpecho, twamp: compile with fPIC 2020-09-18 12:07:17 +02:00
vdutta
9889814f0b uspd: Optimizations to reduce high cpu usages 2020-09-17 16:22:17 +05:30
Sukru Senli
2922f211f7 bulkdata: compile with fPIC 2020-09-16 10:02:59 +02:00
Sukru Senli
22dd43c79e icwmp: set userid empty in cwmp config; it will be filled by uci-default 2020-09-16 08:22:07 +02:00
Omar Kallel
478c34d48f icwmp: add the file /lib/upgrade/keep.d/icwmp when installing icwmp 2020-09-15 16:25:26 +02:00
Sukru Senli
49f46ef075 icwmp: 5.0-2020-09-15 2020-09-15 16:18:16 +02:00
Sukru Senli
03dc0ebb72 bbf: 2.0-2020-09-15 2020-09-15 16:11:15 +02:00
Sukru Senli
fa44657557 move trx69 packages out of trx69 folder 2020-09-14 18:28:00 +02:00
nevadita.chatterjee
42a3ed939a map-topology: Config file change 2020-09-14 18:27:00 +02:00
Markus Gothe
6e35356954 Fix gryphon LED module crash.
Update gryphon LED module to work with Linux 4.1
and not to crash when 'gpiod_get_index()' fails.

Change-Id: I27fcbe3ad9dbc755eabdd3f2120544b171b07885
2020-09-14 18:26:58 +02:00
Roman Azarenko
7978a656a7 iop: generate_tarballs: bcmkernel: add symlink if missing, partially fix shellcheck warnings 2020-09-14 18:26:56 +02:00
Sukru Senli
17322c3cba iop: config: select icwmp and bulkdata 2020-09-14 18:26:43 +02:00
Amin Ben Ramdhane
890b627139 icwmp: 5.0-2020-09-10 2020-09-14 18:22:21 +02:00
Amin Ben Ramdhane
0ad28b756b Ticket #2910: Separate BBF packages to their own packages with their own config files 2020-09-14 18:22:21 +02:00
Omar Kallel
309c26f4b0 icwmp: 09-09-2020 2020-09-14 18:22:21 +02:00
Omar Kallel
df4e11ae30 icwmp: Active notification 08/09/2020 2020-09-14 18:22:21 +02:00
Amin Ben Ramdhane
9de4a18a20 bbf: 2.0-2020-09-08 2020-09-14 18:22:21 +02:00
Sukru Senli
bfcc877a6a Revert "bbf: 1.9-2020-09-07"
This reverts commit 24a82ab61c.
2020-09-14 18:22:21 +02:00
Suru Dissanaike
d9527a5a1a icwmp: userid fix release, missing check if value is already present 2020-09-14 11:44:38 +02:00
Jakob Olsson
e707922d29 map-topology: override log func to supress prints 2020-09-14 09:06:53 +02:00
vdutta
cfc2e6d9eb obsupa: Increase ubus timeout to 10s 2020-09-11 16:52:41 +05:30
Jakob Olsson
0ec3e0eae8 map-topology: implement service discovery via dns-sd 2020-09-10 17:09:38 +02:00
Sukru Senli
38c4c7ded0 questd: 5.1.12: MAX_CLIENT increased to 256 2020-09-08 16:29:33 +02:00
Sukru Senli
24a82ab61c bbf: 1.9-2020-09-07 2020-09-08 12:55:20 +02:00
vdutta
5977ec807c uspd: Align with new gitlab ci 2020-09-08 15:47:23 +05:30
Rahul
90c5c5c52c qosmngr: add support for mixed mode
A couple of bugs detected during autotest are resolved, details as
follows:
1. Assumes precedence is qid, which is incorrect, does not allow config
of WRR queues which require precedence to be 0 for all queues.

As a consequence, the logic to configure and read queue stats had to be
updated, no change in behaviour though, that is, no regression.

As a neat outcome of this change, mixed mode scheduling can now be configured
on upstream queues, for which autotests are also being added now.

To verify that no regression is caused by this change, QoS L2 and L3 suite
were executed on both platform and were found to pass, hence, this change
is ready to submit.
2020-09-06 09:43:42 +05:30
vdutta
f7cb4c8aac ieee1905: Fix DG400prime crash
- Fix segfault in DG400prime on startup
 - Optimize ACS renew handling
2020-09-04 16:12:00 +05:30
Amin Ben Ramdhane
07cbf0938e bbf:Added support for IEEE1905 datamodel 2020-09-02 17:58:05 +01:00
Rahul
a31bb99c30 mcastmngr: resolve bug #3015
Configuration of robustness value and fast leave in snooping take
effect.
2020-09-02 18:50:09 +05:30
Suru Dissanaike
80e3d89d9a IOP: added owsd 2020-09-02 13:43:04 +02:00
Amin Ben Ramdhane
d26eaf0ef0 bbf: 1.8-2020-09-01 2020-09-01 20:01:12 +01:00
Amin Ben Ramdhane
e437fc821e bbf: fix issue in get schema method 2020-08-31 15:05:42 +01:00
Markus Gothe
c86d16daf9 Redmine#27829 - easy-soc-libs: Use correct chipset defintions
The struct for passing ioctl() data does differ in size
(and offsets) on different platforms, hence we need to pass
the correct defines to the compiler.

Change-Id: If81a4bd79b21c5e93443e5ef48fb3f1b07058f60
2020-08-31 15:36:45 +02:00
Amin Ben Ramdhane
a91b41d70a bbf: 1.7-2020-08-31 2020-08-31 11:26:47 +01:00
Rahul
847b27c879 qosmngr: flush flows
After every QoS config, it is required that flows are flushed. Instead
of doing this as an extrenal step, its good to integrate this in the
qosmngr itself so that each config is atomically competent enough to
take effect with any further steps needed manually.
2020-08-31 15:42:30 +05:30
vdutta
89fe5115f0 obuspa: Fix registration of routing objects 2020-08-31 15:31:03 +05:30
vdutta
aba88e359d uspd: Fix ubus freeze issue 2020-08-31 15:28:25 +05:30
Kenneth Johansson
84b594e9bf Endprmngr: do not build if TARGET_NO_VOICE is set. 2020-08-28 18:20:33 +02:00
Jakob Olsson
e3dd402d4e owsd: let written be longer than len 2020-08-28 13:37:39 +02:00
Rahul
a06ffa00ce qosmngr: clean shaper config
Bug identified: if a shaper config is removed from the UCI file,
it still remains active on the port since the logic to clean shaper
config is missing in the qosmngr.

Resolution: clean shapers on each reload so that fresh config takes
place as per the UCI file.
2020-08-28 14:19:06 +05:30
sverma
c3c5d4ff8b wfadatad: Fixed remote device scanresult data. 2020-08-27 18:52:05 +05:30
vdutta
bb996c64df uspd: Remove dependency on cwmp config 2020-08-27 18:46:13 +05:30
vdutta
adbb8b70c1 ieee1905: Add functional tests 2020-08-27 13:45:47 +05:30
vdutta
34b3478d77 map-1905: Add functional api tests 2020-08-27 13:43:35 +05:30
vdutta
181dd5039e uspd: Align with bbf trailing dot fix 2020-08-27 13:41:02 +05:30
Anjan Chanda
10e83915c7 easy-soc-libs: 4.8.6 2020-08-26 21:00:07 +02:00
Anjan Chanda
59e0b78e84 iop: select ieee1905, map-plugin, map-topology and wfadatad 2020-08-26 20:48:32 +02:00
Rahul
c1e7c8f103 qosmngr: improve l2 classification logic
I noticed that there is a potential improvement in the way the
ebtables rules are generated from the UCI file. The thing is,
a restart of the firewall does not flush the ebtables, so, the
ebtables have to flushed by adding the ebtables -t broute -F
command in the firewall.qos (or any other script) to remove the
rules generated by firewall.qos. This also flushes the rule that
directed the lookup of the qos chain. Now, to the rule to lookup
qos chain needs to be manually added which I think is not the best
thing to do. The qosmngr should be independent in this regard, hence,
this improvement.
2020-08-26 17:03:59 +05:30
Anjan Chanda
de9a7c447d wfadatad: 2.2.1 2020-08-26 13:10:41 +02:00
nevadita.chatterjee
8cbcc039d7 map-topology:version 1.4.2 2020-08-26 12:53:07 +02:00
Amin Ben Ramdhane
044dd31be4 bbf: 1.7-2020-08-26 2020-08-26 11:30:14 +01:00
Omar Kallel
48b286031a bbf: Fix InterfaceStack issues 2020-08-26 10:36:26 +01:00
sverma
ee3dceb433 wfadatad: wfa_delm exec name rename to wfadatad 2020-08-26 13:56:26 +05:30
Anjan Chanda
aa1353f08e map-topology: 1.4.1 2020-08-24 16:29:23 +02:00
vdutta
682497f68c map-1905: Added 0.0.9 2020-08-24 18:04:28 +05:30
vdutta
bfb98073c1 ieee1905: Added 2.0.24
- Renaming lib1905 to libieee1905
 - test: Add functional test and docs
 - Remove dependency on mq_ APIs
 - ubus: Added higher layer response in broadcast list
 - Fix crash in ex400
2020-08-24 17:59:21 +05:30
Rahul
a8960be7b5 qosmngr: cumulative counters on dg400prime and eg400
The runner hardware on both the chips are different due to which
the operation of counter read on dg400prime and eg400 units is
actually a read and reset. As a result cumulative counter values
are not available.

To uniformalise the behaviour of qosmngr across platforms, handling
is added to represent cumulative value of counters.

Test:
Scripts that were earlier failing on dg400prime and passing on panther
in the QoS L3 suite were executed and with this fix scripts pass on both
the platforms. This is a good enough indicator beside the manual tests,
that the issue now stands resolved.

Note: pending scripts can now be closed with this fix.
2020-08-24 16:35:05 +05:30
Ronny Nilsson
6255b9b2df iop: remove BusyBox web server since we never use it. 2020-08-21 16:39:05 +02:00
Ronny Nilsson
4e11dda2c0 iop: add packages necessary for boot from block device. 2020-08-21 16:39:05 +02:00
Anjan Chanda
c898217717 map-topology: 1.4.0 2020-08-21 15:14:20 +02:00
Anjan Chanda
4d2358aa2a wifimngr: 7.8.0 2020-08-21 15:02:29 +02:00
Anjan Chanda
d3fb4ec562 easy-soc-libs: 4.8.0 2020-08-21 15:01:41 +02:00
Anjan Chanda
b06ca2b5e5 wfadatad: 2.2.0 - fix standalone mode build 2020-08-20 20:02:04 +02:00
nevadita.chatterjee
30928e5eb9 feeds: Makefile changes in map-topology 2020-08-20 12:34:23 +05:30
vdutta
c75d639a69 ieee1905: Added 2.0.23 2020-08-17 13:02:40 +05:30
vdutta
0bb19c25f7 map-1905: Added 0.0.8 2020-08-17 13:00:45 +05:30
Anjan Chanda
64a826896d Revert "map-topology: 1.2.0"
This reverts commit eee9c7a70c.
2020-08-14 16:58:12 +02:00
Anjan Chanda
eee9c7a70c map-topology: 1.2.0 2020-08-14 16:43:51 +02:00
vdutta
0c0e9f15f2 uspd: Added 2.0.0 2020-08-14 11:49:29 +05:30
vdutta
48ab39fa31 obuspa: Align with usp-2.0 2020-08-14 11:46:16 +05:30
Andreas Gnau
6914c0548f endptmngr: Disable hash check open tarball 2020-08-13 18:36:19 +02:00
Roman Azarenko
ffe74261d9 iop: config: add $TMOUT support in busybox ash
This feature will prove useful to close idle sessions in automation workflows.

On mips 24kc, this feature adds 16 bytes to busybox executable,
therefore its effect on image size is negligible.
2020-08-11 15:38:12 +02:00
Anjan Chanda
1b5630c67e easy-soc-libs: 4.7.12 2020-08-10 08:37:43 +02:00
Anjan Chanda
2bf5014aeb easy-soc-libs: 4.7.4 2020-08-02 17:43:47 +02:00
Anjan Chanda
279a583d23 map-topology: 1.1.0 2020-08-02 17:43:23 +02:00
Bartlomiej Grzeskowiak
0a0cad9715 wifimngr: ease wifimngr debugging
Two params are needed to enable wifimngr debugging.
1. env IOP_LLA_LIBS_DEBUG=3    #for debugging only
2. stderr 1
Second param is added and commented out by default.

Signed-off-by: Bartlomiej Grzeskowiak <bartlomiej.grzeskowiak@iopsys.eu>
2020-07-31 11:28:32 +02:00
Anjan Chanda
74618b9377 map-topology: 1.0.0 2020-07-29 14:05:55 +02:00
Anjan Chanda
5ff2854490 ieee1905: 2.0.22 2020-07-29 14:04:20 +02:00
Anjan Chanda
7ae3a29d08 wifimngr: 6.2.0 2020-07-28 09:48:16 +02:00
Anjan Chanda
68e4189d05 easy-soc-libs: 4.6.0 2020-07-28 09:47:48 +02:00
Rahul
c0f7c0ecf1 mcastmngr: handle mcast config for ifup in snooping
The handling of ifup event in case of snooping config was missing.

Note: ifup event is generated only for l3 interface, so, say ethx is
member of br-y which has proto none. In this case if ethx link goes
down and comes up again, IPTV will not work without a mcast reload.
From the look of it this will be the case in old version as well and
at the moment I don't know how this can be handled but considering this
is a remote scenario in my opinion I don't think the risk is too high.
I would continue to look for a solution ofcourse.
2020-07-17 12:25:17 +05:30
vdutta
825f1ff76d ieee1905: Change plugin path 2020-07-17 10:36:38 +05:30
vdutta
7fa1bf30c1 map-1905: Change plugin path
- Remove unused compile time flags
2020-07-17 10:26:07 +05:30
Anjan Chanda
ee3e6d5975 wifimngr: 3.4.1 2020-07-16 16:29:45 +02:00
Anjan Chanda
96d0a3fba8 easy-soc-libs: 4.4.1 2020-07-16 16:27:07 +02:00
vdutta
7b158a918a ieee1905: Updated readme 2020-07-15 15:38:08 +05:30
vdutta
6bad87c47f map-1905: Copy plugin in correct path 2020-07-15 15:36:28 +05:30
Anjan Chanda
c73ae26618 wifimngr: 3.1.4 2020-07-13 15:58:11 +02:00
Anjan Chanda
d73a60a4f3 easy-soc-libs: 4.1.8 2020-07-13 15:55:14 +02:00
vdutta
0c52946965 obuspa: Updated to 2.0.19 2020-07-13 18:42:57 +05:30
vdutta
e89485f19c uspd: Added 1.0.26 2020-07-13 18:37:06 +05:30
Amin Ben Ramdhane
bfb73ba4b5 bbf: 1.6-2020-07-10 2020-07-11 12:44:18 +02:00
Anjan Chanda
b3e19722b7 easy-soc-libs: 4.0.2 2020-07-10 10:43:14 +02:00
vdutta
908ef455c2 map-1905: Added map-1905 0.0.5 version 2020-07-10 10:13:20 +05:30
vdutta
950687c88b ieee1905: ieee1905-2.0.19 2020-07-10 09:45:49 +05:30
Amin Ben Ramdhane
5675ff87de bbf: 1.6-2020-07-08 2020-07-08 18:45:53 +01:00
Anjan Chanda
ae0213ce8c wifimngr 3.0.1 2020-07-08 12:52:22 +02:00
Anjan Chanda
a45957e872 easy-soc-libs 4.0.1 2020-07-08 12:52:04 +02:00
Amin Ben Ramdhane
2c67b66e15 bbf: 1.5-2020-07-07 2020-07-08 09:05:25 +01:00
Omar Kallel
bf5b932a93 icwmp: 2020-07-07 2020-07-07 10:52:26 +01:00
Rahul
3f6c55a86d mcastmngr: fix multicast forwarding on untagged interface.
Modifying the lookup method for forwarding multicast packets enables
forwarding on both tagged and untagged upstream interfaces.

I have tested:
- forwarding of traffic in untagged interface.
- forwarding of traffic on tagged interface.
- response to queries in above scenarios by upstream server.
- forwarding of unsolicited joins and leaves to upstream server.

I cannot see a fault at the moment
2020-07-06 16:45:05 +05:30
Anjan Chanda
133c45e91d map-controller-1.0.1: initial 2020-07-03 09:24:01 +02:00
Amin Ben Ramdhane
fce1fa2eae bbf: 1.5-2020-06-30 2020-06-30 19:13:05 +01:00
Andreas Gnau
986fc5ea78 Make dev-check check for SSH instead of non-HTTP
In order to determine, whether we are developers or not, check the
git-remotes for SSH-URLs instead of checking for the non-existence of
any HTTP-URLs. This fixes dev-mode not being detected properly when
curious devs add other HTTP-remotes such as upstream OpenWRT.

This also makes the check consistent with the check done in the main
"iop" script in the root.
2020-06-30 13:12:51 +02:00
pitchaiah prakash
95e887087f peripheral_manager: 1.0.5 2020-06-30 10:54:13 +02:00
vdutta
0082d26141 obsupa: Suppress schema errors in get if its present in uspd 2020-06-30 11:19:27 +05:30
Saurabh Verma
2306b1e76f map-topology: Makefile added 2020-06-26 14:19:59 +02:00
Suru Dissanaike
7b432d88f8 IOP: added support for iopsys-armvirt and x86 target 2020-06-26 13:47:28 +02:00
Sukru Senli
c56aed73d4 icwmp-4.0-2020-06-25 2020-06-26 10:19:07 +02:00
vdutta
af719df40c obuspa: Multiple fixes
- 447a01c vendor_uspd: Multiple fixes
 - d269d52 vendor_upsd: fix schema not getting created
 - 82a3765 openwrt: Set destination for MTP config
 - 63eac80 openwrt: Change destination default config value
2020-06-26 13:31:35 +05:30
vdutta
2d25beb3ab uspd: Multiple fixes
- bb11466 Initialise blob_buf before use
 - e23b2b4 Show "value" parameter on get_names_safe
2020-06-26 13:29:17 +05:30
vdutta
ba561afb24 ieee1905: Multiple fixes
- Supports reassembly of fragmented cmdus
 - Dependency on json config file removed
 - Support reliable multicast for map cmdus
 - Do cleanup on exit
 - Memory related fixes
2020-06-25 15:59:10 +05:30
Sukru Senli
4f8906c1f7 obuspa: log to stdout by default 2020-06-25 09:02:07 +02:00
Jakob Olsson
42c7aafb93 iop: config: select juci-sysupgrade and rpcd-mod-rpcsys by default 2020-06-24 09:55:14 +02:00
Jakob Olsson
6c1b78b69d owsd: make async cleanout timeout more leniant 2020-06-23 16:48:05 +02:00
Amin Ben Ramdhane
1eade44fe6 bbf: 1.5-2020-06-22 2020-06-22 16:50:41 +01:00
Anjan Chanda
834522d107 wifimngr: 2.9.2 - show supp_bands in radio info 2020-06-22 15:58:30 +02:00
vdutta
cc65e6ce52 obuspa: Fix duplicate alias entries from get 2020-06-19 16:53:52 +05:30
vdutta
b2061f27e0 obsupa: Dynamic registration of dm_schema 2020-06-19 14:34:26 +05:30
vdutta
cc26f7bbe9 uspd: Added object type and permission in object_names 2020-06-19 14:31:37 +05:30
Amin Ben Ramdhane
6841172f75 bbf: 1.5-2020-06-19 2020-06-19 09:58:33 +01:00
Sukru Senli
8fd7232ea2 peripheral_manager: 1.0.4
pitchaiah prakash <pitchaiah.murugan@iopsys.eu>
2020-06-19 10:45:31 +02:00
Sukru Senli
4d7ac5941e bbf: correct wifi associated device noise value mapping 2020-06-18 16:09:25 +02:00
Sukru Senli
2bd9e1ac13 bbf: 1.5-2020-06-17 2020-06-18 15:47:38 +02:00
Sukru Senli
766379c8e4 Revert "config: enable hostapd_cli and mpstat"
This reverts commit dd8edbec71.
2020-06-18 14:56:50 +02:00
Janusz Dziedzic
dd8edbec71 config: enable hostapd_cli and mpstat
For opensource iopsys-ramips we will use
hostapd_cli from libwifi.

Enable mpstat to get correct picture of
CPU/cores usage for platforms with more
than one CPU.

After that we have output like:

root@iopsys:~# mpstat -P ALL 2
Linux 4.14.171 (iopsys)         06/18/20        _mips_  (4 CPU)

CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
all    0.50    0.00    0.75    0.00    0.00    0.50    0.00    0.00    0.00   98.26
  0    1.00    0.00    1.00    0.00    0.00    0.50    0.00    0.00    0.00   97.51
  1    0.50    0.00    1.00    0.00    0.00    0.00    0.00    0.00    0.00   98.51
  2    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00
  3    0.50    0.00    1.00    0.00    0.00    1.49    0.00    0.00    0.00   97.01

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2020-06-18 14:01:02 +02:00
Anjan Chanda
a0bfac1658 wfadatad: fix dependency on map-agent 2020-06-17 17:12:13 +02:00
Anjan Chanda
ec68c58bb7 easy-soc-events: copy kmod to proper path for brcm-arm 2020-06-17 17:06:49 +02:00
Omar Kallel
701a77b6b3 icwmp: 2020-06-17 2020-06-17 11:56:08 +01:00
Janusz Dziedzic
18e94a6b47 iopsys-ramips: set subtarget in genconfig.sh
Today we base on open source code/tree.
In this code we need to setup subtarget
correctly.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2020-06-16 21:52:41 +02:00
vdutta
514a85703c obuspa: Override get values from uspd 2020-06-16 16:25:09 +05:30
Markus Gothe
e72ef7290b peripheral-manager: 1.0.3 2020-06-15 20:42:57 +02:00
Jakob Olsson
428a1791ed owsd: fix segfault on remove_client
use safe func when iterating and removing from list
2020-06-15 16:12:13 +02:00
vdutta
43bd7d872f uspd: Multiple fixes
- c2d0d99 uspd: Align ut cases with next-level parameter
 - 46e9475 Add get_safe variant of object_names
 - 366e022 Add ParameterKey to set callback
 - 15b8a80 Cleanup and reuse code
 - 86d72e8 Add get_attributes call
2020-06-15 15:31:19 +05:30
Sukru Senli
1fd62bbfa2 port-management: remove unused functions 2020-06-14 18:27:48 +02:00
Rahul
08c542cf6f mcastmngr: update stats param names, config l2l mcast
- The parameters used for stats are updated.
- Configuration support for lan to lan multicast via UCI added.
2020-06-14 20:15:07 +05:30
Rahul
098f3340b1 mcastmngr: add support for stats
ubus call added to fetch igmp stats, format is,
ubus call mcast stats

Sample output:

root@iopsys:~# ubus call mcast stats
{
	"snooping": [
		{
			"interface": "br-lan",
			"groups": [
				{
					"group_address": "225.10.10.20",
					"associated_devices": [
						{
							"host_address": "192.168.1.152",
							"source_interface": "eth1",
							"timeout": "258"
						}
					]
				},
				{
					"group_address": "225.10.10.2",
					"associated_devices": [
						{
							"host_address": "192.168.1.146",
							"source_interface": "eth0",
							"timeout": "259"
						}
					]
				}
			]
		}
	]
}
2020-06-14 13:26:12 +05:30
Sukru Senli
d43113a471 bbf: 1.5-2020-06-13 2020-06-13 14:53:41 +02:00
Sukru Senli
597fadf578 questd: 5.1.11 2020-06-13 13:47:51 +02:00
Yalu Zhang
d45959b3da Update package easy-soc-libs
libdsl: update header files for Broadcom platform due to upgrading
2020-06-12 14:22:48 +02:00
Sukru Senli
8952a6eca8 bbf: 1.5-2020-06-11 2020-06-11 18:21:04 +02:00
Markus Gothe
c5df7e08a1 peripheral-manager: 1.0.2 2020-06-11 18:04:54 +02:00
vdutta
a2c6430caa obuspa: Align version with obuspa 2020-06-11 20:52:48 +05:30
vdutta
e364957074 uspd: 'next-level' parameter in 'object_names'
a8a90df object_names: add all entries returned from libbbf
0937f3c object_names: add 'next-level' parameter
2020-06-11 20:20:24 +05:30
vdutta
a14e72e26f obuspa: Support dynamic datamodel parameters from uspd
- Skip registration of datamodel objects supported by uspd
2020-06-11 20:13:30 +05:30
Yalu Zhang
fc38f16aa5 Update package endptmngr: Change country code from 3 letters to 2 2020-06-11 16:35:31 +02:00
Markus Gothe
ebf1f8fd39 peripheral_manager: add test-mode 2020-06-11 12:58:42 +02:00
Anjan Chanda
005d53ff14 dslmngr 1.0.1: handle easysoc netlink events 2020-06-10 15:18:47 +02:00
Anjan Chanda
a585061b6c wifimngr: 2.9.1: ignore non-wifi 'easysoc/notify' events 2020-06-10 12:08:33 +02:00
Anjan Chanda
c945f19c3c easy-soc-libs: 3.3.1 - fix event handling when ifname=NULL 2020-06-10 12:06:35 +02:00
Sukru Senli
9566dbfb8e questd: 5.1.10 2020-06-10 11:47:06 +02:00
Sukru Senli
120785335c wifimngr: hotplug script handling wifi and wps button press 2020-06-09 19:58:07 +02:00
Sukru Senli
f87a160b98 inbd: 1.0.1 2020-06-09 19:23:59 +02:00
vdutta
bf6342472a uspd: Updated Readme with log_level 2020-06-09 16:43:13 +05:30
Rahul
36e9c3a3d7 mcastmngr: updates
- Default filter value updated as per requirements.
- Logic added to modify filter ip address as accepted in /var/mcpd.conf
  in broadcom.sh

Noticed one hard coding in qos, fixed that too.
2020-06-09 13:31:33 +05:30
Sukru Senli
3c79856802 bbf: bump version 2020-06-08 18:01:27 +02:00
Sukru Senli
e29ab21280 ndt: add pkg_hash 2020-06-08 16:20:47 +02:00
Rahul
c2b993b494 qosmngr: improvements
- ubus call for reloading each individual service as well as all of
  qos added.
- init script modified to call ubus call and also to have a boot and
  restart section.
- to have separate uci parameters for detination mask and source mask
  make no sense, both destination/source ip and mask in tr181 should
  map to destination/source ip uci parameter, updated.
- firewall rules added by qos are moved to a separate chain, flushing
  is hence restricted to this chain only.
- the hotplug is not really required, hence removed.
2020-06-08 18:44:51 +05:30
vdutta
fbc5226978 uspd: Align operate cmd output 2020-06-08 18:32:10 +05:30
Amin Ben Ramdhane
3d5a5d4697 bbf: add Device.Hosts.Host.{i}.WANStats. object 2020-06-08 12:46:47 +01:00
Sukru Senli
0be99d1bc0 iop: select map package 2020-06-08 13:24:37 +02:00
Sukru Senli
053bfa1442 questd: 5.1.9 2020-06-07 13:58:09 +02:00
vdutta
0346ce9285 uspd: Fix table name in get output 2020-06-06 11:17:37 +05:30
Amin Ben Ramdhane
ae3b959cbf bbf: Ethernet.Interface.{i}.Stats: update stats values 2020-06-05 18:46:00 +01:00
Anjan Chanda
2e10c5845e ethmngr: 1.0.4 2020-06-05 19:29:01 +02:00
Amin Ben Ramdhane
83bb965d81 bbf:1.4-2020-06-05 2020-06-05 15:48:47 +01:00
vdutta
a80cff151d uspd: Added maxdepth and u64 conversion fix
- f101ef0 uspd: Fix conversion of u64 values
 - cf418dc uspd: Align resolve path syntax as per obuspa
 - 1355839 uspd: Added maxdepth in get method of usp object
2020-06-05 19:24:11 +05:30
vdutta
76a5df9115 uspd: Multiple fixes
* Added resolve method to verify object path
* Added check to identify the valid paths before any operation
* Align instance names as per obuspa
* Fix unit test cases as per the new instance syntax
* Fix usp freeze issue on invalid syntax in path
 - ubus call usp get '{"path":"Device.\*"}'
2020-06-05 13:51:34 +05:30
Omar Kallel
e63d9f0445 icwmp: 2020-06-04 2020-06-04 17:26:15 +01:00
Omar Kallel
0432b27f39 bbf: 2020-06-04 2020-06-04 17:19:45 +01:00
Anjan Chanda
dcae4a36ea wifimngr 2.9.0 2020-06-04 16:58:45 +02:00
Anjan Chanda
3dc00d7c04 easy-soc-libs - 3.3.0: libwifi - get wmm params and wifi meta info 2020-06-04 16:57:26 +02:00
Amin Ben Ramdhane
12a7fb224d bbf: 1.4-2020-06-03 2020-06-03 10:31:47 +01:00
Anjan Chanda
dfd2d75021 wifimngr 2.8.1 2020-06-02 13:21:15 +02:00
Anjan Chanda
0bc504232a easy-soc-libs - 3.2.1: libwifi - include noise in station info 2020-06-02 13:16:21 +02:00
Anjan Chanda
6d5bb86e58 ethmngr: 1.0.3 - change ubus methods 2020-06-02 10:58:33 +02:00
vdutta
ff47df64b8 ieee1905: Fix tlv count logic in a stream 2020-06-02 13:10:29 +05:30
Anjan Chanda
b1f86fdc3b ethmngr: 1.0.2 - add 'ethernet' ubus object 2020-06-01 15:03:34 +02:00
Anjan Chanda
a0a457cd35 easy-soc-libs: 3.1.10 - libethernet: update get rmon stats API 2020-06-01 15:00:16 +02:00
Jakob Olsson
0c5f03d50c owsd: make client connection timers configurable 2020-06-01 08:55:39 +02:00
Amin Ben Ramdhane
4c124ccd4e bbf: 1.4-2020-05-31 2020-06-01 00:06:59 +01:00
Amin Ben Ramdhane
321eb8c8e4 tr098:1.0-2020-05-31 2020-06-01 00:02:15 +01:00
Rahul
776dc46d49 qosmngr: fix start up issues
Fixes the issue related to queue setup at boot.
Also resolved classification when source port is used as the
criteria.
2020-05-31 20:36:05 +05:30
Sukru Senli
dcfbd0349a iop: config: deselect crashlog and select iopupgrade as module 2020-05-31 16:18:08 +02:00
Anjan Chanda
ed5d4e572d ethmngr: 1.0.1 - initial version 2020-05-31 12:36:11 +02:00
Anjan Chanda
22429269e2 easy-soc-libs: 3.1.9 libethernet: bcm rom stats and link status 2020-05-31 11:39:56 +02:00
Sukru Senli
eee0fcf3db easy-soc-libs: compile test platform for target iopsys-armvirt 2020-05-31 11:06:36 +02:00
Sukru Senli
9f6f39a094 iop: genconfig: allow explicitly specifying the linux target
same board/profile names might be available under different targets
2020-05-31 10:58:25 +02:00
Sukru Senli
0e0bbb2339 iop: add support for iopsys-armvirt target 2020-05-31 10:58:20 +02:00
Omar Kallel
36ded309bc bbf: 2020-05-30 2020-05-30 23:36:42 +01:00
Sukru Senli
182b08fcbf qosmngr: broadcom needs qsize set 2020-05-30 13:43:51 +02:00
Sukru Senli
17fef094df iop: remove reference to wifilife open 2020-05-30 12:48:04 +02:00
Sukru Senli
bcdbb5dae8 iop: config: select swmodd as module 2020-05-30 10:55:21 +02:00
Sukru Senli
f1be5f4ee4 questd: 5.1.8 2020-05-30 10:49:51 +02:00
Rahul
33eeedcdd7 mcastmngr: fix upstream interface generation 2020-05-29 18:15:59 +05:30
Rahul
5e41b8c3bc qosmngr: enhance support plus fix some bugs
- Enhance support to cover ipv6 rules
- Add support to differentiate between l2 and l3 rules
- Resolve bug related to source interface for output chain
2020-05-29 18:02:09 +05:30
Rohit Topno
4652ec7399 qosmngr: Added support for ip6tables and other change for ifname uci option 2020-05-29 15:24:49 +05:30
Rahul
7cccc5d048 mcastmngr: add check for valid interface
Add check to validate if the configured interface is valid or not
before writing it into the mcpd.conf.
2020-05-29 12:56:01 +05:30
Amin Ben Ramdhane
4843a8e9ff bbf: 1.4-2020-05-28 2020-05-28 20:32:50 +01:00
Amin Ben Ramdhane
a67aedda72 icwmp: 4.0-2020-05-28 2020-05-28 20:31:31 +01:00
Sukru Senli
d5a7db3a91 easy-soc-libs: use test platform for iopsys_x86 target 2020-05-28 17:41:17 +02:00
Jakob Olsson
45190fb2fd iop: add iopsys-x86 target support 2020-05-28 17:25:12 +02:00
Rahul
c8a8cda534 mcastmngr: update proxy config
- generate proxy config by default
- resolve bug in processing multiple upstream or downstream interfaces
- add hotplug script for mcast
- add default values for query interval, response interval and last
  query response interval
2020-05-28 19:48:56 +05:30
pitchaiah prakash
64e0a86b77 Peripheral Manager: Changed the project from autotools to CMake. 2020-05-28 12:39:25 +02:00
Rahul
123e2df9fa qosmngr: update qos stats as per feedback
- All params apart from ifname converted to intergers.
- Output of stats for a particular interface now available.
- The ubus call accepts qid as integer.
2020-05-28 08:44:16 +05:30
Sukru Senli
61d9885cd5 iop: select lscpu 2020-05-27 13:04:11 +02:00
Amin Ben Ramdhane
733cb365ee bbf: 1.4-2020-05-27 2020-05-27 09:07:02 +01:00
vdutta
aeba764008 map-1905: Added unit tests 2020-05-27 11:08:34 +05:30
Rahul
d0350ee279 mcastmngr: add support for snooping mode
Support for snooping mode configuration added.
2020-05-26 18:37:24 +05:30
vdutta
00b6800c2f map-1905: Improvements in map-plugin 2020-05-26 17:18:23 +05:30
vdutta
ea0079eec8 ieee1905: map plugin improvements 2020-05-26 17:11:24 +05:30
Amin Ben Ramdhane
b72d3a45b3 swmodd: clean up 2020-05-26 09:51:48 +01:00
vdutta
d71c6382d5 obuspa: Fix client freeze on SIGINT
- B#2637 Fix obuspa -c get command freeze issue
 - Obuspa stop scripts improvement to speed up stop and reload
2020-05-25 18:31:18 +05:30
Rahul
ef4570dd83 qosmngr: fix port related config issue
Bug found in specifying input port as classification criteria,
fixed with this change.
2020-05-23 19:33:11 +05:30
Rohit Topno
56273668d6 qosmngr: Simplified code for writing iptables rules 2020-05-22 16:10:39 +05:30
Rahul
413c86b854 qosmngr: fix uci param name
The uci parameter name for destination mac address is incorrect.
It should be dst_mac and dest_mac, the same is rectified with this
change.
2020-05-22 13:34:56 +05:30
Rohit Topno
53d9ff537d qosmngr: Made iptables rule addition through single function and other changes 2020-05-21 14:00:06 +05:30
Rohit Topno
024d1bf061 qosmngr: Support for mapping internal packets to queue based on packet length 2020-05-20 21:15:17 +05:30
Sukru Senli
cb5d38eb86 iop: config: remove reference to samba3 2020-05-20 15:41:29 +02:00
Rahul
9108848387 qosmngr: update ubus call for queue stats
Update the rpcd to enable fetching stats for particular queue of an
interface.
Also, move all broadcom specific functions to broadcom.sh so that the
rpcd is soc agnostic.
2020-05-20 17:12:50 +05:30
Rohit Topno
81fb5ff455 qosmngr: Support for mapping IP packets to queue based on packet length. 2020-05-20 15:12:16 +05:30
Sukru Senli
5d16d75162 obuspa: add support for configuring log destination 2020-05-20 08:40:53 +02:00
Anjan Chanda
da5b719e6d wifimngr: 2.7.2 2020-05-20 08:37:38 +02:00
Anjan Chanda
3baa8f3157 easy-soc-libs: 3.1.8 2020-05-19 16:52:39 +02:00
Yalu Zhang
27610a0305 Update package endptmngr 2020-05-19 16:30:39 +02:00
vdutta
3ef6f4b04c uspd: Multiple fixes
- 69547f8 Remove DM_USE_LIBUBUS compile defines
 - 06fbaef Add openwrt makefile
 - 6ce0cad Fix invalid use of strncpy/cat functions
 - da2d3d8 uspd: Added compile time flags
2020-05-19 19:24:35 +05:30
vdutta
0bea0f9635 obsuap: Fix segfault in case of parameter returns fault 2020-05-19 19:13:18 +05:30
Anjan Chanda
8ee10eb149 easy-soc-events: v1.1 2020-05-18 21:30:20 +02:00
Anjan Chanda
1a36a1d22a rename mapagent -> map-agent 2020-05-18 21:29:25 +02:00
Omar Kallel
4b11d665ff bbf: Device.LANConfigSecurity. object 2020-05-18 14:03:57 +01:00
Amin Ben Ramdhane
ab710068a6 change package name: opkgd -> swmodd 2020-05-18 12:36:02 +01:00
Sukru Senli
9ceec5cc0b easy-soc-libs: compile TEST modules for x86 target 2020-05-18 12:50:03 +02:00
Amin Ben Ramdhane
9161d99082 bbf: 1.3-2020-05-18 2020-05-18 10:49:07 +01:00
vdutta
fa76f6f32c uspd: Fix memory leak in get_safe method 2020-05-18 14:08:33 +05:30
Rahul
c37934cb69 mcastmngr: Fix section name issue
In the default config that is generated by the mcast manager,
after support for MLD config via bbf was added the name of section
was updated. This caused unwanted behaviour when config addition
were made by the bbf on top of default config. Updated the default
config igmp snooping section name to resolve that.
2020-05-18 09:52:32 +05:30
Rahul
53a52bc455 qosmngr: Add service trigger
The service trigger was missing from the init file, added.
2020-05-18 09:49:41 +05:30
Sukru Senli
7f58e5409d libmicroxml: update source url 2020-05-17 20:50:45 +02:00
Sukru Senli
ccad65dd89 iop: config cleanup 2020-05-17 18:18:33 +02:00
Sukru Senli
e5b8c6f46b samba3: remove package 2020-05-17 18:11:57 +02:00
Sukru Senli
7ec727e994 owsd: install uproxyd only if selected 2020-05-17 17:21:51 +02:00
Sukru Senli
52313cdaa8 iop: update config 2020-05-15 18:42:57 +02:00
Sukru Senli
da18a10782 remove deprecated and redundant packages 2020-05-15 18:38:51 +02:00
Sukru Senli
0ae10079fb wifilife: remove package 2020-05-15 17:00:54 +02:00
Omar Kallel
0e22b3d267 icwmp: 4.0-2020-05-15 2020-05-15 13:31:32 +01:00
Rahul
895cfbc4f0 qosmngr: Add support for L2 classification
* Support of the QoS.Classify object parameters is extended to cover
L2 scenarios.
* There was a mistake in the way p-bit to queue mapping was configured,
that has been corrected now.

For now, qosmngr write L2 classification rules into /tmp/qos/classify.ebtables
file and then executes this script to apply the classification rules.

Decision on whether to go for this or to add this script to firewall uci
default config will be taken at the time of integration.

Note: before enabling qosmngr in devel, firewall.qos should be removed.
All QoS handling should be done from qosmngr.
2020-05-14 16:49:39 +05:30
vdutta
85cf73c66b uspd: Added conversion of unsigned long values 2020-05-14 16:25:18 +05:30
Rohit Topno
e8ddd67747 qosmngr: 4.4.4.25: Support for DSCP mark and remark based on L3 classifier supported by the system 2020-05-14 14:40:53 +05:30
Sukru Senli
60396bad6d icwmp: 4.0-2020-05-08 2020-05-13 11:52:45 +02:00
Benjamin Larsson
568098ee0b Update feed [ iopsys ] package [ peripheral_manager ]
-------------------------------------------------------------------------------
* 4851bc6 Merge branch 'production-button' into 'devel'
* 4dd5f3c Peripheral-manager: Add production mode support for button
-------------------------------------------------------------------------------
commit 4851bc6a0ee52a6f3399ac26a70e4ccced1b72cc
Author: Benjamin Larsson <benjamin.larsson@iopsys.eu>
Date: 2020-05-08 13:33:47 +0200

    Merge branch 'production-button' into 'devel'

    Peripheral-manager: Add production mode support for button

    See merge request iopsys/peripheral-manager!2
Base directory -> /
 src/button.c | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 118 insertions(+), 10 deletions(-)
-------------------------------------------------------------------------------
commit 4dd5f3c38a7a4e5c7fcc5c9461f0f13a99023fb4
Author: pitchaiah prakash <pitchaiah.murugan@iopsys.eu>
Date: 2020-05-08 12:20:16 +0200

    Peripheral-manager: Add production mode support for button

Base directory -> /
 src/button.c | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 118 insertions(+), 10 deletions(-)
-------------------------------------------------------------------------------
2020-05-13 11:45:10 +02:00
Anjan Chanda
868fece089 easy-soc-events: 1.0 2020-05-13 08:06:11 +02:00
Amin Ben Ramdhane
e0cb0e7a07 bbf: implement Device.Hosts. object 2020-05-12 16:46:40 +01:00
Amin Ben Ramdhane
49f9faa58c wifilife: TR-181 X_IOPSYS_EU_WiFiLife vendor extensions 2020-05-12 16:29:31 +01:00
Sukru Senli
30245d6dec questd-5.1.7 2020-05-12 12:07:23 +02:00
Amin Ben Ramdhane
8df424c249 bbf: 1.2-2020-05-12 2020-05-12 10:12:25 +01:00
Sukru Senli
e732109ef2 questd-5.1.6 2020-05-10 11:54:21 +02:00
Sukru Senli
0e64d6f262 libtrace: correct dependency 2020-05-09 16:46:39 +02:00
Sukru Senli
57816f3353 questd-5.1.5 2020-05-09 16:46:02 +02:00
Sukru Senli
0cb4e026c7 bbf: 1.2-2020-05-09 2020-05-09 16:45:44 +02:00
vdutta
25a6e81181 uspd: Test support with fixes
- Readme: Updated readme
 - Updated api specification and tests
 - Remove redundant code
 - Fix '==' operation for boolean type
 - Fix '!=' operation
 - Fix output of del_object method
 - Improved comparator algorithm for non integer values
 - Added unit test cases
 - Added functional api test cases
 - Fixed static analysis errors
 - Fixed cpd errors
2020-05-08 18:47:55 +05:30
Amin Ben Ramdhane
352e54af58 bbf: 1.2-2020-05-06 2020-05-06 15:54:39 +01:00
Omar Kallel
f5b4e71927 icwmp: Fix bug related to the authentication 2020-05-05 17:56:11 +01:00
Yalu Zhang
37dae0ee6f Update commitment of endptmngr: Adaptation for voice config restructure 2020-05-05 18:12:52 +02:00
Amin Ben Ramdhane
045dd954fa bbf: fix memory leak and issue related to delete object 2020-05-05 15:20:55 +01:00
yyashvardhan
ecde3a89eb ieee1905: Added 1905 stack validation tests 2020-05-05 12:26:24 +05:30
Amin Ben Ramdhane
7e5b693624 bbf: 1.2-2020-05-05 2020-05-05 01:18:14 +01:00
Amin Ben Ramdhane
7bbbfb150c icwmp: 4.0-2020-05-05 2020-05-05 01:16:53 +01:00
Amin Ben Ramdhane
317f4118e1 opkgd: Update the object name softwaremanagement -> swmodules 2020-05-05 01:14:47 +01:00
Amin Ben Ramdhane
a819c14f7d bbf: fix issue in delete object of IP.Interface 2020-05-04 17:41:34 +01:00
Amin Ben Ramdhane
f4b98bd8e9 bbf: 1.2-2020-05-04 2020-05-04 14:52:27 +01:00
Yalu Zhang
1eeb09bfa2 Remove package voice-client
The functionalites of the package will be merged to package asterisk
2020-05-04 15:29:20 +02:00
Ronny Nilsson
3e67053e9d endptmngr: source file was badly computed in Makefile. 2020-05-03 21:42:35 +02:00
Amin Ben Ramdhane
3630dd5fc1 bbf: 1.2-2020-05-03 2020-05-03 15:08:21 +01:00
Sukru Senli
29d72d64d6 remove reference to deprecated rpcd acl config option 2020-05-03 15:18:00 +02:00
Amin Ben Ramdhane
19e3f822e7 bbf: 1.2-2020-05-02 2020-05-02 13:29:42 +02:00
Sukru Senli
87969bddae iop: config: deselect out of scope juci packages 2020-05-02 13:23:21 +02:00
Sukru Senli
1f6dc0d9fb libcgroup: deprecated
procd and LXCs are used for containerization
2020-05-02 12:41:38 +02:00
Sukru Senli
c92d47953e testnet: control broadband led if wan led is not available
WAN and Broadband LED will be handled by ruleng rules when ubus switch events are ready
2020-05-01 15:09:00 +02:00
Sukru Senli
e4221b84f0 netmode: temporary testnet object to query online status 2020-04-29 13:52:43 +02:00
Suru Dissanaike
593da2e6f8 Update genconfig_min.sh 2020-04-28 10:09:26 +02:00
Jakob Olsson
d882e35820 wifilife: firewall.mibd: surpress errors when removing files 2020-04-27 15:44:01 +02:00
Sukru Senli
89e0a6ba35 license correction: endptmngr and libpicoevent 2020-04-27 14:45:05 +02:00
Ronny Nilsson
0c69245845 peripheral_manager: were sometimes built incorrectly with many cores and Broadcom 5.02L.07. 2020-04-27 14:12:47 +02:00
vdutta
a3265ea7f7 uspd: Collate all failure on get method
- 418daea get_safe: don't abort on single path failures
2020-04-27 16:59:17 +05:30
Sukru Senli
155df35229 iop: compile unusued packages as modules only 2020-04-26 17:23:08 +02:00
Sukru Senli
b477f767f3 power-management: moved to broadcom feed as it is broadcom specific 2020-04-26 17:20:03 +02:00
Sukru Senli
883023b588 questd-5.1.4 2020-04-26 15:25:26 +02:00
Amin Ben Ramdhane
96322d2a2c bbf: 1.2-2020-04-26 2020-04-26 13:53:10 +01:00
Omar Kallel
ff72d4e88b bbf: 1.2-2020-04-24 2020-04-24 11:56:31 +01:00
Jakob Olsson
4f5a1ad365 owsd: init.d: let whitelist_interface_as_origin default to 1 2020-04-23 13:32:05 +02:00
Sukru Senli
56f93e1eab voice_client: adapt to led name change 2020-04-23 12:41:08 +02:00
Jakob Olsson
57e2a69575 netmode: remove status method, depend on 'enabled' option 2020-04-23 12:25:18 +02:00
Rahul
c7f037fdd7 bbf: Update mcastmngr to handle mld config
The mcast manager can now configure mld snooping and proxy
2020-04-23 14:41:31 +05:30
Sukru Senli
ea87bfe337 owsd: disable ubus-x by default 2020-04-23 11:11:15 +02:00
Sukru Senli
df93ed2d3c netmode: deprecate config based mode switching 2020-04-23 09:59:21 +02:00
Jakob Olsson
de03c6149c owsd: remove some sections from default cfg 2020-04-23 08:42:18 +02:00
Jakob Olsson
92480328ac owsd: update default configuration 2020-04-22 13:55:48 +02:00
Jakob Olsson
02404d5f22 owsd: only include json-validator.h if flag is given 2020-04-22 12:47:32 +02:00
Jakob Olsson
bd65c9a666 owsd: update for lws-3.1.0, make one vhost per origin 2020-04-22 12:36:40 +02:00
Sukru Senli
ec443bbb91 qosmngr: remove reference to db layer2 option 2020-04-22 11:40:35 +02:00
Ronny Nilsson
0292918ef4 iop: add rsync
It is used by the sysbackup and sysrestore utilities.
2020-04-21 17:06:56 +02:00
Jakob Olsson
947d72ae96 wifilife: firewall.mbid: remove lockfile if script is interrupted 2020-04-21 13:26:41 +02:00
Suru Dissanaike
fb195d9456 IOP: added --opensdk flag, support for cloning using https, and minimalistic genconfig_min 2020-04-20 15:11:09 +02:00
Amin Ben Ramdhane
aa6ff005ea icwmp: 4.0-2020-04-17 2020-04-20 12:11:08 +01:00
Amin Ben Ramdhane
a404289e69 bbf: 1.2-2020-04-20 2020-04-20 12:09:13 +01:00
vdutta
ccb5d3108a uspd: Show fault as per cmwp specification 2020-04-20 15:26:16 +05:30
Sukru Senli
ed23fc33b4 iop: generate_tarballs script fix 2020-04-20 08:21:32 +02:00
Rahul
c1dbba3545 mcastmngr: remove max_groups section from uci
The option max_groups is not really needed in the uci, hence,
removed. Also, max_membership and max_msf are set internally
by mcpd so no need to echo them seperately.
2020-04-20 07:09:18 +05:30
Sukru Senli
ab7cf3e44a questd: 5.1.3 2020-04-19 20:18:11 +02:00
Sukru Senli
2afe82e86b qosmngr: depend on existence of tool 2020-04-19 20:08:59 +02:00
Rahul
cd4733efa9 mcastmngr: Add mcastmngr
The mcastmngr read the uci file and configures the corresponding
multicast daemon accordingly. It is for now doing this for broadcom's
mcpd utility. Here are a few examples of what UCI config gets converted
to what /var/mcpd.conf

Snooping:
config snooping 'msnoop_1'
    option enable '1'
    option proto 'igmp'
    option version '2'
    option robustness '2'
    option aggregation '0'
    option interface 'br-wan100'

root@iopsys:~# cat /var/mcpd.conf
igmp-default-version 2
igmp-robustness-value 2
igmp-max-groups 20
igmp-max-sources 10
igmp-max-members 20
igmp-snooping-enable 1
igmp-proxy-enable 0
igmp-query-interval 125
igmp-query-response-interval 100
igmp-last-member-query-interval 10
igmp-mcast-interfaces  eth5.100
igmp-snooping-interfaces br-wan100

Proxy:
config proxy 'mproxy_1'
    option enable '1'
    option proto 'igmp'
    option version '2'
    option robustness '2'
    option aggregation '0'
    option last_member_query_interval '10'
    option query_interval '120'
    option query_response_interval '100'
    list downstream_interface 'br-lan'
    list upstream_interface 'eth5.1'

root@iopsys:~# cat /var/mcpd.conf
igmp-default-version 2
igmp-robustness-value 2
igmp-max-groups 20
igmp-max-sources 10
igmp-max-members 20
igmp-snooping-enable 2
igmp-proxy-enable 1
igmp-fast-leave 1
igmp-query-interval 120
igmp-query-response-interval 100
igmp-last-member-query-interval 10
igmp-proxy-interfaces  eth5.1
igmp-mcast-interfaces  eth5.1
igmp-snooping-interfaces br-lan
2020-04-19 15:27:38 +05:30
Sukru Senli
123dcd9d87 iop: config cleanup 2020-04-18 21:21:44 +02:00
Sukru Senli
fa2f34ef58 bbf: 1.2-2020-04-17 2020-04-17 14:34:02 +02:00
Sukru Senli
f099a39137 bbf: 1.2-2020-04-16 2020-04-16 18:59:06 +02:00
Sukru Senli
011e469c8a questd: 5.1.2 2020-04-16 12:47:12 +02:00
Suru Dissanaike
f085b5552f PKG_SOURCE_URL should use HTTPS
(cherry picked from commit 70c394db7c42a268de04d20efaf1f54e6c02a15d)
2020-04-16 10:53:32 +02:00
Sukru Senli
434f0f79a5 iop: generate correct wifilife tarball for mediatek 2020-04-15 12:41:43 +02:00
Sukru Senli
59206bb37f bbf:1.2-2020-04-14 2020-04-14 19:15:10 +02:00
Yalu Zhang
b7d7b2a382 Make endptmngr and dectmngr2 stripped in the root filesystem on targets
This can totally save ~9M bytes space.
2020-04-14 14:59:49 +02:00
Sukru Senli
d7564ddf36 questd: 5.1.1 2020-04-14 10:58:34 +02:00
Ronny Nilsson
e2f238a155 busybox: add fractional sleep time.
Sleeping less than 1 second is of great usage in many shell scripts.
2020-04-13 22:36:46 +02:00
Anjan Chanda
0fe4491394 easy-soc-libs: 3.1.6 2020-04-13 19:02:36 +02:00
vdutta
c471e4b465 mapagent: Fix compilation 2020-04-13 19:53:29 +05:30
Anjan Chanda
8436c5e39a mapagent: 2.0.1 - initial version 2020-04-13 13:28:26 +02:00
Anjan Chanda
d4d7cb9ed0 wfadatad: 2.0.1 - standalone daemon and plugin mode 2020-04-13 13:24:51 +02:00
Sukru Senli
a72d39cac8 bbf: 1.2-2020-04-12 2020-04-12 12:19:26 +02:00
Sukru Senli
ccf5343e62 iup: remove package 2020-04-11 20:18:15 +02:00
Sukru Senli
28a125cc5b icwmp: remove obselete README 2020-04-11 20:18:02 +02:00
Yalu Zhang
abc791f516 voice-client: Add cdr_manager.conf.TEMPLATE and fix an error in cdr_syslog.conf.TEMPLATE 2020-04-09 15:51:01 +02:00
Anjan Chanda
e599097a22 mt76xx: fix consumer build due to removed wifi drivers 2020-04-09 12:18:10 +02:00
Rahul
71ee9e3311 qosmngr: introduce enable in queue and shaper section
Introduce enable in the queue and shaper section in qos config, if
disabled, configuration not done for that instance.

Fixed some bugs in the broadcom.sh script.

Note: The broadcom.sh script has not been updated to take into account
the fact that the board 6846 does not have enough queues available.
This script is kept so for the same of flexibility. The number of queues
per port can be controlled from the uci file now which easily available
and configurable.
2020-04-09 14:26:49 +05:30
vdutta
d7936fd7d1 uspd: Align boolean values to uci defaults 2020-04-09 13:54:50 +05:30
vdutta
70fb4a6442 uspd: Multiple fixes
4328f3a delete_object: fix memleak and endless list growing
99ddcf2 {add,del}_object: add "parameterKey" parameter
93155dc Add get_safe method
2020-04-09 11:59:34 +05:30
Sukru Senli
0e21fc2475 bbf: 1.2-2020-04-08 2020-04-09 08:13:51 +02:00
Anjan Chanda
4d5f387738 mt76xx: remove mediatek wifi drivers from iopsys feeds 2020-04-08 14:51:15 +02:00
Rahul
78bab83bed qosmngr: rename the queue section name
rename the queue section name from q<0-4? to queue numbers being per
interface, so it is now for example q<0-7>_eth<0-5>
2020-04-07 20:58:17 +05:30
Rahul
9745a16694 qosmngr: fix default queue config generation
In case there is a valid config in the uci file, the script should
do nothing.
2020-04-07 13:14:35 +05:30
Sukru Senli
158f1d94a6 qosmngr: qos init script is platform unaware 2020-04-07 08:39:05 +02:00
Rahul
bdb29afd54 qosmngr: generating queue config dynamically
Changes done to generate uci config for queue from uci-defaults script
instead of using hard coded values.
2020-04-07 12:02:36 +05:30
Sukru Senli
57d179ed01 bbf: 1.2-2020-04-06 2020-04-06 19:09:00 +02:00
Rohit Topno
2c18313c13 qosmngr: updated UCI file for eth3, eth4 and eth5 2020-04-06 18:49:24 +05:30
Ronny Nilsson
61d80f6cc5 busybox: gzip --fast is sometimes required. 2020-04-06 12:15:23 +02:00
Rohit Topno
5ddc513d5d Changed the way the UCI file is read. now using functions defined in /lib/functions.sh 2020-04-04 18:24:35 +05:30
Sukru Senli
5e4549e413 iop: config: remove snmpd from default config 2020-04-01 23:28:29 +02:00
Sukru Senli
dc36c83866 wifimngr: do not install keep config script until the issues are fixed 2020-03-29 15:49:29 +02:00
Amin Ben Ramdhane
5eeef917e6 icwmp: 4.0-2020-03-25 2020-03-29 14:35:30 +01:00
Amin Ben Ramdhane
ea5535f374 bbf-1.2-2020-03-29 2020-03-29 14:32:55 +01:00
Sukru Senli
696b4b063a port-management: move port population to uci-defaults 2020-03-29 13:51:24 +02:00
Sukru Senli
8660069566 port-management: move port population to uci-defaults 2020-03-29 13:50:48 +02:00
Ronny Nilsson
44943fdea7 Revert "wifimngr: do not install keep config script until the issues are fixed"
We don't need this patch any more. It has been implemented by feeds/openwrt_core/e3c1d70a1774380acc7bb

This reverts commit f52528f806.
2020-03-29 12:23:00 +02:00
Ronny Nilsson
70cacfbe71 sysupgrade: use a lib func for printing to syslog. 2020-03-29 12:22:47 +02:00
Ronny Nilsson
6aa2fe7749 sysupgrade: remove the first boot check. It's handled in corresponding lib func. 2020-03-29 12:22:47 +02:00
Ronny Nilsson
a01a3be0d1 sysupgrade: move UCI diff into a separate function lib
For reuse by other modules as well.
2020-03-29 12:22:47 +02:00
Sukru Senli
f52528f806 wifimngr: do not install keep config script until the issues are fixed 2020-03-28 16:31:02 +01:00
Sukru Senli
bcce414686 port-management: remove sfp management 2020-03-28 15:47:11 +01:00
Sukru Senli
579757f4d9 port-management: call db with -q 2020-03-28 15:45:13 +01:00
Sukru Senli
81841777b9 port-management: populate with correct option 2020-03-28 15:31:04 +01:00
Sukru Senli
392e014872 iop: config: select ethtool by default 2020-03-28 15:28:41 +01:00
Sukru Senli
5557c69ec4 port-management: granularize uci config 2020-03-28 15:26:45 +01:00
vdutta
614a8556d9 ieee1905: On-boarding of ieee1905 device 2020-03-27 17:53:54 +05:30
Benjamin Larsson
db110b74e7 Update feed [ iopsys ] package [ peripheral_manager ]
-------------------------------------------------------------------------------
* 778735d add missing temperature call
* 87dbafa Read sfp i2c bus device from hw.board.sfpBus instead of hardcoded config in binary, enable temperature readings
* 986c088 Update README.md
* 2816e70 Add sfp data.
* 38791c3 Update README.md
* 385be13 Add empty README.md
-------------------------------------------------------------------------------
commit 778735da4e25e2075a6ecb365850a61ceb4bd515
Author: Benjamin Larsson <benjamin.larsson@iopsys.eu>
Date: 2020-03-25 18:40:58 +0100

    add missing temperature call

Base directory -> /
 src/sfp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 87dbafa7c7e14b6ea7dcd592b8779a71dab128b3
Author: Benjamin Larsson <benjamin.larsson@iopsys.eu>
Date: 2020-03-25 17:03:51 +0100

    Read sfp i2c bus device from hw.board.sfpBus instead of hardcoded config in
    binary, enable temperature readings

Base directory -> /
 src/sfp.c | 55 ++++++++++++++++---------------------------------------
 1 file changed, 16 insertions(+), 39 deletions(-)
-------------------------------------------------------------------------------
commit 986c0887197fc3410c796f2e5777b0c233ee2623
Author: Benjamin Larsson <benjamin.larsson@iopsys.eu>
Date: 2020-03-16 16:24:18 +0100

    Update README.md

Base directory -> /
 README.md | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit 2816e70a9e5e68199a4864073311c4cb3cce06bb
Author: Benjamin Larsson <benjamin.larsson@iopsys.eu>
Date: 2020-03-16 15:36:56 +0100

    Add sfp data.

Base directory -> /
 README.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)
-------------------------------------------------------------------------------
commit 38791c32e769c195593067d5af7d157cc6725b24
Author: Benjamin Larsson <benjamin.larsson@iopsys.eu>
Date: 2020-03-13 15:38:53 +0100

    Update README.md

Base directory -> /
 README.md | 12 ++++++++++++
 1 file changed, 12 insertions(+)
-------------------------------------------------------------------------------
commit 385be132924cb824b25c9d7adbcaaab4126533b5
Author: Benjamin Larsson <benjamin.larsson@iopsys.eu>
Date: 2020-03-13 13:47:16 +0100

    Add empty README.md

Base directory -> /
 README.md | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
2020-03-26 18:03:15 +01:00
Yalu Zhang
533a7d68eb Fix a compiling error in libtrace for Intel platform 2020-03-26 17:49:14 +01:00
Ronny Nilsson
79f7343cb4 sysupgrade: uci wireless santity checks. 2020-03-26 16:23:07 +01:00
Anjan Chanda
61c11e2520 easy-soc-libs: 3.1.5 2020-03-25 20:58:02 +01:00
vdutta
b91bf2fa67 map-1905: ieee1905d MAP-r2 plugin 2020-03-25 15:42:17 +05:30
Sukru Senli
720e45c20e opkgd: correct Makefile 2020-03-24 08:32:37 +01:00
Amin Ben Ramdhane
08230823d5 bbf-1.2-2020-03-23 2020-03-23 23:31:58 +01:00
Amin Ben Ramdhane
52614cee38 icwmp: 4.0-2020-03-23 2020-03-23 23:21:34 +01:00
Anjan Chanda
e648f237eb wifimngr: 2.7.1 2020-03-23 15:35:51 +01:00
Anjan Chanda
3cc9a2d72e easy-soc-libs: 3.1.4 2020-03-23 15:32:15 +01:00
Sukru Senli
332b6ce7b6 netmode: testnet: use pgrep to check if tesnet is running 2020-03-21 19:42:53 +01:00
Sukru Senli
6aa3467f29 netmode: remove bcm netmodes 2020-03-21 13:07:50 +01:00
Yalu Zhang
644f9b68eb Update packages [ easy-soc-libs ] and [ dslmngr ]
Add module test and documentation of newly added features mainly on
the TEST platform.
2020-03-18 11:15:22 +01:00
vdutta
5b6e76e51c ieee1905: Configure registrar 2020-03-18 12:57:57 +05:30
vdutta
4ffaeace88 ieee1905: wfamap: Fill non 1905 neighbor info 2020-03-12 13:33:09 +05:30
Ronny Nilsson
8814788e9f Update feed [ iopsys ] package [ endptmngr ]
-------------------------------------------------------------------------------
* 156c3f0 Revert linkin with libiqctl. It doesn't build but seems to work without it.
-------------------------------------------------------------------------------
commit 156c3f01d6e48d4cc2ffdcb1eb38ff7656478dd0
Author: Ronny Nilsson <ronny.nilsson@iopsys.eu>
Date: 2020-03-11 13:45:20 +0100

    Revert linkin with libiqctl. It doesn't build but seems to work without it.

Base directory -> /
 src/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2020-03-11 13:54:45 +01:00
Amin Ben Ramdhane
c8355daac5 bbf-1.2-2020-03-10 2020-03-10 23:48:05 +01:00
Ronny Nilsson
fec9e5486c Update feed [ iopsys ] package [ endptmngr ]
-------------------------------------------------------------------------------
* a463f0a Fix compile error with 5.02L07p1 on mips.
-------------------------------------------------------------------------------
commit a463f0a33cbc470acba91782d511c8c60aa830a9
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2020-02-17 13:16:45 +0100

    Fix compile error with 5.02L07p1 on mips.

Base directory -> /
 src/Makefile     | 2 +-
 src/connection.c | 1 +
 src/line-dect.c  | 1 +
 src/line.c       | 1 +
 4 files changed, 4 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
2020-03-10 22:18:21 +01:00
Ronny Nilsson
e860576802 sysupgrade: support for diff migration of UCI named sections 2020-03-08 13:00:49 +01:00
Ronny Nilsson
d20f43a756 sdk: remove duplicated login prompts. One is enough.
Only one process at a time can read/write the console.
2020-03-05 16:17:58 +01:00
Ronny Nilsson
de730bc4f0 sdk: Disable preinit urandom seed.
It is very strange. It seeds urandom with data from urandom.
2020-03-05 13:05:39 +01:00
Ronny Nilsson
ce6946ca9b sdk: disable failsafe login during boot.
None seems to use it and it steals time and complexity during boot.
2020-03-05 13:05:39 +01:00
Ronny Nilsson
e73efef313 sdk: skip building of a rootfs tarball due to we never user it.
It only steals long time during build.
2020-03-05 13:05:39 +01:00
Ronny Nilsson
0bdd4644e5 sdk: Delay serial console login prompt until boot has finished. 2020-03-05 13:05:39 +01:00
Yalu Zhang
a2932315c3 Update packages [ easy-soc-libs ]
Fix a build error in libdsl for Intel platform
2020-03-05 11:21:36 +01:00
Yalu Zhang
af7a636751 Update packages [ easy-soc-libs ] and [ dslmngr ]
Also install more header files in libdsl to staging dir
2020-03-04 15:56:21 +01:00
Omar Kallel
a7c83c46cf bbf: Device.security 2020-03-03 16:22:11 +01:00
Ronny Nilsson
64cb92e9e9 Update feed [ iopsys ] package [ natalie-dect-h ]
-------------------------------------------------------------------------------
* f3889dc updated License from RTX
-------------------------------------------------------------------------------
commit f3889dc3f80bed10374f46430009aca24448bdcc
Author: Strhuan Blomquist <strhuan@iopsys.eu>
Date: 2019-10-10 13:28:40 +0200

    updated License from RTX

Base directory -> /
 IntenoLicenseTerms_R01_signed.pdf                      | Bin 517134 -> 0 bytes
 ...tware solutions AB_License-Terms_Oct2019_Signed.pdf | Bin 0 -> 94676 bytes
 2 files changed, 0 insertions(+), 0 deletions(-)
-------------------------------------------------------------------------------
2020-03-02 17:42:46 +01:00
Ronny Nilsson
2972baa68b Update feed [ iopsys ] package [ libpicoevent ]
-------------------------------------------------------------------------------
* f4ab03b Add LICENSE
-------------------------------------------------------------------------------
commit f4ab03b22fca57cec6c959fb5c54bcdd64c32467
Author: Sukru Senli <sukru.senli@iopsys.eu>
Date: 2019-09-11 14:40:06 +0200

    Add LICENSE

Base directory -> /
 LICENSE | 308 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 308 insertions(+)
-------------------------------------------------------------------------------
2020-03-02 17:42:24 +01:00
vdutta
3a1b07e868 obuspa: Fix compilation error on gcc-8.3.x 2020-03-02 19:41:02 +05:30
Oussama Ghorbel
f34d0abc6b uboot: update intel_mips bootloader to ugw 8.4.1.50 2020-02-28 17:49:13 +01:00
vdutta
6ad4df7ea0 ieee1905: wfamap: Multiple fixes
- Fix typos
 - Integrate libwifi
 - Integrate libeasy
 - Cleanup
 - Get APIs for tlvs
2020-02-28 13:51:47 +05:30
vdutta
d44433ed59 wfamap: APIs for perparing MAP tlvs 2020-02-26 18:31:24 +05:30
vdutta
e4a4b44719 ieee1905: APIs for perparing tlvs 2020-02-26 18:26:11 +05:30
sverma
a5c2af7a95 obuspa: SYNC commands handling as per TR181-2.13 2020-02-26 14:16:38 +05:30
Ronny Nilsson
0543036ebd sysupgrade: Migrate WiFi settings only if the system has WiFi. 2020-02-25 14:55:46 +01:00
Anjan Chanda
b2b6c19e74 easy-soc-libs: 3.1.3 2020-02-25 10:24:59 +01:00
sverma
c3ecfabfc6 obuspa: ASYNC commands handling as per TR181-2.13 2020-02-24 18:40:11 +05:30
Anjan Chanda
a2c3063520 mt7603: copy eeprom file and update default .dat 2020-02-23 14:18:34 +01:00
Anjan Chanda
c2c28d0cea mt7615: disable multi-profile and enable more features 2020-02-23 14:10:14 +01:00
Amin Ben Ramdhane
0940898f7b bbf: add support for parameter validation 2020-02-21 18:57:26 +01:00
Jonas Höglund
ea29e6bce0 Update feed [ iopsys ] package [ endptmngr ]
-------------------------------------------------------------------------------
* 1092361 Fix compilation error on 5.02L07p1.
* be0e76e Add .gitlab-ci.yml
* 756f603 Revert "Fix a bug in "ubus call endpt status" that report off-hook status wrongly"
* 179d941 Fix a bug in "ubus call endpt status" that report off-hook status wrongly
-------------------------------------------------------------------------------
commit 1092361e274147babb6f750eab3cda2c7df436a1
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2020-02-19 12:58:10 +0100

    Fix compilation error on 5.02L07p1.

Base directory -> /
 src/connection.c | 1 +
 src/line-dect.c  | 1 +
 src/line.c       | 1 +
 3 files changed, 3 insertions(+)
-------------------------------------------------------------------------------
commit be0e76ed7d423e50fd514b04cce128e038a63282
Author: Suru Dissanaike <suru.dissanaike@iopsys.eu>
Date: 2019-12-01 20:08:04 +0100

    Add .gitlab-ci.yml

Base directory -> /
 .gitlab-ci.yml | 10 ++++++++++
 1 file changed, 10 insertions(+)
-------------------------------------------------------------------------------
commit 756f6032012e1398a92f488fa0c9d69640f483ed
Author: Yalu Zhang <yalu.zhang@iopsys.eu>
Date: 2019-11-26 15:56:05 +0100

    Revert "Fix a bug in "ubus call endpt status" that report off-hook status
    wrongly"

    This reverts commit 179d9418662b9c3336cf6dba64848e9f9f680035.

Base directory -> /
 src/ubus.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)
-------------------------------------------------------------------------------
commit 179d9418662b9c3336cf6dba64848e9f9f680035
Author: Yalu Zhang <yalu.zhang@iopsys.eu>
Date: 2019-11-26 15:30:02 +0100

    Fix a bug in "ubus call endpt status" that report off-hook status wrongly

    When Tel 1 was off-hook, the ubus call reported Tel 2 was off-hook and vice
    verse.

Base directory -> /
 src/ubus.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
2020-02-19 14:59:31 +01:00
vdutta
bd54ff5c52 wfamap: Added forge and parse method for MAP2 TLVs 2020-02-19 19:28:06 +05:30
Amin Ben Ramdhane
11330760dd icwmp: 4.0-2020-02-19 2020-02-19 14:56:24 +01:00
vdutta
7e82a361b5 obuspa: Added proto option in usp object methods 2020-02-19 15:56:04 +05:30
vdutta
8c55345f85 uspd: Support proto in ubus method input
- uspd can be used to perform on usp/cwmp datamodel based on proto option
2020-02-19 15:15:18 +05:30
Jonas Höglund
c29a46aeee Revert "Update feed [ iopsys ] package [ endptmngr ]"
This reverts commit 2f91b5e726.
2020-02-19 09:36:07 +01:00
jjoseph
946b5b3932 bbf: Revert Layer 2 changes 2020-02-19 10:59:02 +05:30
jjoseph
c80f64db82 Updated the commit id in Makefile for Layer 2 changes in bbf. 2020-02-18 16:19:06 +05:30
Anjan Chanda
b4d2e92cb6 iop: fix mediatek kernel generation for consumer release 2020-02-18 09:38:51 +01:00
Jonas Höglund
2f91b5e726 Update feed [ iopsys ] package [ endptmngr ]
-------------------------------------------------------------------------------
* a463f0a Fix compile error with 5.02L07p1 on mips.
* be0e76e Add .gitlab-ci.yml
* 756f603 Revert "Fix a bug in "ubus call endpt status" that report off-hook status wrongly"
* 179d941 Fix a bug in "ubus call endpt status" that report off-hook status wrongly
-------------------------------------------------------------------------------
commit a463f0a33cbc470acba91782d511c8c60aa830a9
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2020-02-17 13:16:45 +0100

    Fix compile error with 5.02L07p1 on mips.

Base directory -> /
 src/Makefile     | 2 +-
 src/connection.c | 1 +
 src/line-dect.c  | 1 +
 src/line.c       | 1 +
 4 files changed, 4 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit be0e76ed7d423e50fd514b04cce128e038a63282
Author: Suru Dissanaike <suru.dissanaike@iopsys.eu>
Date: 2019-12-01 20:08:04 +0100

    Add .gitlab-ci.yml

Base directory -> /
 .gitlab-ci.yml | 10 ++++++++++
 1 file changed, 10 insertions(+)
-------------------------------------------------------------------------------
commit 756f6032012e1398a92f488fa0c9d69640f483ed
Author: Yalu Zhang <yalu.zhang@iopsys.eu>
Date: 2019-11-26 15:56:05 +0100

    Revert "Fix a bug in "ubus call endpt status" that report off-hook status
    wrongly"

    This reverts commit 179d9418662b9c3336cf6dba64848e9f9f680035.

Base directory -> /
 src/ubus.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)
-------------------------------------------------------------------------------
commit 179d9418662b9c3336cf6dba64848e9f9f680035
Author: Yalu Zhang <yalu.zhang@iopsys.eu>
Date: 2019-11-26 15:30:02 +0100

    Fix a bug in "ubus call endpt status" that report off-hook status wrongly

    When Tel 1 was off-hook, the ubus call reported Tel 2 was off-hook and vice
    verse.

Base directory -> /
 src/ubus.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
2020-02-17 16:09:30 +01:00
Anjan Chanda
aa0fc5a7ed iop: fix mediatek wifi consumer build 2020-02-17 12:23:40 +01:00
Anjan Chanda
b4e1f18cc5 wifilife-2.7.0: use libeasy.so for common helpers 2020-02-17 09:30:19 +01:00
Anjan Chanda
8d43795c34 ifbt-0.3: fix linking against libeasy.so 2020-02-17 09:16:02 +01:00
vdutta
8e957a6c69 wfamap: Added config options 2020-02-17 12:41:48 +05:30
vdutta
db1db9da8d ieee1905: Added config options for ieee1905 2020-02-17 12:40:04 +05:30
Anjan Chanda
301d3a0cd6 mt7615, mt7603: add eeprom and sku data files 2020-02-16 21:45:22 +01:00
Anjan Chanda
39093e4b1a mt7615: rename iNic_ap.dat -> iNIC_ap.dat 2020-02-16 21:24:06 +01:00
Anjan Chanda
a58467cad0 easy-soc-libs: v3.1.2 - fix wps interfaces for mtk 2020-02-16 20:58:12 +01:00
Anjan Chanda
0a3dc9f316 wifi: mediatek driver packages for mt7603 and mt7615
add kernel module packages for following wifi drivers -
  mt7603e v4.1.2.0_20190222
  mt7615e v5.0.4.0_20190503
2020-02-16 19:35:31 +01:00
Ronny Nilsson
47a15eb231 sdk: At first boot; copy factory default to cwmp UCI. 2020-02-14 22:58:20 +01:00
Anjan Chanda
a6b66929e4 easy-soc-libs: v3.1.1, wifimngr: v2.7.0 2020-02-14 16:08:41 +01:00
vdutta
9b1a3ebc71 ieee1905: Added ieee1905 ubus methods
- 86d4406 ieee1905: Added async topology method for local al
 - 4505816 ieee1905: Added ubus methods details in Readme
 - c7a3932 ieee1905: Added multiple ieee1905* ubus methods
 - b815539 ieee1905: Cleanup message queue on exit
2020-02-14 18:36:59 +05:30
Ronny Nilsson
87ec25c82c sysupgrade: Tweak an expression to reduce potential (safe) warning messages. 2020-02-14 12:20:48 +01:00
sverma
8153cf8d74 obuspa: DataModel allignment as per TR181_2.13 2020-02-14 16:13:38 +05:30
Ronny Nilsson
766096cba4 sysupgrade: migration of anonymous section requires checking each.
It is not enough to migrate all or none anonymous section. We
need to check each one individually.
2020-02-13 15:50:51 +01:00
Rahul
dd00b7eb2e qosmngr: merging qosmngr to devel 2020-02-13 18:57:16 +05:30
Yalu Zhang
a60fa6797a Update package [easy-soc⨪libs] and [dslmngr] 2020-02-13 11:22:02 +01:00
vdutta
0f31287335 ieee1905: wfamap: Multiple fixes
- ieee1905:
  -- 439e8ce ieee1905: Updated Readme with ALME over ubus
  -- b441fca ieee1905: Multiple fixes
     --- Added alme over ubus
     --- Redesigned static 63*1024 size buffer allocation for ALME over tcp
     --- Cleanup
     --- Support of blob in DMdumpNetworkDevices API
  -- e550dcc ieee1905: Support of blob in visit_* functions
  -- b940298 ieee1905: cleanup
  -- 09f4af9 ieee1905: Added info for ieee1905 ubus object

- wfamap:
  -- 1c6b48c wfamap: Support for alme over ubus
  -- 0b45bed wfamap: Support for blob in visit_* functions
2020-02-13 13:22:37 +05:30
Ronny Nilsson
5dcde335dd wifi: As part of sysupgrade we migrate the users custom changes to the new fs. 2020-02-12 13:27:44 +01:00
Anjan Chanda
29f49ff674 easy-soc-libs-3.0.1: use consistent apis in libwifi 2020-02-11 13:45:44 +01:00
Anjan Chanda
9ddbbdfe17 wifimngr-2.6.0: use helper library 'libeasy.so' 2020-02-11 12:23:13 +01:00
Anjan Chanda
b23f81f3ba easy-soc-libs: add helper functions library 'libeasy' 2020-02-11 12:22:10 +01:00
Omar Kallel
5b5addb7fc This reverts commit 7de0b7e20d 2020-02-10 15:27:04 +01:00
Omar Kallel
1e9e7be709 Device.UPnP review code 2020-02-10 15:24:36 +01:00
vdutta
bce138d52e ieee1905: Fix race condition in intf access 2020-02-10 16:13:19 +05:30
Ronny Nilsson
7de0b7e20d libbbfdm: depends on libminiupnpc since last update. 2020-02-07 21:12:56 +01:00
Omar Kallel
376ddd4a12 bbf: Device.UPnP. object 2020-02-07 16:42:15 +01:00
Ronny Nilsson
b6399da95b sdk: Try conditional dependencies for icwmp.
The icwmp package has subcomponents which pulls in third party
librarys although they are explicity disabled in the top level
config. This in turn sometimes makes causes build failures.
2020-02-07 16:20:01 +01:00
sverma
295ee80a1a obuspa: Runtime handling for multi-instance objects 2020-02-07 17:48:21 +05:30
vdutta
ac71c9e85f ieee1905: Remove libpicoevent dependency 2020-02-04 19:04:53 +05:30
Amin Ben Ramdhane
d0fc0ffc43 bbf: Update db parameters 2020-02-04 11:37:36 +01:00
sverma
cee4575f63 obuspa: Registered nodes for Device.Services in DB
Functionality added to get object instances only
2020-02-04 15:21:16 +05:30
vdutta
4f1ad101bc obuspa: Vendor hooks for reset related operations 2020-02-04 12:13:47 +05:30
vdutta
9386ec4bc2 ieee1905: Updated readme 2020-02-03 18:38:04 +05:30
Oussama Ghorbel
84af00e784 uboot: update pkg source version
this is an update to ugw-8.4.1.30
2020-02-03 10:37:46 +01:00
vdutta
cc2d40a912 ieee1905: Multiple fixes
- Compile flag for alme tcp server
 - MAP db support in plugin
 - Modification for map lib renaming
 - Cleanup
 - Move alme server to lib1905ubus
2020-01-31 16:17:13 +05:30
vdutta
21b4c960a3 wfamap: Multiple fixes
- MAP db
 - Restoring broken functionalities after re-structuring
 - Renaming library to libwifimap-2.so
 - Cleanup
2020-01-31 16:13:03 +05:30
Roman Azarenko
89df7ce409 Fix "iop genconfig" for public builds
This introduces an extra check to avoid attempting to clone a private customer/consumer repository, when the main SDK repo is cloned via HTTPS.
2020-01-29 11:22:10 +01:00
sverma
97fd03d966 Merge branch 'devel' of dev.iopsys.eu:feed/iopsys into devel 2020-01-28 14:23:54 +05:30
sverma
bdfb498fb6 obuspa: Initialize multi-intsance objects on bootup
Add log-level UCI option
2020-01-28 14:21:03 +05:30
Jonas Höglund
b61bc3cd02 obouspa: Only set up .profile once. 2020-01-27 13:55:40 +01:00
Jonas Höglund
6223a63efe obuspa: Don't overwrite existing .profile. 2020-01-24 16:14:29 +01:00
vdutta
74df3bbd25 ieee1905: Added multiAP plugin support
- ieee1905 stack will call multiAP library functions, if
   -- /usr/lib/libwfamap.so is present in DUT
   -- uci parameter multiap_plugin is enabled in ieee1905
2020-01-24 19:28:51 +05:30
vdutta
4afaeddbda wfamap: Created runtime plugin 2020-01-24 19:28:51 +05:30
sverma
c552774826 uspd: Improve logging for uspd methods 2020-01-24 17:38:43 +05:30
sverma
1335405ccc obuspa: reduce ubus calls to uspd
- Reduce number of ubus calls to uspd on obuspa_get
 - Add uci option to enable/disable obuspa
2020-01-24 17:22:02 +05:30
Oussama Ghorbel
871a3c3907 clean up db and use new variables names 2020-01-23 14:39:32 +01:00
Oussama Ghorbel
8815e230ed questd: upgrade to version 5.0.0
- use cmake
- implement feature #1535: system object model redesign
2020-01-23 14:39:32 +01:00
Ronny Nilsson
0bf21c30c6 owsd: Workaround a bug which cases origin check to fail on LAN.
When the LAN interface has an IPv6 Unique local address owsd gets confused.
IPv4 requests arrive into the virtual IPv6 interface of owsd which makes
the origin check to fail. Workaround the problem by disabling origin check
for LAN. This shouldn't be a problem (?) due to we already has the same
check disabled on WAN by default.
2020-01-23 12:44:59 +01:00
vdutta
e6edca3137 wfamap: Added wfamap 2020-01-23 17:12:30 +05:30
vdutta
7247a2d0d4 ieee1905: Changes to support wfamap library 2020-01-23 17:12:30 +05:30
vdutta
0f62b3f2be ieee1905: Fix compilation for ex400 2020-01-23 12:44:32 +05:30
vdutta
6f2a9d0fd4 uspd: Log level support in uci 2020-01-23 11:43:53 +05:30
vdutta
2910b13325 uspd: Align with new bbfdm changes 2020-01-22 19:20:34 +05:30
vdutta
4d89930dae ieee1905: Restructuring 1905 stack 2020-01-22 18:18:41 +05:30
Amin Ben Ramdhane
c5568cc3a8 icwmp: 4.0-2020-01-21 2020-01-21 23:14:43 +01:00
Amin Ben Ramdhane
d145893c54 bbf-1.1-2020-01-21 2020-01-21 23:09:59 +01:00
Ronny Nilsson
7efa7dc06b sdk: dependency was again incorrect. This time there were issues when building for Mediatek. 2020-01-21 15:57:33 +01:00
Ronny Nilsson
dcc3b5090f sdk: dependency was again incorrect. This time there were issues when building for Mediatek. 2020-01-21 15:57:33 +01:00
Anjan Chanda
2771475f57 Update feed [ iopsys ] package [ wifilife ]
-------------------------------------------------------------------------------
* 6506026 fix CMD_GET_ASSOCLIST request struct size
* 07ca2c6 remove 'wfs_delm.h'
* 3aafa35 define steer policy for sta
-------------------------------------------------------------------------------
commit 6506026c70944cba7611c3e0ffaec3255c73eb32
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2020-01-20 14:59:31 +0100

    fix CMD_GET_ASSOCLIST request struct size

Base directory -> /
 src/agent/agent.c      | 5 ++++-
 src/comm/comm.h        | 2 +-
 src/controller/cntlr.c | 3 +--
 3 files changed, 6 insertions(+), 4 deletions(-)
-------------------------------------------------------------------------------
commit 07ca2c64287070a637e3a2f6f05f6bdb5a8b7272
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2020-01-20 11:07:26 +0100

    remove 'wfs_delm.h'

Base directory -> /
 src/wfa_delm.h | 164 ---------------------------------------------------------
 1 file changed, 164 deletions(-)
-------------------------------------------------------------------------------
commit 3aafa35aec53b1687423e5e850f553b7a54d7b7a
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2020-01-20 11:02:23 +0100

    define steer policy for sta

Base directory -> /
 src/agent/agent.c         | 32 ++++++++++++++++----------------
 src/agent/agent.h         | 15 +++++++++------
 src/agent/agent_ubus.c    |  6 +++---
 src/agent/default_steer.h | 17 +++++++++++++++--
 src/controller/cntlr.h    |  1 -
 5 files changed, 43 insertions(+), 28 deletions(-)
-------------------------------------------------------------------------------
2020-01-21 09:31:29 +01:00
vdutta
7993de3335 Ticket#434: Fix write access in cifsd init 2020-01-20 10:50:01 +01:00
vdutta
387b9fcfef Ticket#434: Added more cifsd configurabale parameters 2020-01-20 10:50:01 +01:00
Vladimir Vid
456bca5cbb cifsd: add package
* add cifsd - kernel module
* add cifsd-tools - userspace package

Reference repos:

https://github.com/namjaejeon/cifsd
https://github.com/namjaejeon/cifsd-tools

Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
2020-01-20 10:50:01 +01:00
jjoseph
10337ed433 wfadatad : Makefile and init.d file changes 2020-01-17 16:54:34 +05:30
Ronny Nilsson
cab7f065f3 Samba 3 depends on the readline library for building. 2020-01-16 15:24:17 +01:00
Ronny Nilsson
e877a0c949 uboot: OpenWrt v19 har changed so /boot is cleaned every build.
Need to defer install of uboot image until after the OpenWrt clean.
2020-01-16 11:39:11 +01:00
Amin Ben Ramdhane
20ce9c5f65 icwmp: 4.0-2020-01-15 2020-01-15 14:37:42 +01:00
vdutta
fc01428650 ieee1905: Support for Openssl 1.1.x series 2020-01-14 16:01:57 +05:30
Ronny Nilsson
18008a9ec9 sdk: Remove build dependencies to bcmopen
From OpenWRT point of view no bcmopen package exist. bcmopen
is really just bcmkernel built with alternate flags.
2020-01-13 15:31:00 +01:00
Jakob Olsson
51180ef90d easy-soc-libs: api updates, fix utilization, rssi and snr 2020-01-13 14:17:59 +01:00
Jakob Olsson
3df32e7860 wifilife: refactor arp flush logic on missing disassoc ev 2020-01-13 14:16:56 +01:00
Jakob Olsson
bb51885313 wifimngr: update in accordance with libwifi api changes 2020-01-13 14:16:08 +01:00
Jonas Höglund
89b623b415 Revert "icwmp: remove unused library"
This reverts commit cb504ababe.
2020-01-09 17:24:07 +01:00
Sukru Senli
061d5c0eef icwmp: 4.0-2019-12-28 2020-01-09 14:57:52 +01:00
Sukru Senli
75869b899c tr098 1.0-2019-12-28 2020-01-09 14:55:29 +01:00
Sukru Senli
ea19916cc4 bbf-1.0-2019-12-28 2020-01-09 14:50:51 +01:00
vdutta
d416df6f86 ieee1905: Add get_topology command 2020-01-09 14:50:51 +01:00
vdutta
72c59bc2ad ieee1905: Pretty print multiAP cmdu events 2020-01-09 14:50:51 +01:00
Amin Ben Ramdhane
5f2b3a3f9b bbf: use src local if the src folder exists 2020-01-09 14:50:51 +01:00
Amin Ben Ramdhane
cb504ababe icwmp: remove unused library 2020-01-09 14:50:51 +01:00
vdutta
ab44d2383e ieee1905: Generating topology/push button event
- Generating topology change event on ubus "client" event
 - Generating push button event on ubus "wifi.wps", "in-progress" event
2020-01-09 14:50:51 +01:00
vdutta
30d72f1683 ieee1905: Added configure Discovery timer uci option 2020-01-09 14:50:51 +01:00
vdutta
45b8a62027 ieee1905: Added support for 1905 multiap extensions 2020-01-09 14:50:51 +01:00
Anjan Chanda
c476a8ec75 wifimngr: 2.5.0 2020-01-09 14:50:51 +01:00
Anjan Chanda
4a3d6e0331 easy-soc-libs: version-2.5.0 2020-01-09 14:50:51 +01:00
vdutta
a947dae5f3 meshcomms: Removing meshcomms pkg
- Removing meshcomms pkg as functionality moved in ieee1905
2020-01-09 14:50:51 +01:00
vdutta
b219be48eb ieee1905: MultiAP code segregation 2020-01-09 14:50:51 +01:00
Amin Ben Ramdhane
87fc510726 icwmp: compile icwmp-tr098d binary only if CONFIG_PACKAGE_icwmp-tr098 is selected 2020-01-09 14:50:46 +01:00
Jonas Höglund
4929ebc503 questd: Remove dependencies on libdsl,ethernet and wifi. 2020-01-09 09:50:10 +01:00
Jonas Höglund
88af9763a0 Fix dependancy error. 2020-01-08 12:00:24 +01:00
Ronny Nilsson
34343d4824 netmode: remove variables from templates which is automatically set on first boot.
In Iopsys 5 each subsystem has to take care of its own data. If netmode modifies
the hostname, SSID etc. It by it self has to generate fully valid UCI data. If
netmode needs help with that it may use the scripts in /rom/etc/uci-defaults
2020-01-07 14:18:47 +01:00
Sukru Senli
708a417086 iop: naming correction: IopsysWrt -> iopsysWrt 2019-12-23 09:56:57 +01:00
Jonas Höglund
e8ba4a8a14 Fix mediatek tarball generation for iop5. 2019-12-20 14:20:57 +01:00
Ronny Nilsson
b2523c14b6 icwmp: In Iopsys 5 each subsystem has to take care of its own data.
OUI in UCI is not created automatically for CWMP (or any
other package). Anyone who needs it has to fix it them self.
2019-12-18 15:26:49 +01:00
Jonas Höglund
2677dd57de icwmp: Remove packet with broken dependancy 2019-12-11 12:55:32 +01:00
Jonas Höglund
df919ded0c Fix dependancy warning for bcmopen 2019-12-11 12:50:03 +01:00
Ronny Nilsson
343ed3993b sdk: Redesign generation of /etc/banner. OpenWrt has built in support for it that we can use instead. 2019-12-11 12:39:42 +01:00
Ronny Nilsson
41b934575e sdk: Clenup of redundant variables. There were several with identical information.
After asking around there were no clear answer to why there were redundant
information. Thus, I'm doing cleanup all over the place to reduce complexity.
2019-12-11 12:39:42 +01:00
Ronny Nilsson
579fd3bf07 sdk: Clenup of redundant variables. There were several with identical information.
After asking around there were no clear answer to why there were redundant
information. Thus, I'm doing cleanup all over the place to reduce complexity.
2019-12-11 12:39:42 +01:00
Sukru Senli
ee30bacc15 tr098: fix compilation issue 2019-12-11 12:35:31 +01:00
Sukru Senli
06bad4b9c4 icwmp: fix compilation issue 2019-12-11 12:35:23 +01:00
Amin Ben Ramdhane
04a08815e7 tr098: 1.0-2019-12-09 2019-12-10 16:25:56 +01:00
Amin Ben Ramdhane
8397922ecd icwmp: 4.0-2019-12-07 2019-12-10 16:24:39 +01:00
Sukru Senli
4de8c13136 bbf: correct license 2019-12-10 16:19:19 +01:00
Strhuan Blomquist
b9b81709af Delete cve-check.sh 2019-12-10 16:19:19 +01:00
Amin Ben Ramdhane
b4c7eb1a3e bbf: 1.0-2019-12-10 2019-12-10 16:19:19 +01:00
Amin Ben Ramdhane
6706e94bc2 libbfdm: add tr157 files to include repo 2019-12-10 16:19:19 +01:00
Amin Ben Ramdhane
44c870e1bb bbf: 1.0-2019-12-07 2019-12-10 16:19:15 +01:00
Amin Ben Ramdhane
4f5c7623d2 opkgd: add new package 2019-12-10 16:19:15 +01:00
vdutta
5ca4ee678b ieee1905: 1905 meshcomms stack integration 2019-12-10 16:19:15 +01:00
Jakob Olsson
ebb112f264 netmode: on revert write backup cfgs prior to commiting and restart network 2019-12-10 16:19:12 +01:00
Jakob Olsson
b30aca1b27 owsd: include fix for memory leak on too many requests 2019-12-10 16:19:10 +01:00
Amin Ben Ramdhane
5d7af4f3c3 bbf: 1.0-2019-11-11 2019-12-10 16:19:06 +01:00
Anjan Chanda
e5204b2fdc Update feed [ iopsys ] package [ easy-soc-libs ]
-------------------------------------------------------------------------------
* 0accbd7 libwifi: intel: show chan utilization instead of load
-------------------------------------------------------------------------------
commit 0accbd7266b2742ad8921edd5dab974fc384a49a
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-11-27 10:19:28 +0100

    libwifi: intel: show chan utilization instead of load

Base directory -> /
 libwifi/modules/intel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2019-12-10 16:19:00 +01:00
Anjan Chanda
ed855b6921 Update feed [ iopsys ] package [ easy-soc-libs ]
-------------------------------------------------------------------------------
* 429988c libwifi: mtk: implement radio info api
* 8e66b90 libwifi: add radio diagnostic struct
-------------------------------------------------------------------------------
commit 429988cbd11edab826355f01b09f0588893b550a
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-11-24 19:47:59 +0100

    libwifi: mtk: implement radio info api

Base directory -> /
 libwifi/modules/mtk.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++
 libwifi/modules/mtk.h | 57 ++++++++++++++++++++++++++++++++++--
 libwifi/wifi.h        | 35 ++++++++--------------
 3 files changed, 148 insertions(+), 25 deletions(-)
-------------------------------------------------------------------------------
commit 8e66b90aeadf95dd69dfc7e067e06073039e87c0
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-11-22 16:45:41 +0100

    libwifi: add radio diagnostic struct

Base directory -> /
 libwifi/modules/mtk.c |  9 +++++++++
 libwifi/modules/mtk.h | 14 ++++++++++++++
 libwifi/wifi.h        | 18 +++++++++++-------
 3 files changed, 34 insertions(+), 7 deletions(-)
-------------------------------------------------------------------------------
2019-12-10 16:19:00 +01:00
Anjan Chanda
052823c0fd Update feed [ iopsys ] package [ wifimngr ]
-------------------------------------------------------------------------------
* 4b876cc show basic and supported rates in radio status
* aad1a26 add radio info details including diagnostics
-------------------------------------------------------------------------------
commit 4b876ccabc1df73202bfb165b35fd6464ed019aa
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-11-25 16:54:49 +0100

    show basic and supported rates in radio status

Base directory -> /
 wifimngr.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit aad1a26637b7a1429022d172af43847b2d28ae1c
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-11-24 19:54:31 +0100

    add radio info details including diagnostics

Base directory -> /
 wifimngr.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 74 insertions(+), 16 deletions(-)
-------------------------------------------------------------------------------
2019-12-10 16:19:00 +01:00
Yalu Zhang
e5f389aab6 Change line/channel names from tapi/1 and tapi/2 to tapi/0 and tapi1
Unsupported lines/channes like TAPI/[2-6], BRCM/6 are also removed.

This change has the following benefits.
- To simplify the line/channel name handling in /etc/init.d/voice_client
- To have the consistent implementation both on Intel and on Broadcom platforms

(cherry picked from commit 40c426ca09)
2019-12-10 16:19:00 +01:00
vdutta
6bf2135bbc meshcomms: Optimize meshcomms library 2019-12-10 16:19:00 +01:00
vdutta
dcc58ea25a meshcomms: Remove compile time Endianness dependency 2019-12-10 16:19:00 +01:00
Anjan Chanda
8644eb21ab Update feed [ iopsys ] package [ easy-soc-libs ]
-------------------------------------------------------------------------------
* edaace5 libwifi: intel: fix bss utilization and sta count
-------------------------------------------------------------------------------
commit edaace5a36b0dcac66a0371b40a2bc7ed99b4119
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-11-14 12:24:35 +0100

    libwifi: intel: fix bss utilization and sta count

Base directory -> /
 libwifi/modules/intel.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
-------------------------------------------------------------------------------
2019-12-10 16:19:00 +01:00
vdutta
170a1f6ad8 meshcomms: Add dynamic meshcomms library 2019-12-10 16:19:00 +01:00
Anjan Chanda
362b54c642 Update feed [ iopsys ] package [ easy-soc-libs ]
-------------------------------------------------------------------------------
* d4e760c libwifi: intel: get maxassoc and hidden info in wifi_ap_info
* 703ce26 libwifi: bcm: get maxassoc and hidden info in wifi_ap_info
-------------------------------------------------------------------------------
commit d4e760c73a600749325b2cc6d5554696a6c956f8
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-11-11 12:25:32 +0100

    libwifi: intel: get maxassoc and hidden info in wifi_ap_info

Base directory -> /
 libwifi/modules/intel.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 703ce26a3e884937ea520c624ee27b88d0991367
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-11-11 11:34:53 +0100

    libwifi: bcm: get maxassoc and hidden info in wifi_ap_info

Base directory -> /
 libwifi/modules/bcm.c | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
2019-12-10 16:18:26 +01:00
Jakob Olsson
d9e28aa3ca questd: print port speed when link is down #571 2019-12-10 16:18:26 +01:00
Ronny Nilsson
a942e21040 endptmngr: support parallell build. 2019-12-10 16:18:26 +01:00
Ronny Nilsson
49dd5d8e31 voice: modified dependencies again. Turns out we need both the old ones AND the new ones
Due to there are TWO dependency systems(!?). One for Kconfig and one for Make. And they
don't cooperate as good as one expects.
2019-12-10 16:18:26 +01:00
Strhuan Blomquist
86757e41a3 added RTX to licenses info 2019-12-10 16:18:26 +01:00
Strhuan Blomquist
3f86658c46 added more info to PROPRIETARY tag 2019-12-10 16:18:26 +01:00
Kenneth Johansson
7fa87aca9d genconfig: mirror var is CONFIG_LOCALMIRROR.
To get the use of the mirror to work.
2019-12-10 16:18:26 +01:00
Jakob Olsson
5259cc9edb questd: relocate locks and move dump client invokes 2019-12-10 16:18:26 +01:00
Anjan Chanda
b39000ea58 Update feed [ iopsys ] package [ wifimngr ]
-------------------------------------------------------------------------------
* 939b0ae rename 11xx_ caps to dot11xx_
* 381cd70 wifi_sta_disconnect() accepts macaddress in bytes
-------------------------------------------------------------------------------
commit 939b0ae989979a1ad1942373791fe230bc3e41ca
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-10-29 16:47:55 +0100

    rename 11xx_ caps to dot11xx_

Base directory -> /
 wifimngr.c | 144 ++++++++++++++++++-------------------------------------------
 1 file changed, 41 insertions(+), 103 deletions(-)
-------------------------------------------------------------------------------
commit 381cd70238230aa7fc56b85369f265272698165f
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-09-23 09:26:41 +0200

    wifi_sta_disconnect() accepts macaddress in bytes

Base directory -> /
 wifimngr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
-------------------------------------------------------------------------------
2019-12-10 16:18:26 +01:00
Anjan Chanda
001d494afd Update feed [ iopsys ] package [ easy-soc-libs ]
-------------------------------------------------------------------------------
* 3ddc5af libwifi: mtk: fix cipher type in get_security
-------------------------------------------------------------------------------
commit 3ddc5af4c29e98c14424fd5d7ef15f72d31b53dc
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-11-07 12:01:54 +0100

    libwifi: mtk: fix cipher type in get_security

Base directory -> /
 libwifi/modules/mtk.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
2019-12-10 16:17:53 +01:00
Sukru Senli
3befafcbc1 bbf: bump version to 1.0-2019-11-05 2019-12-10 16:17:53 +01:00
vdutta
597d866204 easy_qos: Mark packets with iptables and classcfg 2019-12-10 16:17:53 +01:00
Sukru Senli
568b6785d3 easy-qos: use prerouting chain instead of output 2019-12-10 16:17:53 +01:00
Ronny Nilsson
3a7975bd9b iopupgrade: Configuration handling has been moved into the iopu_chroot script. 2019-12-04 15:18:51 +01:00
Ronny Nilsson
e54251dc24 iopupgrade: Less error prone invoke of iopupgrade. 2019-12-04 15:14:41 +01:00
Ronny Nilsson
ec2b9e76c4 iopupgrade: minor typo 2019-12-04 15:11:20 +01:00
Ronny Nilsson
d8b65da11f iopupgrade: Make the watchdog send an alarm only if it fully times out. 2019-12-04 15:10:48 +01:00
Ronny Nilsson
3f124c31f0 iopupgrade: Minor better cleanup. 2019-12-04 15:09:14 +01:00
Ronny Nilsson
b376a0b16a iopupgrade: Kill the watchdog only if it has been started. 2019-12-04 15:07:55 +01:00
Ronny Nilsson
42c0e1ecc8 iopupgrade: Prevent cleaning twice. 2019-12-04 15:06:18 +01:00
Ronny Nilsson
cdce816fd2 iopupgrade: The variables are written as integers and thus should be read as integers. 2019-12-04 15:04:31 +01:00
Ronny Nilsson
a49951ad7e iopupgrade: The post rootfs fixup need some arguments for backward compatibility. 2019-12-04 15:01:04 +01:00
Ronny Nilsson
887cef9b37 iopupgrade: Unify indentation to either space or tab, but not intermixed. 2019-12-04 14:59:30 +01:00
Ronny Nilsson
3ccdcb4140 Double verification of the string before invoking it. 2019-12-03 15:38:58 +01:00
Ronny Nilsson
0a80afc550 iopu: pass on all command line arguments as documented in the Bash manual. 2019-12-03 15:38:04 +01:00
Ronny Nilsson
c5c4a6dcbe iopu: configuration migration is handled via iopu_chroot. Like the bootloader upgrade. 2019-12-03 13:37:41 +01:00
Ronny Nilsson
6f5e41bb76 iopu: Exit with same returncode as the program we invoke. 2019-12-03 12:15:21 +01:00
Kenneth Johansson
20937718f1 iopu: prepare for configuration handling.
for now just print that it does not exist.
add some help text.
2019-12-02 17:58:39 +01:00
Kenneth Johansson
f7b13cf973 iopu: add -c option to run any command in the newroot env.
Also fix so that it is safe to ctrl-c in all cases and not get
bind mounts hanging around.

if command has arguments make the entire command a string like.

iopu -c "cat /etc/os-release"
2019-12-02 17:35:46 +01:00
Ronny Nilsson
946b7a453c busybox: add run-parts and mountpoint, for use in future sysupgrade copy config. 2019-11-29 13:41:18 +01:00
Jonas Höglund
fcf102b9d2 Use inotify-tools from openwrt-packages 2019-11-26 14:22:57 +01:00
Jonas Höglund
6355eb4b9e Remove deleted package from config. 2019-11-26 11:18:51 +01:00
Jonas Höglund
315d7b44f9 Remove deprecated wifixd 2019-11-26 10:53:32 +01:00
Jonas Höglund
6c342e930d Fix spelling error 2019-11-26 10:40:38 +01:00
Jonas Höglund
624e67df4b There is no kmod-ipv6 2019-11-26 10:21:52 +01:00
Jonas Höglund
8f2694b035 There is no libwifix 2019-11-26 10:20:40 +01:00
Jonas Höglund
776baa7c95 There is no libdatamodel 2019-11-26 10:19:26 +01:00
Jonas Höglund
baff3cf6c7 There is no libzstream package 2019-11-26 10:12:04 +01:00
Jonas Höglund
a5e007a3b6 Add shflags for icwmp 2019-11-26 10:10:07 +01:00
Jonas Höglund
23b88839a0 Define package to fix dependency issue 2019-11-25 16:13:53 +01:00
Jonas Höglund
ddc1933862 Remove deprecated package 2019-11-25 15:57:47 +01:00
Jonas Höglund
50e836e3e7 Remove unneeded packages 2019-11-25 15:18:44 +01:00
Jonas Höglund
e3f7ad9156 Fix conditional dependancy. 2019-11-25 14:22:51 +01:00
Jonas Höglund
73d9e5a6f1 Add librpc 2019-11-22 14:46:18 +01:00
Jonas Höglund
73124c3d37 Overwrite from openwrt_core 2019-11-20 15:12:48 +01:00
Jonas Höglund
be2a34fcb4 iop: Remove base-files from default packages.
Base-files extraction is broken. Apply initial commit from existing
base-files branch and modify extract_core.sh like so:

- orphan_branch tmp
+ # orphan_branch tmp
+  git checkout $repo

Then extract base-files.
2019-11-20 11:48:30 +01:00
Jonas Höglund
a3f8d33711 iop: Update extract core for iop5 2019-11-20 10:35:17 +01:00
Jonas Höglund
a500724e17 Add libmicroxml from lede-managment 2019-11-19 10:41:24 +01:00
Jonas Höglund
ab4b8f3373 Update feed [ iopsys ] package [ libtr098 ]
-------------------------------------------------------------------------------
* 65bd1d7 Fix linker issue for iop5
-------------------------------------------------------------------------------
commit 65bd1d77eb85a2d5d3d55e5c68abd38268b89ec8
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2019-11-14 15:13:16 +0100

    Fix linker issue for iop5

Base directory -> /
 tr098/wandevice.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
2019-11-14 15:15:19 +01:00
Jonas Höglund
bc0452e56d Update feed [ iopsys ] package [ icwmp ]
-------------------------------------------------------------------------------
* 9cfbfa9 Resolve linker problem in iop5
-------------------------------------------------------------------------------
commit 9cfbfa9a381d372643fe18f8c258779bed3ee3bd
Author: Jonas Höglund <jonas.hoglund@embeddednation.com>
Date: 2019-11-14 14:50:44 +0100

    Resolve linker problem in iop5

Base directory -> /
 event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2019-11-14 14:50:58 +01:00
Anjan Chanda
da92efc708 Update feed [ iopsys ] package [ easy-soc-libs ]
-------------------------------------------------------------------------------
* 63f749f libwifi: intel: populate fields in ap info
* 61ab677 libwifi: intel: implement add/del vendor ie
* b9026d6 libwifi: intel: implement monitor sta
-------------------------------------------------------------------------------
commit 63f749faa67670229a5cbaf39ee0fef92d8276f3
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-11-04 14:48:49 +0100

    libwifi: intel: populate fields in ap info

Base directory -> /
 libwifi/modules/intel.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit 61ab677a480f2bc87e117c720d1ae32ff91b665e
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-10-10 15:06:43 +0200

    libwifi: intel: implement add/del vendor ie

Base directory -> /
 libwifi/modules/intel.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
-------------------------------------------------------------------------------
commit b9026d620fba8df6f886dbb938383e1662f40ae5
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-10-09 15:02:21 +0200

    libwifi: intel: implement monitor sta

Base directory -> /
 libwifi/modules/intel.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 72 insertions(+), 3 deletions(-)
-------------------------------------------------------------------------------
2019-11-04 15:18:19 +01:00
Anjan Chanda
ba98d3e7aa Update feed [ iopsys ] package [ wifilife ]
-------------------------------------------------------------------------------
* 878ad93 agent: do not trigger scan when ssid is blank
* 0172e3e Add LICENSE
* 2884e00 cppcheck: add 'check' target in Makefile
-------------------------------------------------------------------------------
commit 878ad93c0f1ad49bd187f776808e0b86402b2238
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-11-04 14:43:09 +0100

    agent: do not trigger scan when ssid is blank

Base directory -> /
 src/agent/agent.c | 67 ++++++++++++++++++++++++++++++-------------------------
 1 file changed, 37 insertions(+), 30 deletions(-)
-------------------------------------------------------------------------------
commit 0172e3e0ae6872f5568b02a820b0583f6d3b93af
Author: Strhuan Blomquist <strhuan@iopsys.eu>
Date: 2019-10-31 10:31:27 +0100

    Add LICENSE

Base directory -> /
 LICENSE | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
-------------------------------------------------------------------------------
commit 2884e003560880aec1b7264db8a653d718aaa047
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-10-29 16:33:02 +0100

    cppcheck: add 'check' target in Makefile

Base directory -> /
 src/Makefile           | 14 ++++++++++++++
 src/agent/agent.c      | 14 +++++++-------
 src/controller/cntlr.c |  6 +++++-
 src/utils/alloctrace.c |  4 ++--
 4 files changed, 28 insertions(+), 10 deletions(-)
-------------------------------------------------------------------------------
2019-11-04 15:16:02 +01:00
Reidar Cederqvist
019a02fa7f asterisk: fix No call logs for internal calls
Remove the check of sip user so that the internal call can be parsed as call log.
2019-11-04 10:26:02 +01:00
Amin Ben Ramdhane
42d496107e bbf: 1.0-2019-11-02 2019-11-02 12:23:19 +01:00
vdutta
549378ecbd uspd: Updated readme document 2019-11-01 19:19:19 +05:30
vdutta
c0bef6ce70 meshcomms: Add lan in interface list 2019-11-01 17:26:09 +05:30
vdutta
97853638bf meshcomms: Broadcast received CMDUs as ubus event
Description:
 - Broadcast event format
   `{"address": "String", "version":Integer, "type":Integer, "mid":Integer, "relay":Integer, "data":"String"}`
 - Example event
 `{ "meshcomms": {"address":"34:e3:80:76:01:21","version":0,"type":2,"mid":24104,"relay":0,"data":"000000025e280080000000"} }`
 - Address in broadcast event is the received macaddress of CMDU
2019-11-01 15:16:20 +05:30
yyashvardhan
a968641bd1 ieee1905: Broadcast meshcomms event on ieee1905.event 2019-11-01 13:52:06 +05:30
Strhuan Blomquist
e7c8c56819 added licenses tag in the right place 2019-10-31 16:35:42 +01:00
Strhuan Blomquist
f4b1bf345c Update Makefile 2019-10-31 10:57:05 +01:00
Strhuan Blomquist
6d212ecea3 Updated packages in iopsys feeds to have licenses info 2019-10-31 10:34:16 +01:00
yyashvardhan
444a5a0c82 ieee1905: Added package dependencies 2019-10-31 12:48:36 +05:30
yyashvardhan
b2fce09a7f ieee1905: Added new package 2019-10-31 12:34:45 +05:30
Strhuan Blomquist
6fe9ad271e libpicoevent:added licenses info. 2019-10-30 16:36:50 +01:00
Ronny Nilsson
7677e51aeb Endptmngr: rework dependencies of the Broadcom kernel
Due to OpenWRT tries to be smart with them, but fails.
2019-10-30 15:20:51 +01:00
Strhuan Blomquist
9724913f14 iop: added option to create a license report after a build 2019-10-30 13:49:46 +01:00
vdutta
99925c9360 meshcomms: Added Package 2019-10-30 17:25:16 +05:30
Ronny Nilsson
621ca1c23a icwmp: clean a recursive make dependency. 2019-10-30 11:05:01 +01:00
vdutta
316e7d1d47 uspd: Fixed signedness related warnings 2019-10-30 12:54:13 +05:30
Ronny Nilsson
8ebe2c7f5a ated: Convert improper C-comments to Make-comments. 2019-10-29 17:30:07 +01:00
Ronny Nilsson
0b4be48bf3 voice applications: add build dependency of generic voice support. 2019-10-29 16:31:56 +01:00
Ronny Nilsson
f680ff2229 Dect: add build dependency for the endptmngr application which is needed in runtime. 2019-10-29 16:31:56 +01:00
Sachin Singla
60034eab91 ifbt: fix issue when key name is same 2019-10-29 14:59:32 +01:00
vdutta
6d539c17a7 obuspa: Fix output of async command for Controller 2019-10-22 19:48:24 +05:30
Anjan Chanda
2c06bbeaf0 Update feed [ iopsys ] package [ wifilife ]
-------------------------------------------------------------------------------
* daa3db5 cppcheck: fix errors and important warnings
* 339f2ee README: update for new wifilife config
-------------------------------------------------------------------------------
commit daa3db5baf7336a4ddd6fa57af944e2fd131396b
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-10-21 15:56:56 +0200

    cppcheck: fix errors and important warnings

Base directory -> /
 src/agent/agent.c                | 26 ++++++++++++++++++++------
 src/controller/cntlr.c           | 10 +++++-----
 src/controller/cntlr_comm_ubus.c |  6 ++++--
 src/utils/utils.c                |  2 +-
 4 files changed, 30 insertions(+), 14 deletions(-)
-------------------------------------------------------------------------------
commit 339f2eefe9117eac3d20c7e1b86c7540cefedacf
Author: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: 2019-10-21 09:49:08 +0200

    README: update for new wifilife config

Base directory -> /
 README.md | 269 ++++++++++++++++++++++++++++++++++++++++++++------------------
 1 file changed, 193 insertions(+), 76 deletions(-)
-------------------------------------------------------------------------------
2019-10-22 10:39:15 +02:00
Suru Dissanaike
d36147601b wifilife: remove -Og optimization 2019-10-18 09:20:05 +02:00
Suru Dissanaike
cb3c2d4b0e json-editor: update copyright 2019-10-18 09:02:30 +02:00
Jakob Olsson
e11950b9a1 json-editor: add pkg to simulate javascript style json api 2019-10-18 08:57:42 +02:00
Amin Ben Ramdhane
901c2df5cf bbf: 1.0-2019-10-17 2019-10-17 16:11:15 +01:00
Amin Ben Ramdhane
504621b64b icwmp: 4.0-2019-10-17 2019-10-17 16:08:51 +01:00
Amin Ben Ramdhane
916ac0eea7 Add json folder under /etc/bbfdm/ 2019-10-17 16:03:23 +01:00
yyashvardhan
d7859ebe06 obuspa: Registered some more datamodel nodes 2019-10-17 17:55:36 +05:30
vdutta
c96e9c170a obuspa: Rebase with v2.0.0
Description:
 - Rebase with obuspa v2.0.0
 - Added more configurable options in obuspa uci
 - Optimized default db generation from uci
 - moved interface from connection to global obuspa context in uci
2019-10-16 17:10:43 +05:30
Reidar Cederqvist
9cb726d649 voice-client: do not overwrite tx/rx gain 2019-10-16 09:44:33 +02:00
Reidar Cederqvist
c3bb2895dc Endptmngr: unset patch_dir for open builds
to avoid patching the binaries downloaded when building open builds
2019-10-15 16:24:45 +02:00
Ronny Nilsson
f9f19d1e0c add workaround for EG400 endpt status call
fix for the GUI when board-profile has dect but
dect card is unpopulated
2019-10-15 14:16:23 +02:00
Strhuan Blomquist
df03c86b1d buildsystem iop:add support to generate CVE reports to iop 2019-10-15 09:54:18 +02:00
Jakob Olsson
72aba70aaf wifilife: poll for wifimngr status till success 2019-10-15 09:47:35 +02:00
Jakob Olsson
09e20e451a owsd: allow ubus.object.* events if access specified to affected obj in acl #267 2019-10-14 12:38:16 +02:00
Jakob Olsson
743a9fb0ac wifilife: get mobid & oui on new proxy obj 2019-10-11 15:50:45 +02:00
vdutta
605d816076 uspd: Added support for add/delete of objects 2019-10-10 18:50:30 +05:30
vdutta
7319e7d6aa obuspa: Add support for add/delete of objects 2019-10-10 18:49:43 +05:30
Anjan Chanda
e89954c0c0 easy-soc-libs: libwifi: implement 11k and 11v apis for intel wifi 2019-10-09 10:52:53 +02:00
Jakob Olsson
dcc6644b6e questd: on intel always explicitly show port speed when not 1000mbps autoneg #571 2019-10-08 14:56:31 +02:00
Anjan Chanda
26a5a54673 wifilife: meld misc bugfixes and cleanups from 4.3 2019-10-04 15:03:38 +02:00
Anjan Chanda
a5d00e28d6 easy-soc-libs: libwifi: remove nbr_header from struct nbr 2019-10-04 14:35:16 +02:00
yyashvardhan
d5ab22bcbf obuspa: Added support for IP Diagnostic commands 2019-10-04 16:06:08 +05:30
648 changed files with 365710 additions and 16741 deletions

View File

@@ -1,16 +1,16 @@
/*
* Copyright (C) 2019 iopsys Software Solutions AB. All rights reserved.
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#
# Copyright (C) 2019 iopsys Software Solutions AB. All rights reserved.
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

View File

@@ -1,41 +1,59 @@
#
# Copyright (C) 2019 Iopsys
# Copyright (C) 2019 IOPSYS
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libbbfdm
PKG_VERSION:=1.0-2019-10-01
PKG_VERSION:=2.5-2020-10-26
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=b3bae9df19df35075ac52f53758288d8e0573790
PKG_SOURCE_VERSION:=b0cd55880850efc7995f8cb82ac6dd55e75c7b97
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPLv2
PKG_LICENSE:=LGPL-2.1
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/libbbf_api
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Library for libbbfdm API
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
endef
define Package/libbbfdm
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Library for broadband-forum data model
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libmbedtls
endef
define Package/libbbfdm/config
source "$(SOURCE)/Config_bbfdm.in"
endef
define Package/libbbfdm/description
Test description will update later.
define Package/libbbf_api/description
Library contains the API(UCI, UBUS, JSON, CLI and Browse) of libbbfdm
endef
define Package/libbbfdm/description
Library contains the data model tree. It includes TR181, TR104, TR143, TR157 and TR064 data models
endef
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
ifneq ($(USE_LOCAL),)
define Build/Prepare
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
endif
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_LIBBBFDM_VENDOR_PREFIX)\\\"
TARGET_CFLAGS += \
@@ -66,22 +84,43 @@ CONFIGURE_ARGS += \
--enable-tr064
endif
ifeq ($(CONFIG_PACKAGE_libopenssl),y)
CONFIGURE_ARGS += \
--enable-libopenssl
endif
ifeq ($(CONFIG_PACKAGE_libmbedtls),y)
CONFIGURE_ARGS += \
--enable-libmbedtls
endif
define Package/libbbf_api/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.so* $(1)/lib/
endef
define Package/libbbfdm/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/
$(INSTALL_DIR) $(1)/etc/bbfdm
$(INSTALL_DIR) $(1)/etc/bbfdm/json
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/dmmap $(1)/etc/bbfdm
$(INSTALL_DIR) $(1)/usr/share/bbfdm
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/bbfdm
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
$(INSTALL_DIR) $(1)/usr/include/libbbf_api
$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
$(CP) $(PKG_BUILD_DIR)/dmtree/tr181/*.h $(1)/usr/include/libbbfdm/
$(CP) $(PKG_BUILD_DIR)/dmtree/tr157/*.h $(1)/usr/include/libbbfdm/
$(CP) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.{a,so*} $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libbbf_api))
$(eval $(call BuildPackage,libbbfdm))

44
bulkdata/Makefile Executable file
View File

@@ -0,0 +1,44 @@
#
# Copyright (C) 2020 iopsys Software Solutions AB
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bulkdata
PKG_VERSION:=1.0.0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=BBF BulkData Collection
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +curl +libblobmsg-json +libbbfdm +libbbf_api
endef
define Package/$(PKG_NAME)/description
BBF BulkData Collection
endef
define Build/Prepare
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
TARGET_CFLAGS += \
-D_GNU_SOURCE
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
$(INSTALL_BIN) $(PKG_BUILD_DIR)/*.so $(1)/usr/lib/bbfdm
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -0,0 +1,43 @@
config bulkdata 'bulkdata'
option enable '0'
#Log levels: Critical=0, Warning=1, Notice=2, Info=3, Debug=4
option log_level '3'
config profile
option profile_id '1'
option enable '0'
option name ''
option nbre_of_retained_failed_reports '0'
option protocol 'http'
option encoding_type ''
option reporting_interval '86400'
option time_reference '0'
option csv_encoding_field_separator ','
option csv_encoding_row_separator '&#10;'
option csv_encoding_escape_character '&quot;'
option csv_encoding_report_format 'column'
option csv_encoding_row_time_stamp 'unix'
option json_encoding_report_format 'objecthierarchy'
option json_encoding_report_time_stamp 'unix'
option http_url ''
option http_username ''
option http_password ''
option http_compression 'none'
option http_method 'post'
option http_use_date_header '1'
option http_retry_enable '0'
option http_retry_minimum_wait_interval '5'
option http_retry_interval_multiplier '2000'
option http_persist_across_reboot '0'
config profile_parameter
option profile_id '1'
option name ''
option reference ''
config profile_http_request_uri_parameter
option profile_id '1'
option name ''
option reference ''

View File

@@ -0,0 +1,34 @@
#!/bin/sh /etc/rc.common
# Bulkdata Software
# Copyright (C) 2020 iopsys Software Solutions AB
# Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
START=99
STOP=10
USE_PROCD=1
PROG="/usr/sbin/bulkdatad"
start_service() {
local bulkdata_enable=`uci -q get bulkdata.bulkdata.enable`
if [ "$bulkdata_enable" = "1" ]; then
procd_open_instance
procd_set_param command "$PROG"
procd_set_param respawn "3" "7" "0"
procd_close_instance
fi
}
boot() {
start
}
reload_service() {
stop
start
}
service_triggers()
{
procd_add_reload_trigger bulkdata
}

23
bulkdata/src/Makefile Normal file
View File

@@ -0,0 +1,23 @@
PROG = bulkdatad
LIB = libbulkdata.so
PROG_OBJS = bulkdata.o common.o config.o http.o log.o report.o times.o buci.o
LIB_OBJS = datamodel.o
PROG_CFLAGS = $(CFLAGS) -Wall -Werror -fPIC
PROG_LDFLAGS = $(LDFLAGS) -lubus -luci -lubox -ljson-c -lcurl -lblobmsg_json -lbbfdm
LIB_LDFLAGS = $(LDFLAGS) -lbbf_api
%.o: %.c
$(CC) $(PROG_CFLAGS) $(FPIC) -c -o $@ $<
all: $(PROG) $(LIB)
$(PROG): $(PROG_OBJS)
$(CC) $(PROG_CFLAGS) -o $@ $^ $(PROG_LDFLAGS)
$(LIB): $(LIB_OBJS)
$(CC) $(PROG_CFLAGS) $(LIB_LDFLAGS) -shared -o $@ $^
clean:
rm -f *.o $(PROG) $(LIB)

265
bulkdata/src/buci.c Normal file
View File

@@ -0,0 +1,265 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*
*/
#include <strings.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <errno.h>
#include <unistd.h>
#include <ctype.h>
#include "buci.h"
struct uci_context *uci_ctx = NULL;
int buci_init(void)
{
uci_ctx = uci_alloc_context();
if (!uci_ctx) {
return -1;
}
return 0;
}
int buci_fini(void)
{
if (uci_ctx) {
uci_free_context(uci_ctx);
}
return 0;
}
static bool buci_validate_section(const char *str)
{
if (!*str)
return false;
for (; *str; str++) {
unsigned char c = *str;
if (isalnum(c) || c == '_')
continue;
return false;
}
return true;
}
static int buci_init_ptr(struct uci_context *ctx, struct uci_ptr *ptr, char *package, char *section, char *option, char *value)
{
memset(ptr, 0, sizeof(struct uci_ptr));
/* value */
if (value) {
ptr->value = value;
}
ptr->package = package;
if (!ptr->package)
goto error;
ptr->section = section;
if (!ptr->section) {
ptr->target = UCI_TYPE_PACKAGE;
goto lastval;
}
ptr->option = option;
if (!ptr->option) {
ptr->target = UCI_TYPE_SECTION;
goto lastval;
} else {
ptr->target = UCI_TYPE_OPTION;
}
lastval:
if (ptr->section && !buci_validate_section(ptr->section))
ptr->flags |= UCI_LOOKUP_EXTENDED;
return 0;
error:
return -1;
}
struct uci_section *buci_walk_section(char *package, char *section_type, struct uci_section *prev_section)
{
struct uci_ptr ptr;
struct uci_element *e;
struct uci_section *next_section;
if (section_type == NULL) {
if (prev_section) {
e = &prev_section->e;
if (e->list.next == &prev_section->package->sections)
return NULL;
e = container_of(e->list.next, struct uci_element, list);
next_section = uci_to_section(e);
return next_section;
}
else {
if (buci_init_ptr(uci_ctx, &ptr, package, NULL, NULL, NULL)) {
return NULL;
}
if (uci_lookup_ptr(uci_ctx, &ptr, NULL, true) != UCI_OK) {
return NULL;
}
if (ptr.p->sections.next == &ptr.p->sections)
return NULL;
e = container_of(ptr.p->sections.next, struct uci_element, list);
next_section = uci_to_section(e);
return next_section;
}
}
else {
struct uci_list *ul, *shead = NULL;
if (prev_section) {
ul = &prev_section->e.list;
shead = &prev_section->package->sections;
}
else {
if (buci_init_ptr(uci_ctx, &ptr, package, NULL, NULL, NULL)) {
return NULL;
}
if (uci_lookup_ptr(uci_ctx, &ptr, NULL, true) != UCI_OK) {
return NULL;
}
ul = &ptr.p->sections;
shead = &ptr.p->sections;
}
while (ul->next != shead) {
e = container_of(ul->next, struct uci_element, list);
next_section = uci_to_section(e);
if (strcmp(next_section->type, section_type) == 0)
return next_section;
ul = ul->next;
}
return NULL;
}
return NULL;
}
void buci_print_list(struct uci_list *uh, char **val, char *delimiter)
{
struct uci_element *e;
static char buffer[512];
char *buf = buffer;
*buf = '\0';
uci_foreach_element(uh, e) {
if (*buf) {
strcat(buf, delimiter);
strcat(buf, e->name);
}
else {
strcpy(buf, e->name);
}
}
*val = buf;
}
struct uci_element *buci_lookup_list(struct uci_list *list, const char *name)
{
struct uci_element *e;
uci_foreach_element(list, e) {
if (!strcmp(e->name, name))
return e;
}
return NULL;
}
int uci_lookup_ptr_bysection(struct uci_context *ctx, struct uci_ptr *ptr, struct uci_section *section, char *option, char *value)
{
struct uci_element *e;
memset(ptr, 0, sizeof(struct uci_ptr));
ptr->package = section->package->e.name;
ptr->section = section->e.name;
ptr->option = option;
ptr->value = value;
ptr->flags |= UCI_LOOKUP_DONE;
ptr->p = section->package;
ptr->s = section;
if (ptr->option) {
e = buci_lookup_list(&ptr->s->options, ptr->option);
if (!e)
return UCI_OK;
ptr->o = uci_to_option(e);
ptr->last = e;
ptr->target = UCI_TYPE_OPTION;
}
else {
ptr->last = &ptr->s->e;
ptr->target = UCI_TYPE_SECTION;
}
ptr->flags |= UCI_LOOKUP_COMPLETE;
return UCI_OK;
}
char *buci_get_value_bysection(struct uci_section *section, char *option)
{
struct uci_ptr ptr;
char *val = "";
if (uci_lookup_ptr_bysection(uci_ctx, &ptr, section, option, NULL) != UCI_OK) {
return val;
}
if (!ptr.o)
return val;
if(ptr.o->type == UCI_TYPE_LIST) {
buci_print_list(&ptr.o->v.list, &val, " ");
return val;
}
if (ptr.o->v.string)
return ptr.o->v.string;
else
return val;
}
char *buci_get_value(char *package, char *section, char *option)
{
struct uci_ptr ptr;
char *val = "";
if (!section || !option)
return val;
if (buci_init_ptr(uci_ctx, &ptr, package, section, option, NULL)) {
return val;
}
if (uci_lookup_ptr(uci_ctx, &ptr, NULL, true) != UCI_OK) {
return val;
}
if (!ptr.o)
return val;
if(ptr.o->type == UCI_TYPE_LIST) {
buci_print_list(&ptr.o->v.list, &val, " ");
return val;
}
if (ptr.o->v.string)
return ptr.o->v.string;
else
return val;
}

31
bulkdata/src/buci.h Normal file
View File

@@ -0,0 +1,31 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*
*/
#ifndef __BUCI_H
#define __BUCI_H
#include <uci.h>
int buci_init(void);
int buci_fini(void);
struct uci_section *buci_walk_section(char *package, char *section_type, struct uci_section *prev_section);
void buci_print_list(struct uci_list *uh, char **val, char *delimiter);
struct uci_element *buci_lookup_list(struct uci_list *list, const char *name);
int uci_lookup_ptr_bysection(struct uci_context *ctx, struct uci_ptr *ptr, struct uci_section *section, char *option, char *value);
char *buci_get_value_bysection(struct uci_section *section, char *option);
char *buci_get_value(char *package, char *section, char *option);
#define buci_foreach_section(package, section_type, section) \
for (section = buci_walk_section(package, section_type, NULL); \
section != NULL; \
section = buci_walk_section(package, section_type, section))
#endif //__BUCI_H

144
bulkdata/src/bulkdata.c Normal file
View File

@@ -0,0 +1,144 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
* Omar Kallel <omar.kallel@pivasoftware.com>
*/
#include <stdio.h>
#include <string.h>
#include <libubox/uloop.h>
#include "http.h"
#include "config.h"
#include "log.h"
#include "common.h"
#include "report.h"
#include "times.h"
#include "bulkdata.h"
struct bulkdata bulkdata_main = {0};
int profiles_number = 0;
void bulkdata_profile_cb(struct uloop_timeout *timeout);
int get_retry_period(int min)
{
srand(time(NULL));
return rand()%min + min;
}
static void bulkdata_run_profiles(struct bulkdata *bulkdata)
{
unsigned int next_period;
int i = 0;
for (i = 0; i < profiles_number; i++) {
bulkdata->profile[i].utimer.cb = bulkdata_profile_cb;
LIST_HEAD(failedreports);
bulkdata->profile[i].failed_reports = &failedreports;
next_period = get_next_period(bulkdata->profile[i].time_reference, bulkdata->profile[i].reporting_interval);
bulkdata_log(SINFO, "The session of profile_id %d will be start in %d sec", bulkdata->profile[i].profile_id, next_period);
uloop_timeout_set(&bulkdata->profile[i].utimer, next_period * 1000);
}
}
int http_send_report(struct profile *profile, char *report)
{
char *msg_in = NULL;
int http_code;
http_client_init(profile);
bulkdata_log(SINFO, "Send the report of profile_id %d to Bulkdata Collector", profile->profile_id);
http_code = http_send_message(profile, report, strlen(report), &msg_in);
http_client_exit();
return http_code;
}
void bulkdata_profile_cb(struct uloop_timeout *timeout)
{
struct profile *profile;
unsigned int http_code, retry_period;
char *report = NULL;
profile = container_of(timeout, struct profile, utimer);
time_t now = time(NULL);
bulkdata_log(SINFO, "New session of profile_id %d started", profile->profile_id);
if(profile->retry_count == 0 || profile->next_retry > now || !profile->http_retry_enable) //Perdiodic execution
create_encoding_bulkdata_report(profile, &report);
else
create_failed_report(profile, &report);
bulkdata_log(SDEBUG, "The content of the profile_id report %d is :\n==========\n%s\n==========\n", profile->profile_id, report);
http_code= http_send_report(profile, report);
if(http_code != 200){
if(profile->retry_count == 0 || profile->next_retry > now || !profile->http_retry_enable) { //Perdiodic execution
retry_period = get_retry_period(profile->http_retry_minimum_wait_interval);
profile->next_period = now + profile->reporting_interval;
profile->next_retry = now + retry_period;
profile->retry_count = 1;
profile->min_retry = profile->http_retry_minimum_wait_interval * 2;
if((profile->next_retry < profile->next_period) && profile->http_retry_enable) {
bulkdata_log(SINFO, "Retry session of profile_id %d in %d sec", profile->profile_id, retry_period);
uloop_timeout_set(timeout, 1000 * retry_period);
}
else {
bulkdata_log(SINFO, "Start New session of profile_id %d in %d sec", profile->profile_id, profile->reporting_interval);
uloop_timeout_set(timeout, 1000 * profile->reporting_interval);
}
} else { //Retry execution
retry_period= get_retry_period(profile->min_retry);
profile->min_retry*=2;
profile->next_retry+=retry_period;
profile->retry_count++;
if(profile->next_retry < profile->next_period) {
bulkdata_log(SINFO, "Retry session of profile_id %d in %d sec", profile->profile_id, retry_period);
uloop_timeout_set(timeout, 1000 * retry_period);
}
else {
bulkdata_log(SINFO, "Retry session of profile_id %d in %d sec", profile->profile_id, (profile->next_period-profile->next_retry+retry_period));
uloop_timeout_set(timeout, 1000 * (profile->next_period-profile->next_retry+retry_period));
}
}
if(profile->new_report){
bulkdata_add_failed_report(profile, profile->new_report);
FREE(profile->new_report);
}
FREE(report);
} else {
if(profile->retry_count == 0 || profile->next_retry > now || !profile->http_retry_enable) {
bulkdata_log(SINFO, "Start New session of profile_id %d in %d sec", profile->profile_id, profile->reporting_interval);
uloop_timeout_set(timeout, 1000 * profile->reporting_interval);
}
else {
bulkdata_log(SINFO, "Retry session of profile_id %d in %d sec", profile->profile_id, (profile->next_period-profile->next_retry));
uloop_timeout_set(timeout, 1000 * (profile->next_period-profile->next_retry));
}
FREE(profile->new_report);
FREE(report);
empty_failed_reports_list(profile);
profile->retry_count= 0;
}
}
int main(void)
{
struct bulkdata *bulkdata = &bulkdata_main;
if (bulkdata_config_init(bulkdata) == -1)
return -1;
bulkdata_log(SINFO, "Start bulkdatad daemon");
uloop_init();
bulkdata_run_profiles(bulkdata);
uloop_run();
uloop_done();
bulkdata_config_fini(bulkdata);
bulkdata_log(SINFO, "Stop bulkdatad daemon");
return 0;
}

18
bulkdata/src/bulkdata.h Normal file
View File

@@ -0,0 +1,18 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*
*/
#ifndef __BULKDATA_H
#define __BULKDATA_H
extern struct bulkdata bulkdata_main;
extern int profiles_number;
#endif /* __BULKDATA_H */

105
bulkdata/src/bulkdata.md Normal file
View File

@@ -0,0 +1,105 @@
# README #
bulkdatad is an implementation of The HTTP bulk data collection mechanism which is an extended feature of CPE and other agents implementing TR-069(CWMP) or TR-369(USP), defined by the Broadband Forum. It provides a means by which an Auto-Configuration Server (ACS), or USP Controller, can configure an agent to periodically send a JSON or CSV formatted set of Device information to an HTTP server running a data collection application.
## Configuration File ##
The bulkdatad UCI configuration is located in **'/etc/config/bulkdata'**, and contains 4 sections: **bulkdata**, **profile**, **profile\_parameter** and **profile\_http\_request\_uri\_parameter**.
```
config bulkdata 'bulkdata'
option enable '0'
option log_level '3'
config profile
option profile_id '1'
option enable '0'
option csv_encoding_row_time_stamp 'unix'
option json_encoding_report_time_stamp 'unix'
option http_retry_minimum_wait_interval '5'
option http_retry_interval_multiplier '2000'
config profile_parameter
option profile_id '1'
option name ''
option reference ''
config profile_http_request_uri_parameter
option profile_id '1'
option name ''
option reference ''
```
### bulkdata section ###
It defines **bulkdata configuration**: enable and log\_level.
| Name | Type | Description |
| ----------- | ------- | ----------------------------------------------------------------------------------------------- |
| `enable` | boolean | Enables the BulkData feature if set to **1**. |
| `log_level` | integer | Specifies the log type to use, by default **'INFO'**. The possible types are **'EMERG', 'ALERT', 'CRITIC' ,'ERROR', 'WARNING', 'NOTICE', 'INFO' and 'DEBUG'**. |
### profile section ###
It defines **the profile section configuration**: enable, name,... The possible options for **profile** section are listed below:
| Name | Type | Description |
| ---------------------------------- | ------- | ---------------------------------------------- |
| `profile_id` | integer | The profile id to use. |
| `enable` | boolean | If set to **1**, enables the bulkdata profile. |
| `name` | string | The name of the profile. |
| `nbre_of_retained_failed_reports` | integer | The number of failed reports to be retained and transmitted at the end of the current reporting interval. |
| `protocol` | string | The protocol used for the collection profile. |
| `encoding_type` | string | The encoding type used for the collection profile. |
| `reporting_interval` | integer | The reporting interval in seconds. |
| `time_reference` | integer | The time reference to determine when the profile will be transmitted to the ACS collector. |
| `csv_encoding_field_separator` | string | The field separator to use when encoding CSV data. |
| `csv_encoding_row_separator` | string | The row separator to use when encoding CSV data. |
| `csv_encoding_escape_character` | string | The escape character to use when encoding CSV data. |
| `csv_encoding_report_format` | string | Describes how reports will be formatted. Two possible formats are supported: **'ParameterPerRow' and 'ParameterPerColumn'**. |
| `csv_encoding_row_time_stamp` | string | The format of the timestamp to use for data inserted into the row. The row time stamp supported are **'Unix-Epoch', 'ISO-8601' and 'None'**. |
| `json_encoding_report_format` | string | Describes the report format. The supported report formats are **'ObjectHierarchy' and 'NameValuePair'**. |
| `json_encoding_report_time_stamp` | string | The format of the timestamp to use for the JSON Object named "CollectionTime". The supported timestamp are **'Unix-Epoch', 'ISO-8601' and 'None'**. |
| `http_url` | string | The URL of the collection server. |
| `http_username` | string | The username of the collection server. |
| `http_password` | string | The password of the collection server. |
| `http_compression` | string | The HTTP Compression mechanism used by the collection server. The supported compression mechanism are **'GZIP', 'Compress' and 'Deflate'**. |
| `http_method` | string | The HTTP method used by the collection server. Two methods are supported: **'POST' and 'PUT'**. |
| `http_use_date_header` | boolean | If set to **1**, the CPE encodes the HTTP Date Header. |
| `http_retry_enable` | boolean | If set to **1**, the CPE retries unsuccessful attempts to transfer data. |
| `http_retry_minimum_wait_interval` | integer | The data transfer retry wait interval. |
| `http_retry_interval_multiplier` | integer | The retry interval multiplier. |
| `http_persist_across_reboot` | boolean | If set to **1**, failed data transfers must be persisted across reboots. |
### profile_parameter section ###
It defines **the profile\_parameter section configuration**: profile\_id, name, reference.
| Name | Type | Description |
| ------------ | ------- | --------------------------------------- |
| `profile_id` | integer | The id of the used profile. |
| `name` | string | The name of the profile parameter. |
| `reference` | string | The reference of the profile parameter. |
### profile_http_request_uri_parameter section ###
It defines **the profile\_http\_request\_uri\_parameter section configuration**: profile\_id, name, reference.
| Name | Type | Description |
| ------------ | ------- | --------------------------------------- |
| `profile_id` | integer | The id of the used profile. |
| `name` | string | The name of the Request-URI parameter. |
| `reference` | string | The reference of the profile parameter. |
## Dependencies ##
To successfully build bulkdatad, the following libraries are needed:
| Dependency | Link | License |
| ----------- | ------------------------------------------- | -------------- |
| libuci | https://git.openwrt.org/project/uci.git | LGPL 2.1 |
| libubox | https://git.openwrt.org/project/libubox.git | BSD |
| libjson-c | https://s3.amazonaws.com/json-c_releases | MIT |
| libcurl | https://dl.uxnr.de/mirror/curl | MIT |
| libbbfdm | https://dev.iopsys.eu/iopsys/bbf.git | LGPL 2.1 |

450
bulkdata/src/common.c Normal file
View File

@@ -0,0 +1,450 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
* Omar Kallel <omar.kallel@pivasoftware.com>
*/
#include "common.h"
static pathnode *head = NULL;
static pathnode *temphead = NULL;
int bulkdata_dm_ctx_init(struct dmctx *ctx)
{
struct bulkdata *bulkdata = &bulkdata_main;
dm_ctx_init(ctx, DM_CWMP, bulkdata->amd_version, bulkdata->instance_mode);
return 0;
}
int bulkdata_dm_ctx_clean(struct dmctx *ctx)
{
dm_ctx_clean(ctx);
return 0;
}
static char **str_split(const char* str, const char* delim, size_t* numtokens)
{
char *s = strdup(str);
size_t tokens_alloc = 1;
size_t tokens_used = 0;
char **tokens = calloc(tokens_alloc, sizeof(char*));
char *token, *strtok_ctx;
for (token = strtok_r(s, delim, &strtok_ctx); token != NULL; token = strtok_r(NULL, delim, &strtok_ctx)) {
if (tokens_used == tokens_alloc) {
tokens_alloc *= 2;
tokens = realloc(tokens, tokens_alloc * sizeof(char*));
}
tokens[tokens_used++] = strdup(token);
}
// cleanup
if (tokens_used == 0) {
FREE(tokens);
} else {
tokens = realloc(tokens, tokens_used * sizeof(char*));
}
*numtokens = tokens_used;
FREE(s);
return tokens;
}
static bool bulkdata_match(const char *string, const char *pattern)
{
regex_t re;
if (regcomp(&re, pattern, REG_EXTENDED) != 0) return 0;
int status = regexec(&re, string, 0, NULL, 0);
regfree(&re);
if (status != 0) return false;
return true;
}
static bool is_res_required(char *str, int *start, int *len)
{
char temp_char[NAME_MAX] = {'\0'};
if (bulkdata_match(str, GLOB_CHAR)) {
int s_len = strlen(str);
int b_len = s_len, p_len = s_len;
char *star = strchr(str, '*');
if(star)
s_len = star - str;
*start = MIN(MIN(s_len, p_len), b_len);
if (*start == s_len)
*len = 1;
strncpy(temp_char, str+*start, *len);
if (bulkdata_match(temp_char, "[*+]+"))
return true;
}
*start = strlen(str);
return false;
}
static void insert(char *data, bool active)
{
pathnode *link = (pathnode*) calloc(1, sizeof(pathnode));
if(!link) {
return;
}
link->ref_path = data;
if(active) {
link->next = head;
head = link;
} else {
link->next = temphead;
temphead = link;
}
}
static void swap_heads(void)
{
pathnode *temp = head;
head = temphead;
temphead = temp;
}
static void deleteList(void)
{
pathnode *ptr = head, *temp;
while(ptr != NULL) {
temp = ptr;
free(ptr->ref_path);
if(ptr->next != NULL) {
ptr = ptr->next;
} else {
ptr = NULL;
}
free(temp);
}
head = NULL;
swap_heads();
}
void bulkdata_add_data_to_list(struct list_head *dup_list, char *name, char *value, char *type)
{
struct resultsnode *link;
link = calloc(1, sizeof(struct resultsnode));
list_add_tail(&link->list, dup_list);
link->name = strdup(name);
link->data = strdup(value);
link->type = strdup(type);
}
void bulkdata_delete_data_from_list(struct resultsnode *link)
{
list_del(&link->list);
FREE(link->name);
FREE(link->data);
FREE(link->type);
FREE(link);
}
void bulkdata_free_data_from_list(struct list_head *dup_list)
{
struct resultsnode *link;
while (dup_list->next != dup_list) {
link = list_entry(dup_list->next, struct resultsnode, list);
bulkdata_delete_data_from_list(link);
}
}
static bool bulkdata_get(int operation, char *path, struct dmctx *dm_ctx)
{
int fault = 0;
switch(operation) {
case CMD_GET_NAME:
fault = dm_entry_param_method(dm_ctx, CMD_GET_NAME, path, "true", NULL);
break;
case CMD_GET_VALUE:
fault = dm_entry_param_method(dm_ctx, CMD_GET_VALUE, path, NULL, NULL);
break;
default:
return false;
}
if (dm_ctx->list_fault_param.next != &dm_ctx->list_fault_param) {
return false;
}
if (fault) {
return false;
}
return true;
}
char *bulkdata_get_value_param(char *path)
{
struct dmctx ctx = {0};
struct dm_parameter *n;
char *value = NULL;
bulkdata_dm_ctx_init(&ctx);
if(bulkdata_get(CMD_GET_VALUE, path, &ctx)) {
list_for_each_entry(n, &ctx.list_parameter, list) {
value = strdup(n->data);
break;
}
}
bulkdata_dm_ctx_clean(&ctx);
return value;
}
void bulkdata_get_value(char *path, struct list_head *list)
{
struct dmctx ctx = {0};
struct dm_parameter *n;
bulkdata_dm_ctx_init(&ctx);
if(bulkdata_get(CMD_GET_VALUE, path, &ctx)) {
list_for_each_entry(n, &ctx.list_parameter, list) {
bulkdata_add_data_to_list(list, n->name, n->data, n->type);
}
}
bulkdata_dm_ctx_clean(&ctx);
}
bool bulkdata_get_name(char *path)
{
struct dmctx ctx = {0};
struct dm_parameter *n;
bool ret = false;
bulkdata_dm_ctx_init(&ctx);
if(bulkdata_get(CMD_GET_NAME, path, &ctx)) {
list_for_each_entry(n, &ctx.list_parameter, list) {
insert(strdup(n->name), false);
}
ret = true;
}
bulkdata_dm_ctx_clean(&ctx);
return ret;
}
static void fill_node_path(void)
{
pathnode *p=head;
while(p!=NULL) {
bulkdata_get_name(p->ref_path);
p=p->next;
}
deleteList();
}
static void bulkdata_filter_results(char *path, int start, int end)
{
int startpos = start, m_index = 0, m_len = 0;
char *pp = path + startpos;
char exp[NAME_MAX] = {'\0'};
if(start >= end) {
return;
}
if(!is_res_required(pp, &m_index, &m_len)) {
//append rest of the path to the final list
if(pp == path ) {
insert(strdup(pp), true);
return;
}
pathnode *p = head;
while(p != NULL) {
char name[NAME_MAX] = {'\0'};
strcpy(name, p->ref_path);
strcat(name, pp);
insert(strdup(name), false);
p = p->next;
}
deleteList();
return;
}
// Get the string before the match
char name[NAME_MAX]={'\0'};
strncpy(name, pp, m_index);
pathnode *p = head;
if(p == NULL) {
insert(strdup(name), false);
}
while(p != NULL) {
char ref_name[NAME_MAX] = {'\0'};
sprintf(ref_name, "%s%s", p->ref_path, name);
insert(strdup(ref_name), false);
p = p->next;
}
deleteList();
startpos += m_index;
strncpy(exp, pp+m_index, m_len);
pp = path + startpos;
fill_node_path();
startpos += 2;
bulkdata_filter_results(path, startpos, end);
}
static void bulkdata_parse_results(struct list_head *list)
{
pathnode *p = head;
while(p != NULL) {
bulkdata_get_value(p->ref_path, list);
p = p->next;
}
deleteList();
}
void bulkdata_get_value_results(char *path, struct list_head *list)
{
bulkdata_filter_results(path, 0, strlen(path));
bulkdata_parse_results(list);
}
char *create_request_url(struct profile *profile)
{
int i = 0, http_uri_number = profile->profile_http_request_uri_parameter_number;
char *value, *uri_param = NULL, *uri_tmp = NULL, *http_url = NULL;
for (i = 0; i < http_uri_number; i++)
{
if((profile->profile_http_uri_parameter[i].reference == NULL) || (profile->profile_http_uri_parameter[i].name == NULL))
continue;
value = bulkdata_get_value_param(profile->profile_http_uri_parameter[i].reference);
if(!uri_param) {
asprintf(&uri_param, "&%s=%s", profile->profile_http_uri_parameter[i].name, value);
free(value);
}
else {
uri_tmp = strdup(uri_param);
free(uri_param);
asprintf(&uri_param, "%s&%s=%s", uri_tmp, profile->profile_http_uri_parameter[i].name, value);
free(value);
free(uri_tmp);
}
}
if(uri_param) {
asprintf(&http_url, "%s%s", profile->http_url, uri_param);
free(uri_param);
} else {
asprintf(&http_url, "%s", profile->http_url);
}
return http_url;
}
char *get_bulkdata_profile_parameter_name(char *paramref, char *paramname, char *param)
{
char **paramarr, *idx1 = NULL, *idx2 = NULL, *res = NULL, *instance = NULL, *tmp = NULL, *retparam = NULL, *s = NULL;
int i, j = 0;
size_t length;
if(paramname == NULL || strlen(paramname) <= 0)
return strdup(param);
paramarr = str_split(paramref, "*", &length);
res = strdup(paramname);
for(i = 0; i < length; i++) {
if(i == length - 1)
break;
j++;
idx1 = strstr(param, paramarr[i]);
idx2 = strstr(param, paramarr[i+1]);
instance = (char*)calloc(idx2 - idx1 - strlen(paramarr[i]) + 1, sizeof(char));
memcpy(instance, idx1 + strlen(paramarr[i]), idx2 - idx1 - strlen(paramarr[i]));
tmp = strdup(res);
FREE(res);
asprintf(&res, "%s.%s", tmp, instance);
FREE(tmp);
FREE(instance);
}
if ((s = strstr(param,paramarr[j]) ) != NULL && strlen(s) == strlen(paramarr[j]))
asprintf(&retparam, "%s", res);
else
asprintf(&retparam, "%s.%s", res, strstr(param, paramarr[j]) + strlen(paramarr[j]));
FREE(res);
for(int k = 0; k < length; k++)
FREE(paramarr[k]);
FREE(paramarr);
return retparam;
}
void append_string_to_string(char *strappend, char **target)
{
char *tmp = NULL;
if(strappend == NULL || strlen(strappend) <= 0)
return;
if(*target == NULL || strlen(*target) <= 0) {
*target = strdup(strappend);
return;
} else {
tmp = strdup(*target);
FREE(*target);
}
asprintf(target, "%s%s", tmp, strappend);
FREE(tmp);
}
void bulkdata_add_failed_report(struct profile *profile, char *freport)
{
struct failed_reports *report, *retreport, *rtmp;
if(profile->nbre_failed_reports < profile->nbre_of_retained_failed_reports || profile->nbre_of_retained_failed_reports < 0) {
profile->nbre_failed_reports++;
} else {
list_for_each_entry_safe(retreport, rtmp, profile->failed_reports, list) {
bulkdata_delete_failed_report(retreport);
break;
}
}
report = calloc(1, sizeof(struct failed_reports));
list_add_tail(&report->list, profile->failed_reports);
report->freport= strdup(freport);
}
void bulkdata_delete_failed_report(struct failed_reports *report)
{
if(report != NULL) {
list_del(&report->list);
FREE(report->freport);
FREE(report);
}
}
struct failed_reports* empty_failed_reports_list(struct profile *profile)
{
struct failed_reports *report, *rtmp;
if(list_empty(profile->failed_reports))
return NULL;
list_for_each_entry_safe(report, rtmp, profile->failed_reports, list) {
list_del(&report->list);
FREE(report->freport);
FREE(report);
}
return NULL;
}
void add_failed_reports_to_report_csv(struct profile *profile, char **report, int isnext)
{
struct failed_reports *retreport = NULL;
int j = 0;
if(list_empty(profile->failed_reports))
return;
list_for_each_entry(retreport, profile->failed_reports, list) {
if(!j && isnext) {
j = 1;
continue;
}
append_string_to_string(retreport->freport, report);
}
}

69
bulkdata/src/common.h Normal file
View File

@@ -0,0 +1,69 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*
*/
#ifndef __COMMON_H
#define __COMMON_H
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <regex.h>
#include <sys/param.h>
#include <libubox/blobmsg.h>
#include <libubox/blobmsg_json.h>
#include <libubox/utils.h>
#include <libubus.h>
#include <libbbfdm/dmentry.h>
#include <libbbfdm/dmbbfcommon.h>
#include "config.h"
#include "log.h"
#include "bulkdata.h"
typedef struct pathnode {
char *ref_path;
struct pathnode *next;
} pathnode;
typedef struct resultsnode {
struct list_head list;
char *name;
char *data;
char *type;
} resultsnode;
struct failed_reports {
struct list_head list;
char *freport;
};
#define GLOB_CHAR "[[+*]+"
int bulkdata_dm_ctx_init(struct dmctx *ctx);
int bulkdata_dm_ctx_clean(struct dmctx *ctx);
char *bulkdata_get_value_param(char *path);
void bulkdata_get_value(char *path, struct list_head *list);
void bulkdata_free_data_from_list(struct list_head *dup_list);
void bulkdata_get_value_results(char *path, struct list_head *list);
char *create_request_url(struct profile *profile);
char *get_bulkdata_profile_parameter_name(char *paramref, char *paramname, char *param);
void append_string_to_string(char *strappend, char **target);
void bulkdata_add_failed_report(struct profile *profile, char *freport);
void bulkdata_delete_failed_report(struct failed_reports *report);
struct failed_reports *empty_failed_reports_list(struct profile *profile);
void add_failed_reports_to_report_csv(struct profile *profile, char **report, int isnext);
#endif //__COMMON_H

524
bulkdata/src/config.c Normal file
View File

@@ -0,0 +1,524 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
* Omar Kallel <omar.kallel@pivasoftware.com>
*/
#include <stdio.h>
#include <strings.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <libbbfdm/deviceinfo.h>
#include "log.h"
#include "config.h"
#include "buci.h"
#include "common.h"
#include "bulkdata.h"
int get_log_level_config(struct bulkdata *bulkdata)
{
char *value = NULL;
buci_init();
value = buci_get_value("bulkdata", "bulkdata", "log_level");
if(value != NULL && *value != '\0')
bulkdata->log_level = atoi(value);
else
bulkdata->log_level = DEFAULT_LOGLEVEL;
bulkdata_log(SDEBUG,"Log Level of Bulkdata is : %d", bulkdata->log_level);
buci_fini();
return 0;
}
int get_amd_version_config(struct bulkdata *bulkdata)
{
char *value = NULL;
buci_init();
value = buci_get_value("cwmp", "cpe", "amd_version");
if(value != NULL && *value != '\0')
bulkdata->amd_version = atoi(value);
else
bulkdata->amd_version = DEFAULT_AMD_VERSION;
bulkdata_log(SDEBUG,"CWMP Amendment Version is : %d", bulkdata->amd_version);
buci_fini();
return 0;
}
int get_instance_mode_config(struct bulkdata *bulkdata)
{
char *value = NULL;
buci_init();
value = buci_get_value("cwmp", "cpe", "instance_mode");
if(value != NULL && *value != '\0') {
if(!strcmp(value, "InstanceNumber"))
bulkdata->instance_mode = INSTANCE_MODE_NUMBER;
else
bulkdata->instance_mode = INSTANCE_MODE_ALIAS;
}
else
bulkdata->instance_mode = DEFAULT_INSTANCE_MODE;
bulkdata_log(SDEBUG,"CWMP Instance Mode is : %d", bulkdata->instance_mode);
buci_fini();
return 0;
}
int get_device_id_config(struct bulkdata *bulkdata)
{
struct dmctx dmctx = {0};
bulkdata_dm_ctx_init(&dmctx);
bulkdata->device_id.manufacturer_oui = strdup(get_deviceid_manufactureroui());
bulkdata->device_id.product_class = strdup(get_deviceid_productclass());
bulkdata->device_id.serial_number = strdup(get_deviceid_serialnumber());
bulkdata_dm_ctx_clean(&dmctx);
return 0;
}
int load_profile_config(struct bulkdata *bulkdata, struct uci_section *s, int i)
{
char *value = NULL;
value = buci_get_value_bysection(s, "profile_id");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].profile_id = atoi(value);
value = NULL;
bulkdata_log(SDEBUG,"The profile_id of profile_id %d is : %d", i, bulkdata->profile[i].profile_id);
} else
return -1;
value = buci_get_value_bysection(s, "nbre_of_retained_failed_reports");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].nbre_of_retained_failed_reports = atoi(value);
value = NULL;
bulkdata_log(SDEBUG,"The nombre of retained failed reports of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].nbre_of_retained_failed_reports);
}
value = buci_get_value_bysection(s, "protocol");
if(value != NULL && *value != '\0' && strcasecmp(value, "http")==0) {
bulkdata->profile[i].protocol = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The protocol of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].protocol);
} else
return -1;
value = buci_get_value_bysection(s, "encoding_type");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].encoding_type = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The encoding type of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].encoding_type);
} else
return -1;
value = buci_get_value_bysection(s, "reporting_interval");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].reporting_interval = atoi(value);
value = NULL;
bulkdata_log(SDEBUG,"The reporting interval of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].reporting_interval);
} else
return -1;
value = buci_get_value_bysection(s, "time_reference");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].time_reference = atoi(value);
value = NULL;
bulkdata_log(SDEBUG,"The time reference of profile_id %d is : %ld", bulkdata->profile[i].profile_id, bulkdata->profile[i].time_reference);
} else
return -1;
value = buci_get_value_bysection(s, "csv_encoding_field_separator");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].csv_encoding_field_separator = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The csv encoding field separator of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].csv_encoding_field_separator);
} else
return -1;
value = buci_get_value_bysection(s, "csv_encoding_row_separator");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].csv_encoding_row_separator = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The csv encoding row separator of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].csv_encoding_row_separator);
} else
return -1;
value = buci_get_value_bysection(s, "csv_encoding_escape_character");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].csv_encoding_escape_character = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The csv encoding escape character of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].csv_encoding_escape_character);
}
value = buci_get_value_bysection(s, "csv_encoding_report_format");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].csv_encoding_report_format = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The csv encoding report format of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].csv_encoding_report_format);
} else
return -1;
value = buci_get_value_bysection(s, "csv_encoding_row_time_stamp");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].csv_encoding_row_time_stamp = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The csv encoding row time stamp of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].csv_encoding_row_time_stamp);
} else
return -1;
value = buci_get_value_bysection(s, "json_encoding_report_format");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].json_encoding_report_format = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The json encoding report format of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].json_encoding_report_format);
} else
return -1;
value = buci_get_value_bysection(s, "json_encoding_report_time_stamp");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].json_encoding_report_time_stamp = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The json encoding report time stamp of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].json_encoding_report_time_stamp);
} else
return -1;
value = buci_get_value_bysection(s, "http_url");
if(value != NULL && *value != '\0') {
char *url = NULL;
asprintf(&url, "%s?oui=%s&pc=%s&sn=%s", value, bulkdata->device_id.manufacturer_oui, bulkdata->device_id.serial_number, bulkdata->device_id.serial_number);
bulkdata->profile[i].http_url = strdup(url);
free(url);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP url of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_url);
} else
return -1;
value = buci_get_value_bysection(s, "http_username");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].http_username = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP username of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_username);
} else {
bulkdata->profile[i].http_username = NULL;
}
value = buci_get_value_bysection(s, "http_password");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].http_password = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP password of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_password);
} else {
bulkdata->profile[i].http_password = NULL;
}
value = buci_get_value_bysection(s, "http_compression");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].http_compression = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP compression of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_compression);
} else
return -1;
value = buci_get_value_bysection(s, "http_method");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].http_method = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP method of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_method);
} else
return -1;
value = buci_get_value_bysection(s, "http_use_date_header");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].http_use_date_header = atoi(value);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP use date header of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_use_date_header);
}
value = buci_get_value_bysection(s, "http_retry_enable");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].http_retry_enable = atoi(value);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP retry enable of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_retry_enable);
} else
return -1;
value = buci_get_value_bysection(s, "http_retry_minimum_wait_interval");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].http_retry_minimum_wait_interval = atoi(value);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP retry minimum wait interval of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_retry_minimum_wait_interval);
}
value = buci_get_value_bysection(s, "http_retry_interval_multiplier");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].http_retry_interval_multiplier = atoi(value);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP retry interval multiplier of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_retry_interval_multiplier);
}
value = buci_get_value_bysection(s, "http_persist_across_reboot");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].http_persist_across_reboot = atoi(value);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP persist across reboot of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_persist_across_reboot);
} else
return -1;
value = buci_get_value_bysection(s, "http_ssl_capath");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].http_ssl_capath = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP ssl capath of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_ssl_capath);
} else {
bulkdata->profile[i].http_ssl_capath = NULL;
}
value = buci_get_value_bysection(s, "http_insecure_enable");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].http_insecure_enable = atoi(value);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP insecure enable of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_insecure_enable);
}
bulkdata->profile[i].retry_count = 0;
bulkdata->profile[i].nbre_failed_reports = 0;
return 0;
}
int get_profiles_enable(struct bulkdata *bulkdata)
{
struct uci_section *s;
char *enable;
int i = 0, nbr_profiles = 0;
buci_init();
buci_foreach_section("bulkdata", "profile", s) {
enable = buci_get_value_bysection(s, "enable");
if(strcmp(enable, "1") == 0) {
nbr_profiles++;
}
}
if(nbr_profiles != 0)
bulkdata->profile = calloc(2, sizeof(struct profile));
buci_foreach_section("bulkdata", "profile", s) {
enable = buci_get_value_bysection(s, "enable");
if(strcmp(enable, "1") == 0) {
if(load_profile_config(bulkdata, s, i) == -1) {
bulkdata_log(SCRIT,"Not able to start bulkdata: some required bulkdata configurations in profile must be set");
return -1;
}
i++;
}
}
profiles_number = nbr_profiles;
buci_fini();
return 0;
}
int load_profile_parameter_config(struct bulkdata *bulkdata, struct uci_section *s, int i, int j)
{
char *value = NULL;
value = buci_get_value_bysection(s, "name");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].profile_parameter[j].name = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The parameter name %d of profile_id %d is : %s", j+1, bulkdata->profile[i].profile_id, bulkdata->profile[i].profile_parameter[j].name);
} else {
bulkdata->profile[i].profile_parameter[j].name = NULL;
}
value = buci_get_value_bysection(s, "reference");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].profile_parameter[j].reference = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The parameter reference %d of profile_id %d is : %s", j+1, bulkdata->profile[i].profile_id, bulkdata->profile[i].profile_parameter[j].reference);
} else
return -1;
return 0;
}
int get_profiles_parameters(struct bulkdata *bulkdata)
{
struct uci_section *s;
char *profile_id;
int i, j, nbr_profile_parameters;
buci_init();
for (i = 0; i < profiles_number; i++) {
j = 0;
nbr_profile_parameters = 0;
buci_foreach_section("bulkdata", "profile_parameter", s) {
profile_id = buci_get_value_bysection(s, "profile_id");
if(bulkdata->profile[i].profile_id != atoi(profile_id))
continue;
nbr_profile_parameters++;
if(nbr_profile_parameters == 1) {
bulkdata->profile[i].profile_parameter = calloc(1, sizeof(struct profile_parameter));
} else {
bulkdata->profile[i].profile_parameter = realloc(bulkdata->profile[i].profile_parameter, nbr_profile_parameters * sizeof(struct profile_parameter));
}
if(load_profile_parameter_config(bulkdata, s, i, j) == -1) {
bulkdata_log(SCRIT,"Not able to start bulkdata: some required bulkdata configurations in profile_parameter must be set");
return -1;
}
j++;
}
bulkdata->profile[i].profile_parameter_number = nbr_profile_parameters;
}
buci_fini();
return 0;
}
int load_profile_http_request_uri_parameter_config(struct bulkdata *bulkdata, struct uci_section *s, int i, int j)
{
char *value = NULL;
value = buci_get_value_bysection(s, "name");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].profile_http_uri_parameter[j].name = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP resuest URI parameter name %d of profile_id %d is : %s", j+1, bulkdata->profile[i].profile_id, bulkdata->profile[i].profile_http_uri_parameter[j].name);
} else
return -1;
value = buci_get_value_bysection(s, "reference");
if(value != NULL && *value != '\0') {
bulkdata->profile[i].profile_http_uri_parameter[j].reference = strdup(value);
value = NULL;
bulkdata_log(SDEBUG,"The HTTP resuest URI parameter reference %d of profile_id %d is : %s", j+1, bulkdata->profile[i].profile_id, bulkdata->profile[i].profile_http_uri_parameter[j].reference);
} else
return -1;
return 0;
}
int get_profile_http_request_uri_parameter(struct bulkdata *bulkdata)
{
struct uci_section *s;
char *profile_id;
int i, j, nbr_profile_http_request_uri_parameter;
buci_init();
for (i = 0; i < profiles_number; i++) {
j = 0;
nbr_profile_http_request_uri_parameter = 0;
buci_foreach_section("bulkdata", "profile_http_request_uri_parameter", s) {
profile_id = buci_get_value_bysection(s, "profile_id");
if(bulkdata->profile[i].profile_id != atoi(profile_id))
continue;
nbr_profile_http_request_uri_parameter++;
if(nbr_profile_http_request_uri_parameter == 1) {
bulkdata->profile[i].profile_http_uri_parameter = calloc(1, sizeof(struct profile_http_request_uri_parameter));
} else {
bulkdata->profile[i].profile_http_uri_parameter = realloc(bulkdata->profile[i].profile_http_uri_parameter, nbr_profile_http_request_uri_parameter * sizeof(struct profile_http_request_uri_parameter));
}
if(load_profile_http_request_uri_parameter_config(bulkdata, s, i, j)== -1) {
bulkdata_log(SCRIT,"Not able to start bulkdata: some required bulkdata configurations in profile_http_request_uri_parameter must be set");
return -1;
}
j++;
}
bulkdata->profile[i].profile_http_request_uri_parameter_number = nbr_profile_http_request_uri_parameter;
}
buci_fini();
return 0;
}
int bulkdata_config_init(struct bulkdata *bulkdata)
{
get_log_level_config(bulkdata);
get_amd_version_config(bulkdata);
get_instance_mode_config(bulkdata);
get_device_id_config(bulkdata);
if (get_profiles_enable(bulkdata) == -1)
return -1;
if (get_profiles_parameters(bulkdata) == -1)
return -1;
if (get_profile_http_request_uri_parameter(bulkdata) == -1)
return -1;
return 0;
}
int free_device_id_config(struct bulkdata *bulkdata)
{
FREE(bulkdata->device_id.manufacturer_oui);
FREE(bulkdata->device_id.product_class);
FREE(bulkdata->device_id.serial_number);
return 0;
}
int free_profiles_enable(struct bulkdata *bulkdata)
{
for(int i = 0; i < profiles_number; i++) {
FREE(bulkdata->profile[i].protocol);
FREE(bulkdata->profile[i].encoding_type);
FREE(bulkdata->profile[i].csv_encoding_field_separator);
FREE(bulkdata->profile[i].csv_encoding_row_separator);
FREE(bulkdata->profile[i].csv_encoding_escape_character);
FREE(bulkdata->profile[i].csv_encoding_report_format);
FREE(bulkdata->profile[i].csv_encoding_row_time_stamp);
FREE(bulkdata->profile[i].json_encoding_report_format);
FREE(bulkdata->profile[i].json_encoding_report_time_stamp);
FREE(bulkdata->profile[i].http_url);
FREE(bulkdata->profile[i].http_username);
FREE(bulkdata->profile[i].http_password);
FREE(bulkdata->profile[i].http_compression);
FREE(bulkdata->profile[i].http_method);
FREE(bulkdata->profile[i].http_ssl_capath);
}
FREE(bulkdata->profile);
return 0;
}
int free_profiles_parameters(struct bulkdata *bulkdata)
{
for(int i = 0; i < profiles_number; i++) {
for(int j = 0; j < bulkdata->profile[i].profile_parameter_number; j++) {
FREE(bulkdata->profile[i].profile_parameter[j].name);
FREE(bulkdata->profile[i].profile_parameter[j].reference);
}
FREE(bulkdata->profile[i].profile_parameter);
}
return 0;
}
int free_profile_http_request_uri_parameter(struct bulkdata *bulkdata)
{
for(int i = 0; i < profiles_number; i++) {
for(int j = 0; j < bulkdata->profile[i].profile_http_request_uri_parameter_number; j++) {
FREE(bulkdata->profile[i].profile_http_uri_parameter[j].name);
FREE(bulkdata->profile[i].profile_http_uri_parameter[j].reference);
}
FREE(bulkdata->profile[i].profile_http_uri_parameter);
}
return 0;
}
int bulkdata_config_fini(struct bulkdata *bulkdata)
{
free_device_id_config(bulkdata);
free_profiles_parameters(bulkdata);
free_profile_http_request_uri_parameter(bulkdata);
free_profiles_enable(bulkdata);
return 0;
}

103
bulkdata/src/config.h Normal file
View File

@@ -0,0 +1,103 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*
*/
#ifndef __CONFIG_H
#define __CONFIG_H
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <time.h>
#include <libubox/uloop.h>
#define DEFAULT_AMD_VERSION 2
#define DEFAULT_INSTANCE_MODE 0
typedef struct device_id {
char *manufacturer_oui;
char *product_class;
char *serial_number;
} device_id;
typedef struct profile_parameter {
int profile_id;
char *name;
char *reference;
} profile_parameter;
typedef struct profile_http_request_uri_parameter {
int profile_id;
char *name;
char *reference;
} profile_http_request_uri_parameter;
typedef struct profile {
struct uloop_timeout utimer;
int profile_id;
int nbre_of_retained_failed_reports;
int nbre_failed_reports;
int reporting_interval;
int profile_parameter_number;
int profile_http_request_uri_parameter_number;
int http_retry_minimum_wait_interval;
int http_retry_interval_multiplier;
int min_retry;
int retry_count;
char *protocol;
char *encoding_type;
char *csv_encoding_field_separator;
char *csv_encoding_row_separator;
char *csv_encoding_escape_character;
char *csv_encoding_report_format;
char *csv_encoding_row_time_stamp;
char *json_encoding_report_format;
char *json_encoding_report_time_stamp;
char *http_url;
char *http_username;
char *http_password;
char *http_compression;
char *http_method;
char *http_ssl_capath;
char *new_report;
time_t time_reference;
time_t next_retry;
time_t next_period;
bool http_persist_across_reboot;
bool http_insecure_enable;
bool enable;
bool http_use_date_header;
bool http_retry_enable;
struct profile_parameter *profile_parameter;
struct profile_http_request_uri_parameter *profile_http_uri_parameter;
struct list_head *failed_reports;
} profile;
typedef struct bulkdata {
struct device_id device_id;
struct profile *profile;
int log_level;
int amd_version;
unsigned int instance_mode;
} bulkdata;
int bulkdata_config_init(struct bulkdata *bulkdata);
int bulkdata_config_fini(struct bulkdata *bulkdata);
#ifndef FREE
#define FREE(x) do { if(x) {free(x); x = NULL;} } while (0)
#endif
#endif //__CONFIG_H

1294
bulkdata/src/datamodel.c Normal file

File diff suppressed because it is too large Load Diff

29
bulkdata/src/datamodel.h Normal file
View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2020 iopsys Software Solutions AB
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*/
#ifndef _BULKDATA_H_
#define _BULKDATA_H_
#include <libbbf_api/dmcommon.h>
extern DMOBJ tDeviceBulkDataObj[];
extern DMOBJ tBulkDataObj[];
extern DMLEAF tBulkDataParams[];
extern DMOBJ tBulkDataProfileObj[];
extern DMLEAF tBulkDataProfileParams[];
extern DMLEAF tBulkDataProfileParameterParams[];
extern DMLEAF tBulkDataProfileCSVEncodingParams[];
extern DMLEAF tBulkDataProfileJSONEncodingParams[];
extern DMOBJ tBulkDataProfileHTTPObj[];
extern DMLEAF tBulkDataProfileHTTPParams[];
extern DMLEAF tBulkDataProfileHTTPRequestURIParameterParams[];
#endif //__BULKDATA_H_

196
bulkdata/src/http.c Normal file
View File

@@ -0,0 +1,196 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
* Omar Kallel <omar.kallel@pivasoftware.com>
*/
#include "http.h"
static struct http_client http_c;
static CURL *curl;
int http_client_init(struct profile *profile)
{
char *url = create_request_url(profile);
if(url) {
asprintf(&http_c.url, "%s", url);
free(url);
}
bulkdata_log(SINFO, "ACS url: %s", http_c.url);
curl_global_init(CURL_GLOBAL_SSL);
curl = curl_easy_init();
if (!curl) return -1;
return 0;
}
void http_client_exit(void)
{
FREE(http_c.url);
if (http_c.header_list) {
curl_slist_free_all(http_c.header_list);
http_c.header_list = NULL;
}
curl_easy_cleanup(curl);
curl_global_cleanup();
}
static size_t http_get_response(void *buffer, size_t size, size_t rxed, char **msg_in)
{
char *c;
if (asprintf(&c, "%s%.*s", *msg_in, size * rxed, (char *)buffer) == -1) {
FREE(*msg_in);
return -1;
}
free(*msg_in);
*msg_in = c;
return size * rxed;
}
int http_send_message(struct profile *profile, char *msg_out, int msg_out_len, char **msg_in)
{
CURLcode res;
long http_code = 0;
char errbuf[CURL_ERROR_SIZE];
http_c.header_list = NULL;
http_c.header_list = curl_slist_append(http_c.header_list, "User-Agent: iopsys-bulkdata");
if (!http_c.header_list) return -1;
if (profile->http_use_date_header) {
if (bulkdata_get_time() != NULL) {
http_c.header_list = curl_slist_append(http_c.header_list, bulkdata_get_time());
if (!http_c.header_list) return -1;
}
}
if (strcmp(profile->encoding_type, "json") == 0) {
http_c.header_list = curl_slist_append(http_c.header_list, "Content-Type: application/json; charset=\"utf-8\"");
if (!http_c.header_list) return -1;
if(strcmp (profile->json_encoding_report_format, "objecthierarchy") == 0) {
http_c.header_list = curl_slist_append(http_c.header_list, "BBF-Report-Format: \"ObjectHierarchy\"");
if (!http_c.header_list) return -1;
} else if(strcmp(profile->json_encoding_report_format, "namevaluepair") == 0) {
http_c.header_list = curl_slist_append(http_c.header_list, "BBF-Report-Format: \"NameValuePair\"");
if (!http_c.header_list) return -1;
}
} else if(strcmp(profile->encoding_type, "csv") == 0) {
http_c.header_list = curl_slist_append(http_c.header_list, "Content-Type: text/csv; charset=\"utf-8\"");
if (!http_c.header_list) return -1;
if(strcmp (profile->csv_encoding_report_format, "row") == 0) {
http_c.header_list = curl_slist_append(http_c.header_list, "BBF-Report-Format: \"ParameterPerRow\"");
if (!http_c.header_list) return -1;
} else if(strcmp (profile->csv_encoding_report_format, "column") == 0) {
http_c.header_list = curl_slist_append(http_c.header_list, "BBF-Report-Format: \"ParameterPerColumn\"");
if (!http_c.header_list) return -1;
}
}
curl_easy_setopt(curl, CURLOPT_URL, http_c.url);
curl_easy_setopt(curl, CURLOPT_USERNAME, profile->http_username);
curl_easy_setopt(curl, CURLOPT_PASSWORD, profile->http_password);
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC|CURLAUTH_DIGEST);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, HTTP_TIMEOUT);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, HTTP_TIMEOUT);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL);
curl_easy_setopt(curl, CURLOPT_NOBODY, 0);
if(strcasecmp(profile->http_compression, "gzip") == 0) {
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "gzip");
http_c.header_list = curl_slist_append(http_c.header_list, "Content-Encoding: gzip");
} else if(strcasecmp(profile->http_compression, "compress") == 0) {
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "compress");
http_c.header_list = curl_slist_append(http_c.header_list, "Content-Encoding: compress");
} else if(strcasecmp(profile->http_compression, "deflate") == 0) {
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "deflate");
http_c.header_list = curl_slist_append(http_c.header_list, "Content-Encoding: deflate");
}
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, http_c.header_list);
if(strcasecmp(profile->http_method, "put") == 0)
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, msg_out);
if (msg_out)
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) msg_out_len);
else
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, http_get_response);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, msg_in);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
if (profile->http_ssl_capath)
curl_easy_setopt(curl, CURLOPT_CAPATH, profile->http_ssl_capath);
if (profile->http_insecure_enable) {
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
}
*msg_in = (char *) calloc (1, sizeof(char));
res = curl_easy_perform(curl);
if(res != CURLE_OK) {
size_t len = strlen(errbuf);
if(len) {
if (errbuf[len - 1] == '\n') errbuf[len - 1] = '\0';
bulkdata_log(SCRIT, "libcurl: (%d) %s", res, errbuf);
} else {
bulkdata_log(SCRIT, "libcurl: (%d) %s", res, curl_easy_strerror(res));
}
}
if (!strlen(*msg_in))
FREE(*msg_in);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code);
if(http_code == 200)
bulkdata_log(SINFO, "Receive HTTP 200 OK from Bulkdata Collector");
else if(http_code == 401)
bulkdata_log(SINFO, "Receive HTTP 401 Unauthorized from Bulkdata Collector");
else if(http_code == 204)
bulkdata_log(SINFO, "Receive HTTP 204 No Content from Bulkdata Collector");
else
bulkdata_log(SINFO, "Receive HTTP %d from Bulkdata Collector", http_code);
if(http_code == 415)
{
strcpy(profile->http_compression, "None");
goto error;
}
if (http_code != 200 && http_code != 204)
goto error;
curl_easy_reset(curl);
if (http_c.header_list) {
curl_slist_free_all(http_c.header_list);
http_c.header_list = NULL;
}
if (res) goto error;
return http_code;
error:
FREE(*msg_in);
if (http_c.header_list) {
curl_slist_free_all(http_c.header_list);
http_c.header_list = NULL;
}
return -1;
}

37
bulkdata/src/http.h Normal file
View File

@@ -0,0 +1,37 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*
*/
#ifndef __HTTP_H
#define __HTTP_H
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <curl/curl.h>
#include "config.h"
#include "log.h"
#include "times.h"
#include "common.h"
#define HTTP_TIMEOUT 30
struct http_client
{
struct curl_slist *header_list;
char *url;
};
int http_client_init(struct profile *profile);
void http_client_exit(void);
int http_send_message(struct profile *profile, char *msg_out, int msg_out_len, char **msg_in);
#endif //__HTTP_H

57
bulkdata/src/log.c Normal file
View File

@@ -0,0 +1,57 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*
*/
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <syslog.h>
#include <time.h>
#include "bulkdata.h"
#include "config.h"
#include "log.h"
static const int log_syslogmap[] = {
[SCRIT] = LOG_CRIT,
[SWARNING] = LOG_WARNING,
[SNOTICE] = LOG_NOTICE,
[SINFO] = LOG_INFO,
[SDEBUG] = LOG_DEBUG
};
static const char* log_str[] = {
[SCRIT] = "CRITICAL",
[SWARNING] = "WARNING",
[SNOTICE] = "NOTICE",
[SINFO] = "INFO",
[SDEBUG] = "DEBUG"
};
void bulkdata_log(int priority, const char *format, ...)
{
va_list vl;
if (priority <= bulkdata_main.log_level) {
time_t t = time(NULL);
struct tm tm = *localtime(&t);
va_start(vl, format);
printf("%d-%02d-%02d %02d:%02d:%02d [bulkdata] %s - ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, log_str[priority]);
vprintf(format, vl);
va_end(vl);
printf("\n");
openlog("bulkdata", 0, LOG_DAEMON);
va_start(vl, format);
vsyslog(log_syslogmap[priority], format, vl);
va_end(vl);
closelog();
}
}

28
bulkdata/src/log.h Normal file
View File

@@ -0,0 +1,28 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*
*/
#ifndef __LOG_H
#define __LOG_H
#define DEFAULT_LOGLEVEL SINFO
enum bulkdata_log_level_enum {
SCRIT,
SWARNING,
SNOTICE,
SINFO,
SDEBUG,
__MAX_SLOG
};
void bulkdata_log(int priority, const char *format, ...);
#endif //__LOG_H

336
bulkdata/src/report.c Normal file
View File

@@ -0,0 +1,336 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
* Author: Omar Kallel <omar.kallel@pivasoftware.com>
*
*/
#include "report.h"
static void add_new_json_obj(json_object *json_obj, char *name, char *data, char *type)
{
json_object *jobj;
if(strstr(type, "unsignedInt") || strstr(type, "int") || strstr(type, "long"))
jobj = json_object_new_int64(atoi(data));
else if(strstr(type, "bool"))
jobj = json_object_new_boolean(atoi(data));
else
jobj = json_object_new_string(data);
json_object_object_add(json_obj, name, jobj);
}
static void create_json_bulkdata_report_object_hierarchy(struct profile *profile, char **report)
{
struct json_object *json_obj, *json_obj1, *json_obj2;
struct resultsnode *p;
int i, j, profile_param_number = profile->profile_parameter_number;
char *param_name, *result, *pch, *pchr, *collection_time = NULL;
char buf[1024] = {0};
json_obj = json_object_new_object();
get_time_stamp(profile->json_encoding_report_time_stamp, &collection_time);
if(collection_time) {
if(strcmp(profile->json_encoding_report_time_stamp, "iso8601") == 0)
json_object_object_add(json_obj, "CollectionTime", json_object_new_string(collection_time));
else
json_object_object_add(json_obj, "CollectionTime", json_object_new_int64(atoi(collection_time)));
free(collection_time);
}
json_obj2 = json_obj;
for (i = 0; i < profile_param_number; i++) {
LIST_HEAD(results_list);
bulkdata_get_value_results(profile->profile_parameter[i].reference, &results_list);
list_for_each_entry(p, &results_list, list) {
char *argv[128] = {0};
j = 0;
param_name = get_bulkdata_profile_parameter_name(profile->profile_parameter[i].reference, profile->profile_parameter[i].name, p->name);
strcpy(buf, param_name);
for (pch = strtok_r(buf, ".", &pchr); pch != NULL; pch = strtok_r(NULL, ".", &pchr)) {
argv[j] = pch;
json_obj1 = (json_object *)dmjson_select_obj(json_obj, argv);
if (json_obj1)
json_obj2 = json_obj1;
else {
if (pchr != NULL && *pchr != '\0') {
json_object *new_obj = json_object_new_object();
json_object_object_add(json_obj2, pch, new_obj);
json_obj2 = new_obj;
}
else
add_new_json_obj(json_obj2, pch, p->data, p->type);
}
j++;
}
}
bulkdata_free_data_from_list(&results_list);
FREE(param_name);
}
result = (char *)json_object_to_json_string_ext(json_obj, JSON_C_TO_STRING_PRETTY);
*report = strdup(result);
json_object_put(json_obj);
}
static void create_json_bulkdata_report_name_value_pair(struct profile *profile, char **report)
{
struct json_object *json_obj;
struct resultsnode *p;
char *param_name, *result, *collection_time = NULL;
int i = 0, profile_param_number = profile->profile_parameter_number;
json_obj = json_object_new_object();
get_time_stamp(profile->json_encoding_report_time_stamp, &collection_time);
if(collection_time) {
if(strcmp(profile->json_encoding_report_time_stamp, "iso8601") == 0)
json_object_object_add(json_obj, "CollectionTime", json_object_new_string(collection_time));
else
json_object_object_add(json_obj, "CollectionTime", json_object_new_int64(atoi(collection_time)));
free(collection_time);
}
for (i = 0; i < profile_param_number; i++) {
LIST_HEAD(results_list);
bulkdata_get_value_results(profile->profile_parameter[i].reference, &results_list);
list_for_each_entry(p, &results_list, list) {
param_name = get_bulkdata_profile_parameter_name(profile->profile_parameter[i].reference, profile->profile_parameter[i].name, p->name);
add_new_json_obj(json_obj, param_name, p->data, p->type);
FREE(param_name);
}
bulkdata_free_data_from_list(&results_list);
}
result = (char *)json_object_to_json_string_ext(json_obj, JSON_C_TO_STRING_PRETTY);
*report = strdup(result);
json_object_put(json_obj);
}
static void add_failed_reports_to_report_json(struct profile *profile, char *new_report, char **report, int isnext)
{
json_object *json_obj, *json_array, *json_string;
struct failed_reports *retreport = NULL;
char *msgout = NULL;
int j = 0;
json_obj = json_object_new_object();
json_array = json_object_new_array();
json_object_object_add(json_obj,"Report", json_array);
if(list_empty(profile->failed_reports))
goto new_report;
list_for_each_entry(retreport, profile->failed_reports, list) {
if(!j && isnext) {
j = 1;
continue;
}
json_string = json_tokener_parse(retreport->freport);
json_object_array_add(json_array, json_string);
}
new_report :
if(new_report) {
json_string = json_tokener_parse(new_report);
json_object_array_add(json_array, json_string);
}
msgout = (char *)json_object_to_json_string_ext(json_obj, JSON_C_TO_STRING_PRETTY);
*report = strdup(msgout);
json_object_put(json_obj);
}
static void create_report_json(char *new_report, char **report)
{
json_object *json_obj, *json_array, *json_string;
char *msgout = NULL;
json_obj = json_object_new_object();
json_array = json_object_new_array();
json_object_object_add(json_obj,"Report", json_array);
if(new_report) {
json_string = json_tokener_parse(new_report);
json_object_array_add(json_array, json_string);
}
msgout = (char *)json_object_to_json_string_ext(json_obj, JSON_C_TO_STRING_PRETTY);
*report = strdup(msgout);
json_object_put(json_obj);
}
int create_json_bulkdata_report(struct profile *profile, char **report)
{
/*
* create json msg of current report
* parse failed reports list and add it to the report
* then add new report to the report
*/
char *msgout;
profile->new_report = NULL;
if(strcmp(profile->json_encoding_report_format, "objecthierarchy") == 0) {
create_json_bulkdata_report_object_hierarchy(profile, &msgout);
} else if(strcmp(profile->json_encoding_report_format, "namevaluepair") == 0) {
create_json_bulkdata_report_name_value_pair(profile, &msgout);
}
if(profile->nbre_of_retained_failed_reports != 0) {
if(profile->nbre_failed_reports >= profile->nbre_of_retained_failed_reports && profile->nbre_of_retained_failed_reports > 0)
add_failed_reports_to_report_json(profile, msgout, report, 1);
else
add_failed_reports_to_report_json(profile, msgout, report, 0);
} else {
create_report_json(msgout, report);
}
append_string_to_string(msgout, &profile->new_report);
FREE(msgout);
return 0;
}
int create_csv_bulkdata_report(struct profile *profile, char **report)
{
/*
* create csv msg of current report
* parse failed reports list and add it to the report
*/
int i;
struct resultsnode *p;
char *str1 = NULL, *str2 = NULL, *str = NULL, *paramprofilename, *timestamp = NULL, *type = NULL, rowseparator = '\0', separator = '\0';
if(strcmp(profile->csv_encoding_row_separator, "&#10;") == 0)
rowseparator = '\n';
else if(strcmp(profile->csv_encoding_row_separator, "&#13;") == 0)
rowseparator = '\r';
if(profile->csv_encoding_field_separator)
separator = profile->csv_encoding_field_separator[0];
get_time_stamp(profile->csv_encoding_row_time_stamp, &timestamp);
/*
* Create header ReportTimestamp,ParameterName,ParameterValue,ParameterType in case of ParameterPerRow
*/
if(strcmp(profile->csv_encoding_report_format, "row") == 0) {
if(timestamp == NULL)
asprintf(&str, "ParameterName%cParameterValue%cParameterType%c", separator, separator, rowseparator);
else
asprintf(&str, "ReportTimestamp%cParameterName%cParameterValue%cParameterType%c", separator, separator, separator, rowseparator);
append_string_to_string(str, report);
FREE(str);
if(profile->nbre_of_retained_failed_reports != 0) {
if(profile->nbre_failed_reports >= profile->nbre_of_retained_failed_reports && profile->nbre_of_retained_failed_reports > 0)
add_failed_reports_to_report_csv(profile, report, 1);
else
add_failed_reports_to_report_csv(profile, report, 0);
}
}
if(strcmp(profile->csv_encoding_report_format, "column") == 0 && timestamp != NULL) {
if(profile->nbre_of_retained_failed_reports != 0) {
if(profile->nbre_failed_reports >= profile->nbre_of_retained_failed_reports && profile->nbre_of_retained_failed_reports > 0)
add_failed_reports_to_report_csv(profile, report, 1);
else
add_failed_reports_to_report_csv(profile, report, 0);
}
append_string_to_string("ReportTimestamp", &str1);
append_string_to_string(timestamp, &str2);
}
/*
* Add New reports
*/
profile->new_report = NULL;
for(i = 0; i < profile->profile_parameter_number; i++) {
LIST_HEAD(results_list);
bulkdata_get_value_results(profile->profile_parameter[i].reference, &results_list);
list_for_each_entry(p, &results_list, list) {
paramprofilename = get_bulkdata_profile_parameter_name(profile->profile_parameter[i].reference, profile->profile_parameter[i].name, p->name);
if(strcmp(profile->csv_encoding_report_format, "row") == 0) {
type = strstr(p->type, ":");
if(timestamp == NULL)
asprintf(&str, "%s%c%s%c%s%c", paramprofilename, separator, p->data, separator, type+1, rowseparator);
else
asprintf(&str, "%s%c%s%c%s%c%s%c", timestamp, separator, paramprofilename, separator, p->data, separator, type+1, rowseparator);
append_string_to_string(str, report);
append_string_to_string(str, &profile->new_report);
FREE(str);
} else if(strcmp(profile->csv_encoding_report_format, "column") == 0) {
if(str1 == NULL || strlen(str1) <= 0)
asprintf(&str, "%s", paramprofilename);
else
asprintf(&str, "%c%s", separator, paramprofilename);
append_string_to_string(str, &str1);
FREE(str);
if(str2 == NULL || strlen(str2) <= 0)
asprintf(&str, "%s", p->data);
else
asprintf(&str, "%c%s", separator, p->data);
append_string_to_string(str, &str2);
FREE(str);
}
FREE(paramprofilename);
}
bulkdata_free_data_from_list(&results_list);
}
if(strcmp(profile->csv_encoding_report_format, "column") == 0) {
asprintf(&str, "%c", rowseparator);
append_string_to_string(str, &str1);
append_string_to_string(str, &str2);
append_string_to_string(str1, report);
append_string_to_string(str2, report);
append_string_to_string(str1, &profile->new_report);
append_string_to_string(str2, &profile->new_report);
}
FREE(str);
FREE(str1);
FREE(str2);
FREE(timestamp);
return 0;
}
static void create_json_failed_report(struct profile *profile, char **report)
{
add_failed_reports_to_report_json(profile, NULL, report, 0);
}
static void create_csv_failed_report(struct profile *profile, char **report)
{
char rowseparator = '\0', separator = '\0', *timestamp = NULL;
if(strcmp(profile->csv_encoding_row_separator, "&#10;") == 0) {
rowseparator = '\n';
} else if(strcmp(profile->csv_encoding_row_separator, "&#13;") == 0) {
rowseparator = '\r';
}
if(profile->csv_encoding_field_separator)
separator = profile->csv_encoding_field_separator[0];
get_time_stamp(profile->csv_encoding_row_time_stamp, &timestamp);
if(strcmp(profile->csv_encoding_report_format, "row") == 0) {
if(timestamp == NULL)
asprintf(report, "ParameterName%cParameterValue%cParameterType%c", separator, separator, rowseparator);
else
asprintf(report, "ReportTimestamp%cParameterName%cParameterValue%cParameterType%c", separator, separator, separator, rowseparator);
}
add_failed_reports_to_report_csv(profile, report, 0);
}
void create_encoding_bulkdata_report(struct profile *profile, char **report)
{
if(strcasecmp(profile->encoding_type, "json") == 0) {
create_json_bulkdata_report(profile, report);
} else if(strcasecmp(profile->encoding_type, "csv") == 0) {
create_csv_bulkdata_report(profile, report);
}
}
void create_failed_report(struct profile *profile, char **report)
{
if(strcasecmp(profile->encoding_type, "json") == 0) {
create_json_failed_report(profile, report);
} else if(strcasecmp(profile->encoding_type, "csv") == 0) {
create_csv_failed_report(profile, report);
}
}

24
bulkdata/src/report.h Normal file
View File

@@ -0,0 +1,24 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
* Author: Omar Kallel <omar.kallel@pivasoftware.com>
*
*/
#ifndef __REPORT_H_
#define __REPORT_H_
#include <json-c/json.h>
#include "common.h"
#include "times.h"
#include "config.h"
void create_encoding_bulkdata_report(struct profile *profile, char **report);
void create_failed_report(struct profile *profile, char **report);
#endif /* __REPORT_H_ */

62
bulkdata/src/times.c Normal file
View File

@@ -0,0 +1,62 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*
*/
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "times.h"
const char *bulkdata_get_time(void)
{
static char local_time[64];
time_t t_time = time(NULL);
struct tm *t_tm = localtime(&t_time);
if (t_tm == NULL)
return NULL;
if (strftime(local_time, sizeof(local_time),"Date: %a, %d %b %Y %X%z GMT", t_tm) == 0)
return NULL;
return local_time;
}
void get_time_stamp(const char *format, char **timestamp)
{
time_t now = time(NULL);
if (strcmp(format, "unix") == 0) {
asprintf(timestamp, "%ld", now);
} else if (strcmp(format, "iso8601") == 0) {
char buf[32] = {0};
struct tm *ts = localtime(&now);
strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S%Z", ts);
asprintf(timestamp, "%s", buf);
} else
timestamp = NULL;
}
unsigned int get_next_period(time_t time_reference, int reporting_interval)
{
unsigned int next_period;
time_t now = time(NULL);
if (now > time_reference)
next_period = reporting_interval - ((now - time_reference) % reporting_interval);
else
next_period = (time_reference - now) % reporting_interval;
if (next_period == 0)
next_period = reporting_interval;
return next_period;
}

19
bulkdata/src/times.h Normal file
View File

@@ -0,0 +1,19 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Copyright (C) 2020 iopsys Software Solutions AB
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*
*/
#ifndef __TIMES_H
#define __TIMES_H
const char *bulkdata_get_time(void);
void get_time_stamp(const char *format, char **timestamp);
unsigned int get_next_period(time_t time_reference, int reporting_interval);
#endif /* __TIMES_H */

53
cifsd-tools/Makefile Normal file
View File

@@ -0,0 +1,53 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=cifsd-tools
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/namjaejeon/cifsd-tools.git
PKG_SOURCE_DATE:=2019-02-14
PKG_SOURCE_VERSION:=a7d7dfc40524b88dbcb2052034a75f446b3cefdd
PKG_MIRROR_HASH:=a74f95a79c3cdcc78e66c080729141abee0d821e21a326d88b11d849738314fb
PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=autogen.sh aclocal.m4
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/cifsd-tools
SECTION:=net
CATEGORY:=Network
SUBMENU:=Filesystem
TITLE:=Kernel CIFS/SMB server support and userspace tools
DEPENDS:=+kmod-fs-cifsd +glib2 +libnl-core +libnl-genl $(ICONV_DEPENDS)
endef
define Package/cifsd-tools/description
Userspace tools (cifsd, cifsadmin) for the CIFS/SMB kernel fileserver.
The config file location is /etc/cifs/smb.conf
endef
define Package/cifsd-tools/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcifsdtools.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/etc/cifs
$(INSTALL_CONF) $(PKG_BUILD_DIR)/smb.conf.example $(1)/etc/cifs
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/cifsd.config $(1)/etc/config/cifsd
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/cifsd.init $(1)/etc/init.d/cifsd
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{cifsadmin,cifsd} $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,cifsd-tools))

View File

@@ -0,0 +1,9 @@
config global 'global'
option server_string 'CIFSD on OpenWRT'
option ipc_timeout '8' # IPC timeout is used as a workaround for uninterruptible sleep until this is fixed upstream.
config share
option name 'share'
option comment 'Default guest share'
option path '/mnt'
option guest_ok 'yes'

View File

@@ -0,0 +1,161 @@
#!/bin/sh /etc/rc.common
START=90
USE_PROCD=1
PROG=/usr/sbin/cifsd
USER_DB=/etc/cifs/cifsdpwd.db
CIFS_ADMIN=cifsadmin
EXTRA_COMMANDS="users"
EXTRA_HELP=" users Show list of users created by cifsadmin"
users() {
[ -f "$USER_DB" ] && cut -d ':' $USER_DB -f1 || \
printf "No users available.\n"
}
validate_cifsd_global() {
uci_validate_section cifsd global global \
'server_string:string' \
'workgroup:string' \
'netbios_name:string' \
'interface:string' \
'ipc_timeout:uinteger'
}
validate_cifsd_share() {
uci_validate_section cifsd share "${1}" \
'name:string' \
'comment:string' \
'path:string' \
'guest_ok:bool' \
'read_only:bool' \
'allow_hosts:list' \
'deny_hosts:list' \
'users:string' \
'invalid_users:string' \
'create_mask:string' \
'dir_mask:string' \
'max_connections:uinteger' \
'veto_files:list'
}
validate_cifsd_users() {
uci_validate_section cifsd users "${1}" \
'user:string' \
'password:string' \
'desc:string'
}
load_cifsd_global() {
local server_string
local workgroup
local netbios_name
local ipc_timeout
validate_cifsd_global
echo -e "[global]" >> /var/etc/cifsd.conf
[ -n "$server_string" ] && echo -e "\tserver string = $server_string" >> /var/etc/cifsd.conf
[ -n "$workgroup" ] && echo -e "\tworkgroup = $workgroup" >> /var/etc/cifsd.conf
[ -n "$netbios_name" ] && echo -e "\tnetbios name = $netbios_name" >> /var/etc/cifsd.conf
[ -n "$ipc_timeout" ] && echo -e "\tipc timeout name = $ipc_timeout" >> /var/etc/cifsd.conf || \
echo -e "\tipc timeout name = 8" >> /var/etc/cifsd.conf
}
load_cifsd_share() {
local name
local comment
local path
local guest_ok
local allow_hosts
local deny_hosts
local users
local invalid_users
local max_connections
local veto_files
local dir_mask
local create_mask
local read_only
validate_cifsd_share ${1}
if [ -z "$name" -o -z "$path" ]; then
logread -t ${0} "Missing name or path."
return
fi
echo -e "\n[$name]\n\tpath = $path" >> /var/etc/cifsd.conf
[ -n "$comment" ] && echo -e "\tcomment = $comment" >> /var/etc/cifsd.conf
[ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok" >> /var/etc/cifsd.conf
[ -n "$allow_hosts" ] && echo -e "\tallow hosts = $allow_hosts" >> /var/etc/cifsd.conf
[ -n "$deny_hosts" ] && echo -e "\tdeny hosts = $deny_hosts" >> /var/etc/cifsd.conf
[ -n "$users" ] && echo -e "\tvalid users = $users" >> /var/etc/cifsd.conf
[ -n "$invalid_users" ] && echo -e "\tinvalid users = $invalid_users" >> /var/etc/cifsd.conf
[ -n "$max_connections" ] && echo -e "\tmax connections = $max_connections" >> /var/etc/cifsd.conf
[ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" >> /var/etc/cifsd.conf
[ -n "$dir_mask" ] && echo -e "\tdirectory mask = $dir_mask" >> /var/etc/cifsd.conf
if [ -n "$read_only" ]; then
echo -e "\tread only = $read_only" >> /var/etc/cifsd.conf
if [ "${read_only}" -eq "0" ]; then
echo -e "\twrite ok = 1" >> /var/etc/cifsd.conf
fi
else
echo -e "\twrite ok = 1" >> /var/etc/cifsd.conf
fi
[ -n "$veto_files" ] && echo -e "\tveto files = $veto_files" >> /var/etc/cifsd.conf
}
load_cifsd_users() {
local user
local password
local desc
validate_cifsd_users ${1}
[ $(which ${CIFS_ADMIN}) ] || {
logread -t ${0} "${CIFS_ADMIN} tools is not available"
return;
}
cifsadmin -a "${user}" -p "${password}"
if [ "$?" -ne 0 ]; then
logread -t ${0} "Failed to create/update ${user}"
fi
}
service_triggers()
{
procd_add_config_trigger "config.change" "cifsd" /etc/init.d/cifsd restart
}
init_config() {
[ -f "/var/etc/cifsd.conf" ] && rm /var/etc/cifsd.conf
config_load cifsd
load_cifsd_global
# Delete existing users
[ -f "${USER_DB}" ] && {
rm -f "${USER_DB}"
}
config_foreach load_cifsd_users users
config_foreach load_cifsd_share share
}
start_service() {
. /lib/functions.sh
init_config
[ ! "$(grep cifsd /proc/modules)" ] && modprobe cifsd
procd_open_instance
procd_set_param command /usr/bin/env LANG=en_US.UTF-8 $PROG -c /var/etc/cifsd.conf
procd_set_param respawn
procd_close_instance
}
stop_service() {
killall cifsd
# IPC timeout will kill the remaining processes.
}

View File

@@ -0,0 +1,73 @@
For some reason, fs.h on Inteno kernel is missing inode->i_mutex nesting subclasses for the lock validator
which is triggering implicit declaration error. To workaround this hardcore use of mutex_lock by removing
kernel version check.
---
--- a/vfs.c
+++ b/vfs.c
@@ -544,15 +544,9 @@ int cifsd_vfs_setattr(struct cifsd_work
attrs->ia_valid |= ATTR_CTIME;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_lock(inode);
- err = notify_change(dentry, attrs, NULL);
- inode_unlock(inode);
-#else
mutex_lock(&inode->i_mutex);
err = notify_change(dentry, attrs, NULL);
mutex_unlock(&inode->i_mutex);
-#endif
if (update_size)
put_write_access(inode);
@@ -753,11 +747,8 @@ int cifsd_vfs_remove_file(char *name)
if (!dir->d_inode)
goto out;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_lock_nested(dir->d_inode, I_MUTEX_PARENT);
-#else
mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
-#endif
+
dentry = lookup_one_len(last, dir, strlen(last));
if (IS_ERR(dentry)) {
err = PTR_ERR(dentry);
@@ -783,11 +774,7 @@ int cifsd_vfs_remove_file(char *name)
dput(dentry);
out_err:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_unlock(dir->d_inode);
-#else
mutex_unlock(&dir->d_inode->i_mutex);
-#endif
out:
path_put(&parent);
return err;
@@ -1302,11 +1289,8 @@ int cifsd_vfs_unlink(struct dentry *dir,
int err = 0;
dget(dentry);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_lock(dir->d_inode);
-#else
mutex_lock(&dir->d_inode->i_mutex);
-#endif
+
if (!dentry->d_inode || !dentry->d_inode->i_nlink) {
err = -ENOENT;
goto out;
@@ -1318,11 +1302,8 @@ int cifsd_vfs_unlink(struct dentry *dir,
err = vfs_unlink(dir->d_inode, dentry, NULL);
out:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_unlock(dir->d_inode);
-#else
mutex_unlock(&dir->d_inode->i_mutex);
-#endif
+
dput(dentry);
if (err)
cifsd_debug("failed to delete, err %d\n", err);

60
cifsd/Makefile Normal file
View File

@@ -0,0 +1,60 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=cifsd
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/namjaejeon/cifsd.git
PKG_SOURCE_DATE:=2019-03-05
PKG_SOURCE_VERSION:=e1715ce125d55b125b1b58a6f1819ef8e54cc3ba
PKG_MIRROR_HASH:=521585ebfda0ecc02372b1a38ebf762fbbcead6d0b754a47599a5bf6bfdb3fb6
PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
include $(INCLUDE_DIR)/package.mk
define KernelPackage/fs-cifsd
SUBMENU:=Filesystems
TITLE:=CIFS/SMB kernel server support
FILES:=$(PKG_BUILD_DIR)/cifsd.$(LINUX_KMOD_SUFFIX)
DEPENDS+= \
+kmod-nls-base \
+kmod-nls-utf8 \
+kmod-crypto-md4 \
+kmod-crypto-md5 \
+kmod-crypto-hmac \
+kmod-crypto-ecb \
+kmod-crypto-des \
+kmod-crypto-sha256 \
+kmod-crypto-cmac \
+kmod-crypto-sha512 \
+kmod-crypto-aead \
+kmod-crypto-ccm
KCONFIG:= \
CONFIG_KEYS=y \
CONFIG_CRYPTO_ARC4=y
endef
define KernelPackage/fs-cifsd/description
Kernel module for a CIFS/SMBv2,3 fileserver.
endef
TARGET_CFLAGS+= -DCONFIG_CIFSD_ACL
MAKE_OPTS:=\
ARCH="$(LINUX_KARCH)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
M="$(PKG_BUILD_DIR)"
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \
$(MAKE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)" \
CONFIG_CIFS_SERVER=m \
modules
endef
$(eval $(call KernelPackage,fs-cifsd))

View File

@@ -0,0 +1,69 @@
--- a/vfs.c
+++ b/vfs.c
@@ -544,15 +544,9 @@ int cifsd_vfs_setattr(struct cifsd_work
attrs->ia_valid |= ATTR_CTIME;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_lock(inode);
- err = notify_change(dentry, attrs, NULL);
- inode_unlock(inode);
-#else
mutex_lock(&inode->i_mutex);
err = notify_change(dentry, attrs, NULL);
mutex_unlock(&inode->i_mutex);
-#endif
if (update_size)
put_write_access(inode);
@@ -753,11 +747,8 @@ int cifsd_vfs_remove_file(char *name)
if (!dir->d_inode)
goto out;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_lock_nested(dir->d_inode, I_MUTEX_PARENT);
-#else
mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
-#endif
+
dentry = lookup_one_len(last, dir, strlen(last));
if (IS_ERR(dentry)) {
err = PTR_ERR(dentry);
@@ -783,11 +774,7 @@ int cifsd_vfs_remove_file(char *name)
dput(dentry);
out_err:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_unlock(dir->d_inode);
-#else
mutex_unlock(&dir->d_inode->i_mutex);
-#endif
out:
path_put(&parent);
return err;
@@ -1302,11 +1289,8 @@ int cifsd_vfs_unlink(struct dentry *dir,
int err = 0;
dget(dentry);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_lock(dir->d_inode);
-#else
mutex_lock(&dir->d_inode->i_mutex);
-#endif
+
if (!dentry->d_inode || !dentry->d_inode->i_nlink) {
err = -ENOENT;
goto out;
@@ -1318,11 +1302,8 @@ int cifsd_vfs_unlink(struct dentry *dir,
err = vfs_unlink(dir->d_inode, dentry, NULL);
out:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_unlock(dir->d_inode);
-#else
mutex_unlock(&dir->d_inode->i_mutex);
-#endif
+
dput(dentry);
if (err)
cifsd_debug("failed to delete, err %d\n", err);

View File

@@ -4,16 +4,15 @@ START=99
send_log()
{
nr=$(db get hw.board.serialNumber)
hw=$(db get hw.board.hardware)
hwv=$(db get hw.board.hardwareVersion)
bid=$(db get hw.board.boardId)
nr=$(db get hw.board.serial_number)
hw=$(db get hw.board.model_name)
fam=$(db get hw.board.iopVerFam)
sw=$(db get hw.board.iopVersion)
server=$(/sbin/uci get system.crashlog.server)
while true
do
scp -S /usr/sbin/logssh /proc/last_kmsg log@${server}:log/${bid}_${hwv}_${hw}_${sw}_${nr}
scp -S /usr/sbin/logssh /proc/last_kmsg log@${server}:log/${fam}_${hw}_${sw}_${nr}
if [ $? == 0 ]
then
break;
@@ -28,7 +27,7 @@ fill_in_default()
/sbin/uci add system log
/sbin/uci rename system.@log[-1]=crashlog
/sbin/uci set system.crashlog.enable=no
/sbin/uci set system.crashlog.server="crash.inteno.se"
/sbin/uci set system.crashlog.server="crashlog.iopsys.eu"
/sbin/uci commit
}

View File

@@ -20,7 +20,7 @@ fill_in_default()
/sbin/uci add system log
/sbin/uci rename system.@log[-1]=corelog
/sbin/uci set system.corelog.enable=no
/sbin/uci set system.corelog.server="crash.inteno.se"
/sbin/uci set system.corelog.server="corelog.iopsys.eu"
/sbin/uci commit
}
@@ -50,12 +50,11 @@ cat >$TMP_CORE
# more memory to work with. normally this would do nothing.
cat >/dev/null
nr=$(db get hw.board.serialNumber)
hw=$(db get hw.board.hardware)
hwv=$(db get hw.board.hardwareVersion)
bid=$(db get hw.board.boardId)
nr=$(db get hw.board.serial_number)
hw=$(db get hw.board.model_name)
fam=$(hw.board.iopVerFam)
sw=$(db get hw.board.iopVersion)
scp -S /usr/sbin/logssh $TMP_CORE log@${server}:log/core_${1}_${2}_${bid}_${hwv}_${hw}_${sw}_${nr}
scp -S /usr/sbin/logssh $TMP_CORE log@${server}:log/core_${1}_${2}_${fam}_${hw}_${sw}_${nr}
rm $TMP_CORE

68
dectmngr/Makefile Normal file
View File

@@ -0,0 +1,68 @@
#
# Copyright (C) 2020 iopsys Software Solutions AB
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=dectmngr
PKG_RELEASE:=1
PKG_VERSION:=1.0
LOCAL_DEV=1
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=2c8990fd5275d469e8ab6c7a99e17fe0a56052ea
endif
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
RSTRIP:=true
export BUILD_DIR
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=DECT Manager
DEPENDS:= +libubox +ubus +libpicoevent
endef
define Package/$(PKG_NAME)/description
DECT manager is a daemon that provides UBUS RPC objects and sends UBUS events for communication with the DECT chip.
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -r src/* $(PKG_BUILD_DIR)/
endef
endif
MAKE_FLAGS += \
CFLAGS+="-Wall"
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/etc/dect/
$(INSTALL_DIR) $(1)/etc/config/
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/test/testout/dectmngr $(1)/usr/sbin/
$(STRIP) $(1)/usr/sbin/dectmngr
$(INSTALL_BIN) $(PKG_BUILD_DIR)/test/testout/libdect.so $(1)/usr/lib/
$(STRIP) $(1)/usr/lib/libdect.so
#$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/target.bin $(1)/etc/dect/
#$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dect $(1)/etc/init.d/
#$(CP) ./files/dect.config $(1)/etc/config/dect
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
9c5962fc5bdef309d15cf76dd2678297 out4/Images/PRODUCT_IOPSYS/DCX81_fw_c/MOD/USB/DCX81_MOD_USB.ITCM
17d4a7e4021c6089104c28c228245df2 out4/Images/PRODUCT_IOPSYS/DCX81_fw_c/MOD/USB/DCX81_MOD_USB.ITCM_L
d32e2a3dd05f4d1933eac77cfff091ba out4/Images/PRODUCT_IOPSYS/DCX81_fw_c/MOD/USB/DCX81_MOD_USB.bin
477bfa4e91914db4c0078b31a6cdf208 out4/Images/PRODUCT_IOPSYS/DCX81_fw_c/MOD/USB/DCX81_MOD_USB.BOOTLOADER.bin

View File

@@ -0,0 +1 @@
{0xee,0xb7,0x3c,0x8f,0x44,0xe1,0xad,0x87,0x53,0xc8,0x57,0x4e,0x08,0x6d,0x87,0x9f}

View File

@@ -0,0 +1,984 @@
<html>
<head>
<title>EEPROM map </title>
<style>
<!--
th {
font-size: 12px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-style: bold;
}
td {
font-size: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
body {
background-color: #FFFFFF;
}
-->
</style>
</head>
<body>
<h1>EEPROM map bsd02eep.h-GIT</h1>
<table border="2" cellspacing="2" width="100%" rules="both" align="center" style=" font-size: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
background-color: #C9FFDA;
border-collapse: collapse;
border: 5px solid white">
<tbody>
<tr style=" font-size: 12px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-style: bold;
background-color: #78FF95"><td>Name</td><td align="center">Offset</td><td>Comment</td><td width="100">Default</td></tr>
<tr><td>SD02_RESERVED1[4]</td><td align="center">0(0x0)</td><td> L4 RESERVED1 </td><td width="100"></td></tr>
<tr><td>SD02_RESERVED2[5]</td><td align="center">4(0x4)</td><td> L5 RESERVED2 </td><td width="100"></td></tr>
<tr><td>SD02_SUB_GFSK[10]</td><td align="center">9(0x9)</td><td> L10 </td><td width="100">0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,
</td></tr>
<tr><td>SD02_PREAM_NORMAL</td><td align="center">19(0x13)</td><td> L1 </td><td width="100">0x65,
</td></tr>
<tr><td>SD02_TEST_FLAGS</td><td align="center">20(0x14)</td><td> L1 If set: bit 0: BMP Driver Recover disabled
bit 1: Watchdog not enabled
bit 3: disable activity led </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_EMC_MODEL[3]</td><td align="center">21(0x15)</td><td> L3 EMC number and model, transfered in MODEL_ID IE </td><td width="100">0x0F,0xEB,0x02,
</td></tr>
<tr><td>SD02_RVREF</td><td align="center">24(0x18)</td><td> L1 </td><td width="100">0x1F,
</td></tr>
<tr><td>SD02_TEST_MODE</td><td align="center">25(0x19)</td><td> L1 Enter TBR6/10 </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_RXTUN</td><td align="center">26(0x1A)</td><td> L1 FR </td><td width="100">0x70,
</td></tr>
<tr><td>SD02_AUXBGPROG</td><td align="center">27(0x1B)</td><td> L1 AUXBGPROG (Bandgap calibration value) </td><td width="100">0x66,
</td></tr>
<tr><td>SD02_RVDDC</td><td align="center">28(0x1C)</td><td> L1 </td><td width="100">0x97,
</td></tr>
<tr><td>SD02_POWER_CONTROL</td><td align="center">29(0x1D)</td><td> L1 Power Control: nibble usage (0xsw) where s is ARM clock speed and w the number of
pflash waitstates.
Note: For ICELP, the default ARM clock
speed is 64 (96MHz and 4 wait states).
Note: For VegaOne s is used as an index to
recommended clock settings (see
VegaOne_AHB_PLLDIV[16] in file
cdr17tim.c).
For VegaOne: bit 3 is used to select if flash
running in syncrounous (asyncronous = 0
syncronous = 1)</td><td width="100">0x2,
</td></tr>
<tr><td>SD02_WDCT_HOP_CONTROL</td><td align="center">30(0x1E)</td><td> L1 </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_WDCT_QUAL_CONTROL</td><td align="center">31(0x1F)</td><td> L1 WDCT Quality Control: When the most significant bit of this byte is
set to 1, the hop sequence of 19 and frequency
substitution can be disabled.</td><td width="100">0x00,
</td></tr>
<tr><td>SD02_US_DECT</td><td align="center">32(0x20)</td><td> L1 </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_MAX_USABLE_RSSI</td><td align="center">33(0x21)</td><td> L1 </td><td width="100">0x78,
</td></tr>
<tr><td>SD02_LOWER_RSSI_LIMIT</td><td align="center">34(0x22)</td><td> L1 </td><td width="100">0x50,
</td></tr>
<tr><td>SD02_V22_VOL_HIGH</td><td align="center">35(0x23)</td><td> L1 V22 Volume Low - Sidetone </td><td width="100">0x01,
</td></tr>
<tr><td>SD02_V22_VOL_LOW</td><td align="center">36(0x24)</td><td> L1 V22 Volume High - Sidetone </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_DSP_CID_THRES</td><td align="center">37(0x25)</td><td> L1 CID Threshold</td><td width="100">0x51,
</td></tr>
<tr><td>SD02_DSP_PATCH[50]</td><td align="center">38(0x26)</td><td> L50 DSP patch area 8 entries, each defines a flexible value for 1
DSP parameter.
Structure:
1st Word: DSP instance (low, high byte)
2nd Word: offset (low, high byte)
3rd Word: value (low, high byte)</td><td width="100">0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
</td></tr>
<tr><td>SD02_ARM_PATCH[40]</td><td align="center">88(0x58)</td><td> L40: 0=unused ARM patch area (5 entries): 5 X 2 X4 Bytes to modify any 30 bit ARM
address location after protocol stack initialisation:
1st Word: address (big endian)
2nd Word: value (big endian)
The 2 MSBits of the address define the
write access type:
00: Word access (u32)
01: Halfword access (u16)
10: Byte access (u8) </td><td width="100">0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
</td></tr>
<tr><td>SD02_DSP_CLOCK</td><td align="center">128(0x80)</td><td> L1 </td><td width="100">0x02,
</td></tr>
<tr><td>SD02_FWROM_BOARDER</td><td align="center">129(0x81)</td><td> L1 </td><td width="100">0x1D,
</td></tr>
<tr><td>SD02_PORBGCFG</td><td align="center">130(0x82)</td><td> L1 PORBGCFG (POR calibration value) </td><td width="100">0xC0,
</td></tr>
<tr><td>SD02_FPTR</td><td align="center">131(0x83)</td><td> L1 MSB used to enable/disable use of this parameter 0=enable </td><td width="100">0xFF,
</td></tr>
<tr><td>SD02_FULL_POWER</td><td align="center">132(0x84)</td><td> DTPC Full Power </td><td width="100">0x7F,
</td></tr>
<tr><td>SD02_LOW_POWER</td><td align="center">133(0x85)</td><td> DTPC Low(medium) Power </td><td width="100">0xC4,
</td></tr>
<tr><td>SD02_LOWEST_POWER</td><td align="center">134(0x86)</td><td> DTPC Lowest Power</td><td width="100">0x03,
</td></tr>
<tr><td>SD02_AEC_LSP_ATTEN_RANGE[2]</td><td align="center">135(0x87)</td><td> L2 AEC_lsp_atten_range For all AEC parameters see User Manual
Vega-Family ARM DSP RELEASE V7.5
(or higher)</td><td width="100">0x00, 0x08,
</td></tr>
<tr><td>SD02_AEC_NLMS_ERL[2]</td><td align="center">137(0x89)</td><td> L2 </td><td width="100">0x40, 0x00,
</td></tr>
<tr><td>SD02_AEC_X_CLIP[2]</td><td align="center">139(0x8B)</td><td> L2 </td><td width="100">0x0F, 0x1F,
</td></tr>
<tr><td>SD02_AEC_ECHO_RATIO[2]</td><td align="center">141(0x8D)</td><td> L2 </td><td width="100">0x00, 0x01,
</td></tr>
<tr><td>SD02_AEC_DENS_GAMMA_E_HIGH[2]</td><td align="center">143(0x8F)</td><td> L2 </td><td width="100">0xCC, 0x01,
</td></tr>
<tr><td>SD02_AEC_DENS_GAMMA_E_LOW[2]</td><td align="center">145(0x91)</td><td> L2 </td><td width="100">0x80, 0x00,
</td></tr>
<tr><td>SD02_AEC_DENS_GAMMA_E_DT[2]</td><td align="center">147(0x93)</td><td> L2 </td><td width="100">0x66, 0x01,
</td></tr>
<tr><td>SD02_AEC_DENS_GAMMA_N[2]</td><td align="center">149(0x95)</td><td> L2 </td><td width="100">0x00, 0x01,
</td></tr>
<tr><td>SD02_AEC_DENS_TAIL_ALPHA[2]</td><td align="center">151(0x97)</td><td> L2 </td><td width="100">0x66, 0x66,
</td></tr>
<tr><td>SD02_AEC_DENS_TAIL_PORTION[2]</td><td align="center">153(0x99)</td><td> L2 </td><td width="100">0xD7, 0x03,
</td></tr>
<tr><td>SD02_AEC_DENS_NL_ATTEN[2]</td><td align="center">155(0x9B)</td><td> L2 </td><td width="100">0x00, 0x08,
</td></tr>
<tr><td>SD02_AEC_DENS_CNI_LEVEL[2]</td><td align="center">157(0x9D)</td><td> L2 </td><td width="100">0x00, 0x20,
</td></tr>
<tr><td>SD02_AEC_MODE[2]</td><td align="center">159(0x9F)</td><td> L2 </td><td width="100">0xF7, 0x00,
</td></tr>
<tr><td>SD02_AEC_ECHO_PATH_DELAY[2]</td><td align="center">161(0xA1)</td><td> L2 </td><td width="100">0x00, 0x00,
</td></tr>
<tr><td>SD02_DTPC_ENABLE</td><td align="center">163(0xA3)</td><td></td><td width="100">0x01,
</td></tr>
<tr><td>SD02_RSSI_TIMER</td><td align="center">164(0xA4)</td><td></td><td width="100">0x64,
</td></tr>
<tr><td>SD02_DRPC_RSSI_THRESH</td><td align="center">165(0xA5)</td><td></td><td width="100">0x80,
</td></tr>
<tr><td>SD02_DRPC_RSSI_CORRECT</td><td align="center">166(0xA6)</td><td></td><td width="100">0x1C,
</td></tr>
<tr><td>SD02_RVR2C_INIT</td><td align="center">167(0xA7)</td><td> L1 </td><td width="100">0x40,
</td></tr>
<tr><td>SD02_FI_TRIG_GPIO</td><td align="center">168(0xA8)</td><td> L1 </td><td width="100">0x0,
</td></tr>
<tr><td>SD02_RF19APU_SUPPORT_FCC</td><td align="center">169(0xA9)</td><td> L1 </td><td width="100">0x0,
</td></tr>
<tr><td>SD02_RF19APU_TC_DELAY</td><td align="center">170(0xAA)</td><td> L1 </td><td width="100">0x3,
</td></tr>
<tr><td>SD02_RF19APU_GAP_DELAY</td><td align="center">171(0xAB)</td><td> L1 </td><td width="100">0x8,
</td></tr>
<tr><td>SD02_RF19APU_GAP_DELAY_FADOFF</td><td align="center">172(0xAC)</td><td> L1 </td><td width="100">0xA,
</td></tr>
<tr><td>SD02_RF19APU_TRSSI_DELAY</td><td align="center">173(0xAD)</td><td> L1 </td><td width="100">0x25,
</td></tr>
<tr><td>SD02_RF19APU_TRSSI_DELAY_FADOFF</td><td align="center">174(0xAE)</td><td> L1 </td><td width="100">0x13,
</td></tr>
<tr><td>SD02_RF19APU_DEVIATION</td><td align="center">175(0xAF)</td><td> L1 </td><td width="100">0x13,
</td></tr>
<tr><td>SD02_RF19APU_ATEST</td><td align="center">176(0xB0)</td><td> L1 </td><td width="100">0xF,
</td></tr>
<tr><td>SD02_RF19APU_DTEST</td><td align="center">177(0xB1)</td><td> L1 </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_RF19APU_PA2_COMP</td><td align="center">178(0xB2)</td><td> L1 </td><td width="100">0x3C,
</td></tr>
<tr><td>SD02_RF19APU_PA_ON</td><td align="center">179(0xB3)</td><td> L1 </td><td width="100">0x33,
</td></tr>
<tr><td>SD02_RF19APU_GAIN</td><td align="center">180(0xB4)</td><td> L1 </td><td width="100">0x0,
</td></tr>
<tr><td>SD02_RF19APU_MLSE</td><td align="center">181(0xB5)</td><td>L1 Bit Meaning 0 MLSE active
1 Dynamic MLSE active
2 MLSE CLK Polarity
3 MLSE deviation 0 <20> 288, 1 <20> 360
4 4 bit field giving MLSE delay in bits
5 If set to 0 <20> delay defaults to 9
6 <20>
7 <20>
</td><td width="100">0x1,
</td></tr>
<tr><td>SD02_RF19APU_KCALOVR</td><td align="center">182(0xB6)</td><td>L1 </td><td width="100">0x0,
</td></tr>
<tr><td>SD02_RF19APU_KCALOVR_LINEAR</td><td align="center">183(0xB7)</td><td>L1 Linear KCAL correction, 4 LSB A factor (KCALOVR_A) 4 MSB B factor (KCALOVR_B)</td><td width="100">0x88,
</td></tr>
<tr><td>SD02_RF19APU_BEACON_LP</td><td align="center">184(0xB8)</td><td>L1 Bit0 - Enable. Bit1-7 - Value of power when HS on cradle</td><td width="100">0xC1,
</td></tr>
<tr><td>SD02_RF19APU_GENERIC_ADD1[2]</td><td align="center">185(0xB9)</td><td> L2 </td><td width="100">0x00,0x00,
</td></tr>
<tr><td>SD02_RF19APU_GENERIC_ADD2[2]</td><td align="center">187(0xBB)</td><td> L2 </td><td width="100">0x00,0x00,
</td></tr>
<tr><td>SD02_RF19APU_GENERIC_ADD3[2]</td><td align="center">189(0xBD)</td><td> L2 </td><td width="100">0x00,0x00,
</td></tr>
<tr><td>SD02_RF19APU_GENERIC_ADD4[2]</td><td align="center">191(0xBF)</td><td> L2 </td><td width="100">0x00,0x00,
</td></tr>
<tr><td>SD02_RF19APU_GENERIC_CONTROL</td><td align="center">193(0xC1)</td><td>L1 bit [1:0] = control of SD02_RF19APU_GENERIC_ADD1
bit [3:2] = control of SD02_RF19APU_GENERIC_ADD2
bit [5:4] = control of
SD02_RF19APU_GENERIC_ADD3
bit [7:6] = control of SD02_RF19APU_GENERIC_ADD4
for each of the above:
if 0 (or 3): use the appropriate register as RF indirect mapping 0~256
if 1: use the appropriate register as direct space mapping 0 <20> 104
if 2: use the appropriate register as analog indirect space mapping 0 <20> 69
</td><td width="100">0x00,
</td></tr>
<tr><td>SD02_FNR_N_LOW[2]</td><td align="center">194(0xC2)</td><td> L2 FNR SD02_FNR_N_LOW </td><td width="100">0x00,0x01,
</td></tr>
<tr><td>SD02_FNR_N_HIGH[2]</td><td align="center">196(0xC4)</td><td> L2 FNR SD02_FNR_N_HIGH </td><td width="100">0x40,0x01,
</td></tr>
<tr><td>SD02_FNR_NR_LIMIT[2]</td><td align="center">198(0xC6)</td><td> L2 FNR SD02_FNR_NR_LIMIT </td><td width="100">0x00,0x28,
</td></tr>
<tr><td>SD02_FNR_spDETCC[2]</td><td align="center">200(0xC8)</td><td> L2 FNR SD02_FNR_spDETCC </td><td width="100">0x00,0x02,
</td></tr>
<tr><td>SD02_FNR_Ton_detect[2]</td><td align="center">202(0xCA)</td><td> L2 FNR SD02_FNR_Ton_detect </td><td width="100">0x00,0x06,
</td></tr>
<tr><td>SD02_CR_OPTIONS</td><td align="center">204(0xCC)</td><td> L1 - Bit 0-1: Codec preferred (0-G726,1-G727,other reserved)
Bit 2: Action in Normal - unused
Bit 3: Action in Protected - unused
Bit 4: Opt G726 - activate improved - unused
Bit 5-6: Mode (0-Auto,1-Normal,2-Protected,3-Reserved) - not relevant in FT
Bit 7: Enable/Disable.
</td><td width="100">0x81,
</td></tr>
<tr><td>SD02_CR_SB_PATT</td><td align="center">205(0xCD)</td><td>L1 - Padding option for SB (i.e. nibble) either 4 bits or 8 bitsfor WB codecs </td><td width="100">0xFF,
</td></tr>
<tr><td>SD02_CR_FB_PATT</td><td align="center">206(0xCE)</td><td>L1 - Padding option for FB (i.e. all frame) either 4 bits or 8 bits for WB codecs </td><td width="100">0xFF,
</td></tr>
<tr><td>SD02_CR_START_MUTE_NR</td><td align="center">207(0xCF)</td><td>L1 - Number of errors to start full frame mute </td><td width="100">0x1E,
</td></tr>
<tr><td>SD02_CR_STOP_MUTE_NR</td><td align="center">208(0xD0)</td><td>L1 - Number of errors to stop full frame mute </td><td width="100">0x0F,
</td></tr>
<tr><td>SD02_CR_DECAY[2]</td><td align="center">209(0xD1)</td><td>L2 - First Byte - Decay MSB, Second byte : Decay LSB (in Q12) </td><td width="100">0x0F,
0xD4,
</td></tr>
<tr><td>SD02_CR_SATURATION</td><td align="center">211(0xD3)</td><td>L1 - Saturation value for FB filter </td><td width="100">0x28,
</td></tr>
<tr><td>SD02_CR_MSG</td><td align="center">212(0xD4)</td><td>L1 - Nr of Frames before msg mute/unmute </td><td width="100">0x1E,
</td></tr>
<tr><td>SD02_CONTROL</td><td align="center">213(0xD5)</td><td>L1 - Enable Clock Divider Selection</td><td width="100">0x00,
</td></tr>
<tr><td>SD02_CLK_DIV[3]</td><td align="center">214(0xD6)</td><td>L3 - Clock Divider Setting </td><td width="100">0x00,0x00,0x00,
</td></tr>
<tr><td>SD02_CLK_SEL[2]</td><td align="center">217(0xD9)</td><td>L2 - Clock Selection </td><td width="100">0x00,0x00,
</td></tr>
<tr><td>SD02_AHB_PLL_SETTING_LOW[4]</td><td align="center">219(0xDB)</td><td>L4 - AHB PLL LOW Setting </td><td width="100">0x00,0x00,0x00,0x00,
</td></tr>
<tr><td>SD02_AHB_PLL_SETTING_MED[4]</td><td align="center">223(0xDF)</td><td>L4 - AHB PLL MED Setting </td><td width="100">0x00,0x00,0x00,0x00,
</td></tr>
<tr><td>SD02_AHB_PLL_SETTING_HIGH[4]</td><td align="center">227(0xE3)</td><td>L4 - AHB PLL HIGH Setting </td><td width="100">0x00,0x00,0x00,0x00,
</td></tr>
<tr><td>SD02_CP_FEATURES</td><td align="center">231(0xE7)</td><td>L1 - CP features Setting </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_CP_CONFIGURATION_OFFSET</td><td align="center">232(0xE8)</td><td>Bit 0: If set, SYPO alignment is offset by 1 slot,Bit 2: Dummy Merge to first traffic</td><td width="100">0x00,
</td></tr>
<tr><td>SD02_CP_ULE_FLAGS</td><td align="center">233(0xE9)</td><td> L1 - Phase 1: 0x2, Phase 1.2: 0x6 ,Phase 2: 0xA, Phase 3: 0xE</td><td width="100">0x0A,
</td></tr>
<tr><td>SD02_DUMMY_BEARER_THRES_ADAPT_THRESH</td><td align="center">234(0xEA)</td><td></td><td width="100">0x58,
</td></tr>
<tr><td>SD02_RF19APUZ_EXT_LNA</td><td align="center">235(0xEB)</td><td>L1 - CP features Setting </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_RFIC_SELECTION</td><td align="center">236(0xEC)</td><td>L1 - CP features Setting </td><td width="100">0x01,
</td></tr>
<tr><td>SD02_UNUSED_210</td><td align="center">237(0xED)</td><td> L1 </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_PHS_SCAN_PARAM</td><td align="center">238(0xEE)</td><td> JDECT parameters: RSSI threshold for PHS detection. PHS scan every 10 seconds. </td><td width="100">0x0C,
</td></tr>
<tr><td>SD02_JDECT_LEVEL1_M82</td><td align="center">239(0xEF)</td><td> minus 82 dBm RSSI threshold for Japan regulation </td><td width="100">0x0B,
</td></tr>
<tr><td>SD02_JDECT_LEVEL2_M62</td><td align="center">240(0xF0)</td><td> minus 62 dBm RSSI threshold for Japan regulation </td><td width="100">0x11,
</td></tr>
<tr><td>SD02_JDECT_CERTAINTY_PARAM</td><td align="center">241(0xF1)</td><td> PHS detection Certainty parameters.(upper nibble reduces miss detection. lower nibble reduces false alaram) </td><td width="100">0x55,
</td></tr>
<tr><td>SD02_ULE_DUMMY_TRAF_THRESH</td><td align="center">242(0xF2)</td><td>L1 - Threshold for dummy traffic bearer merge</td><td width="100">0x03,
</td></tr>
<tr><td>SD02_PWR_ADC_INPUT</td><td align="center">243(0xF3)</td><td> L1 Input source of the Auxiliary A/D </td><td width="100">0x0E,
</td></tr>
<tr><td>SD02_PWR_POR_INPUT</td><td align="center">244(0xF4)</td><td> L1 Input source of the POR A/D </td><td width="100">0x16,
</td></tr>
<tr><td>SD02_RES_FACTOR</td><td align="center">245(0xF5)</td><td> L1 Resistor Factor on AUX input </td><td width="100">0x02,
</td></tr>
<tr><td>SD02_UART_DELAY_TIMER</td><td align="center">246(0xF6)</td><td>L1 - Selects the timer in 10 msec to delay UART</td><td width="100">0x00,
</td></tr>
<tr><td>SD02_V21_VOL_HIGH</td><td align="center">247(0xF7)</td><td>L2 SD02_V21_VOL_HIGH </td><td width="100">0x01,
</td></tr>
<tr><td>SD02_V21_VOL_LOW</td><td align="center">248(0xF8)</td><td>L2 SD02_V21_VOL_LOW </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_PRODUCTION_TEST_RSSI_THRESH_DOWNLINK</td><td align="center">249(0xF9)</td><td>L1 SD02_PRODUCTION_TEST_RSSI_THRESH_DOWNLINK </td><td width="100">0x88,
</td></tr>
<tr><td>SD02_PRODUCTION_TEST_RSSI_THRESH_UPLINK</td><td align="center">250(0xFA)</td><td>L1 SD02_PRODUCTION_TEST_RSSI_THRESH_UPLINK </td><td width="100">0x88,
</td></tr>
<tr><td>SD02_FIXED_CARRIER_OFFSET</td><td align="center">251(0xFB)</td><td>L1 SD02_FIXED_CARRIER_OFFSET - Bit(0..5) : Carrier to use ,
Bit(6) : Enable fixed PM carrier ,
Bit(7) : Seta fixed carrier [bit(0..4)] in RF file. When using this option you MUST set PP+FP with the same carrier.
</td><td width="100">0x00,
</td></tr>
<tr><td>SD02_TEMP_MEASURE_TIME</td><td align="center">252(0xFC)</td><td>L1 SD02_TEMP_MEASURE_TIME. bit 0-1 temperature measurement period for VCAL. 2 bits for 4 values 0,1,2,3 == 5,1,2,3 minutes. default value == 0
</td><td width="100">0x00,
</td></tr>
<tr><td>FNCA_DRV_UNUSED</td><td align="center">253(0xFD)</td><td> <----------- unused </td><td width="100">0xCC,</td></tr>
<tr><td>SD02_SMS_FW_VERSION[6]</td><td align="center">253(0xFD)</td><td> L6 </td><td width="100">0xCC,0x21,0x10,0x20,0x03,0xCC,
</td></tr>
<tr><td>SD02_SMS_SMTE_RESOURCES</td><td align="center">259(0x103)</td><td> L1 </td><td width="100">0x11,
</td></tr>
<tr><td>SD02_SMS_BREAK_SMS_CALL</td><td align="center">260(0x104)</td><td> L1 </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_SMS_SUBADDR_MASK[2]</td><td align="center">261(0x105)</td><td> L2 </td><td width="100">0x00,0x03,
</td></tr>
<tr><td>SD02_SMS_MIN_BYTES_FREE</td><td align="center">263(0x107)</td><td> L1 </td><td width="100">0x28,
</td></tr>
<tr><td>SD02_SMS_SMSC_OFFHOOK</td><td align="center">264(0x108)</td><td> L1 </td><td width="100">0x14,
</td></tr>
<tr><td>SD02_SMS_SMSC_ESTABLISH</td><td align="center">265(0x109)</td><td> L1 </td><td width="100">0x14,
</td></tr>
<tr><td>SD02_SMS_HACK_CODE</td><td align="center">266(0x10A)</td><td> L1 </td><td width="100">0x10,
</td></tr>
<tr><td>SD02_SMS_TIMER_T2[2]</td><td align="center">267(0x10B)</td><td> L2 </td><td width="100">0x02,0xF8,
</td></tr>
<tr><td>SD02_SMS_TIMER_T3[2]</td><td align="center">269(0x10D)</td><td> L2 </td><td width="100">0x02,0xEE,
</td></tr>
<tr><td>SD02_SMS_TIMER_T6[2]</td><td align="center">271(0x10F)</td><td> L2 </td><td width="100">0x00,0x14,
</td></tr>
<tr><td>SD02_SMS_TIMER_T10</td><td align="center">273(0x111)</td><td> L1 </td><td width="100">0x0A,
</td></tr>
<tr><td>SD02_SMS_TIMER_T10BIS</td><td align="center">274(0x112)</td><td> L1 </td><td width="100">0x35,
</td></tr>
<tr><td>SD02_SMS_FSK_FREQ0[2]</td><td align="center">275(0x113)</td><td> L2 </td><td width="100">0x00,0x15,
</td></tr>
<tr><td>SD02_SMS_FSK_FREQ1[2]</td><td align="center">277(0x115)</td><td> L2 </td><td width="100">0x00,0x0D,
</td></tr>
<tr><td>SD02_SMS_FSK_CIT_VOL[2]</td><td align="center">279(0x117)</td><td> L2 </td><td width="100">0x13,0x00,
</td></tr>
<tr><td>SD02_SMS_FSK_TIMER_PREAM</td><td align="center">281(0x119)</td><td> L1 </td><td width="100">0x0D,
</td></tr>
<tr><td>SD02_SMS_PROT_RESP_TYPE</td><td align="center">282(0x11A)</td><td> L1 </td><td width="100">0x80,
</td></tr>
<tr><td>SD02_SMS_PROT_BEARER_CAP[20]</td><td align="center">283(0x11B)</td><td> L20 </td><td width="100">0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
</td></tr>
<tr><td>SD02_SMS_PROT(k)[42]</td><td align="center">303(0x12F)</td><td> 21 * Nr_of_Protocols. Where 21 is the length of protocol. </td><td width="100">0x80,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0x80,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,
</td></tr>
<tr><td>SD02_SMS_SMSC_SETTINGS</td><td align="center">345(0x159)</td><td> L1 </td><td width="100">0x12,
</td></tr>
<tr><td>SD02_SMS_SMSC_VALIDITY_TIME</td><td align="center">346(0x15A)</td><td> L1 </td><td width="100">0x03,
</td></tr>
<tr><td>SD02_SMS_SMSC_EMAIL_SEP</td><td align="center">347(0x15B)</td><td> L1 Email Separator</td><td width="100">0x20,
</td></tr>
<tr><td>SD02_SMS_SMSC_OPERATOR</td><td align="center">348(0x15C)</td><td> L1 </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_SMS_SMSC_UNUSED[2]</td><td align="center">349(0x15D)</td><td> L2 </td><td width="100">0x00,0x00,
</td></tr>
<tr><td>SD02_SMS_SMSC_INC_NUM[8]</td><td align="center">351(0x15F)</td><td> L8 </td><td width="100">0x04,0x21,0x1F,0xFF,
0xFF,0xFF,0xFF,0xFF,
</td></tr>
<tr><td>SD02_SMS_SMSC_OUT_NUM[8]</td><td align="center">359(0x167)</td><td> L8 </td><td width="100">0x42,0x11,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
</td></tr>
<tr><td>SD02_SMS_SMSC_EMAIL_NUM[8]</td><td align="center">367(0x16F)</td><td> L8 </td><td width="100">0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
</td></tr>
<tr><td>SD02_SMS_SMSC(i)[90]</td><td align="center">375(0x177)</td><td> SMSC area end SMSC * 30. Where 30 is the length of data for one SMSC </td><td width="100">0x01,
0x03,
0x20,
0x00,
0x00,0x00,
0x01,0x93,0x01,0x0F,
0xFF,0xFF,0xFF,0xFF,
0x01,0x93,0x01,0x0F,
0xFF,0xFF,0xFF,0xFF,
0x08,0x00,0xF0,0xFF,
0xFF,0xFF,0xFF,0xFF,
0x01,
0x03,
0x20,
0x00,
0x00,0x00,
0x20,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0x20,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0x01,
0x03,
0x20,
0x05,
0x00,0x00,
0x01,0x90,0x01,0x50,
0x4F,0xFF,0xFF,0xFF,
0x01,0x90,0x01,0x50,
0x4F,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,
</td></tr>
<tr><td>SD02_ACV10_VOLUME[2]</td><td align="center">465(0x1D1)</td><td> L2 ACV10 Volume Control for SPK 2 bytes </td><td width="100">0x08,0x00,
</td></tr>
<tr><td>FNCA_SMS_UNUSED[2]</td><td align="center">467(0x1D3)</td><td> <----------- unused </td><td width="100"></td></tr>
<tr><td>SD02_CALL_BARRING[30]</td><td align="center">469(0x1D5)</td><td> L30 call barring data </td><td width="100"></td></tr>
<tr><td>SD02_MASTER_PIN[4]</td><td align="center">499(0x1F3)</td><td> L4 master mode pin code, reset value e.g. FF FF 15 90 </td><td width="100">0xFF,0xFF,0x15,0x90,
</td></tr>
<tr><td>SD02_AC[4]</td><td align="center">503(0x1F7)</td><td> L4 authentication code, e.g. FF FF 15 90</td><td width="100">0xFF,0xFF,0x00,0x00,
</td></tr>
<tr><td>SD02_RING_ON_OFF</td><td align="center">507(0x1FB)</td><td> L1 ring on/off enabled </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_ULE_AC[4]</td><td align="center">508(0x1FC)</td><td> L4 ULE authentication code, e.g. FF FF 00 00</td><td width="100">0xFF,0xFF,0x00,0x00,
</td></tr>
<tr><td>SD02_EEPROM0_END</td><td align="center">512(0x200)</td><td></td><td width="100"></td></tr>
<tr><td>SD02_BOOT_DELAY</td><td align="center">513(0x201)</td><td> L1 Boot up delay in seconds </td><td width="100"></td></tr>
<tr><td>SD02_HAN_START_FILE_0[8514]</td><td align="center">514(0x202)</td><td><a href="bhanEepromDefaults.html">HAN EEPROM Block</a> </td><td width="100"></td></tr>
<tr><td>SD02_HAN_END_FILE_0</td><td align="center">9028(0x2344)</td><td> HAN EEPROM Block End</td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_IPUI[5]</td><td align="center">9029(0x2345)</td><td> L5 Data: IPUI </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_TPUI[3]</td><td align="center">9034(0x234A)</td><td> L3 Data: TPUI </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_DCK[16]</td><td align="center">9037(0x234D)</td><td> L16 Data: DCK </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_UAK[16]</td><td align="center">9053(0x235D)</td><td> L16 Data: UAK </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_AC[4]</td><td align="center">9069(0x236D)</td><td> L4 Data: authentication code AC </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_UAK_AUTH</td><td align="center">9073(0x2371)</td><td> L1 Data: UAK authorization </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_STATUS</td><td align="center">9074(0x2372)</td><td> L1 Data: status </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_HANDSET_NR</td><td align="center">9075(0x2373)</td><td> L1 Data: handset number </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_DCK_ASSIGNED[2]</td><td align="center">9076(0x2374)</td><td> L1 Data: DCK assigned </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_FEATURES</td><td align="center">9078(0x2376)</td><td> L1 CP Features </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_DEFCK[16]</td><td align="center">9079(0x2377)</td><td> L16 Data: Default Cipher Key </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_DEFCK_ASSIGNED</td><td align="center">9095(0x2387)</td><td> L1 Data: DefCK assigned </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_CCM_CK[16]</td><td align="center">9096(0x2388)</td><td> L16 Data: CCM Key for ULE </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_DLC_OPERATING_MODE</td><td align="center">9112(0x2398)</td><td> L1 ULE DLC operating mode </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_HL_FEATURES</td><td align="center">9113(0x2399)</td><td> L1 ULE HL features </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_RESERVED[4]</td><td align="center">9114(0x239A)</td><td> L4 Reserved for future use </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_NEXT_RX_SEQUENCE_NUMBER[3]</td><td align="center">9118(0x239E)</td><td> L3 RX Sequence number </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_NEXT_TX_SEQUENCE_NUMBER[3]</td><td align="center">9121(0x23A1)</td><td> L3 TX Sequence number </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_OVER_A_FIELD_NEXT_RX_SEQUENCE_NUMBER[3]</td><td align="center">9124(0x23A4)</td><td> L3 RX Sequence number </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_OVER_A_FIELD_NEXT_TX_SEQUENCE_NUMBER</td><td align="center">9127(0x23A7)</td><td> L3 TX Sequence number </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_LEN[13978]</td><td align="center">101(0x65)</td><td> End of first subscribtion </td><td width="100"></td></tr>
<tr><td>SD02_ULE_SUB_UNUSED[5]</td><td align="center">14079(0x36FF)</td><td> <----------- unused </td><td width="100"></td></tr>
<tr><td>SD02_MD5_SIGNATURE[16]</td><td align="center">14084(0x3704)</td><td> L16 16 bytes of MD5 signature</td><td width="100"></td></tr>
<tr><td>SD02_MD5_END</td><td align="center">14100(0x3714)</td><td> L0</td><td width="100"></td></tr>
<tr><td>SD02_MD5_UNUSED</td><td align="center">14093(0x370D)</td><td> <----------- unused </td><td width="100"></td></tr>
<tr><td>FNCA_MMI_UNUSED[7]</td><td align="center">14093(0x370D)</td><td> <----------- unused </td><td width="100"></td></tr>
<tr><td>SD02_SUB_LAL</td><td align="center">14100(0x3714)</td><td> L1 </td><td width="100">0x24,
</td></tr>
<tr><td>SD02_SUB_Y</td><td align="center">14101(0x3715)</td><td> L1 </td><td width="100">0x24,
</td></tr>
<tr><td>SD02_DSP_CID_MARK_MODE</td><td align="center">14102(0x3716)</td><td> L1 DSP CID start state for mark mode - upper byte (Bits 8-15) </td><td width="100">0x40,
</td></tr>
<tr><td>SD02_DSP_CID_SEIZURE_MODE</td><td align="center">14103(0x3717)</td><td> L1 DSP CID start state for seizure mode - upper byte (Bits 8-15) </td><td width="100">0x40,
</td></tr>
<tr><td>SD02_DSP_THP2_KI[2]</td><td align="center">14104(0x3718)</td><td> L2 DSP THP2 - ki - input scaling factor - Currently unused </td><td width="100">0x10,
0x00,
</td></tr>
<tr><td>SD02_DSP_TXV[2]</td><td align="center">14106(0x371A)</td><td> L2 AUDIO TX volume control </td><td width="100">0x23,
0xBC,
</td></tr>
<tr><td>SD02_DSP_RXV[2]</td><td align="center">14108(0x371C)</td><td> L2 AUDIO RX volume control </td><td width="100">0x10,
0x00,
</td></tr>
<tr><td>SD02_DSP_RLP[2]</td><td align="center">14110(0x371E)</td><td> L2 AUDIO RLP volume control </td><td width="100">0x20,
0x00,
</td></tr>
<tr><td>SD02_AFE_AFELGC1</td><td align="center">14112(0x3720)</td><td> L1 AFE gains </td><td width="100">0x23,
</td></tr>
<tr><td>SD02_AFE_AFEMSGC1_NORMAL</td><td align="center">14113(0x3721)</td><td> L1 AFE gains normal mode </td><td width="100">0x32,
</td></tr>
<tr><td>SD02_MIN_RING_ON</td><td align="center">14114(0x3722)</td><td> min. DAEV_RING_ON </td><td width="100">2,
</td></tr>
<tr><td>SD02_MIN_RING_OFF</td><td align="center">14115(0x3723)</td><td> min. DAEV_RING_OFF </td><td width="100">3,
</td></tr>
<tr><td>SD02_MIN_DTMF_ON</td><td align="center">14116(0x3724)</td><td> min. DAEV_DTMF_ON </td><td width="100">2,
</td></tr>
<tr><td>SD02_MIN_DTMF_OFF</td><td align="center">14117(0x3725)</td><td> min. DAEV_DTMF_OFF </td><td width="100">3,
</td></tr>
<tr><td>SD02_MIN_CPDS_ON</td><td align="center">14118(0x3726)</td><td> min. DAEV_CPDS_ON </td><td width="100">2,
</td></tr>
<tr><td>SD02_MIN_CPDS_OFF</td><td align="center">14119(0x3727)</td><td> min. DAEV_CPDS_OFF </td><td width="100">2,
</td></tr>
<tr><td>SD02_MIN_CPDB_ON</td><td align="center">14120(0x3728)</td><td> min. DAEV_CPDB_ON </td><td width="100">4,
</td></tr>
<tr><td>SD02_MIN_CPDB_OFF</td><td align="center">14121(0x3729)</td><td> min. DAEV_CPDB_OFF </td><td width="100">4,
</td></tr>
<tr><td>SD02_MIN_FXD1_ON</td><td align="center">14122(0x372A)</td><td> min. DAEV_FXD1_ON </td><td width="100">3,
</td></tr>
<tr><td>SD02_MIN_FXD1_OFF</td><td align="center">14123(0x372B)</td><td> min. DAEV_FXD1_OFF </td><td width="100">1,
</td></tr>
<tr><td>SD02_MIN_FXD2_ON</td><td align="center">14124(0x372C)</td><td> min. DAEV_FXD2_ON </td><td width="100">3,
</td></tr>
<tr><td>SD02_MIN_FXD2_OFF</td><td align="center">14125(0x372D)</td><td> min. DAEV_FXD2_OFF </td><td width="100">1,
</td></tr>
<tr><td>SD02_MIN_GTD1_ON</td><td align="center">14126(0x372E)</td><td> min. DAEV_GTD1_ON </td><td width="100">3,
</td></tr>
<tr><td>SD02_MIN_GTD1_OFF</td><td align="center">14127(0x372F)</td><td> min. DAEV_GTD1_OFF </td><td width="100">1,
</td></tr>
<tr><td>SD02_MIN_CAS_ON</td><td align="center">14128(0x3730)</td><td> min. DAEV_CAS_ON </td><td width="100">2,
</td></tr>
<tr><td>SD02_MIN_CAS_OFF</td><td align="center">14129(0x3731)</td><td> min. DAEV_CAS_OFF </td><td width="100">3,
</td></tr>
<tr><td>SD02_MIN_CAS_REQUIRED</td><td align="center">14130(0x3732)</td><td> min. DAEV_CAS_REQUIRED </td><td width="100">0x60,
</td></tr>
<tr><td>SD02_DTMF_ON</td><td align="center">14131(0x3733)</td><td> min. DTMF tone on duration </td><td width="100">40,
</td></tr>
<tr><td>SD02_DTMF_OFF</td><td align="center">14132(0x3734)</td><td> min. pause after DTMF </td><td width="100">40,
</td></tr>
<tr><td>SD02_DIAL_PAUSE</td><td align="center">14133(0x3735)</td><td> min. dial pause </td><td width="100">125,
</td></tr>
<tr><td>SD02_DTMF_VOL_LOW</td><td align="center">14134(0x3736)</td><td> V6dB low DTMF frequency </td><td width="100">0x40,
</td></tr>
<tr><td>SD02_DTMF_VOL_LOW_HIGH</td><td align="center">14135(0x3737)</td><td> V6dB low DTMF frequency high </td><td width="100">0x24,
</td></tr>
<tr><td>SD02_DTMF_VOL_HIGH</td><td align="center">14136(0x3738)</td><td> V6dB high DTMF frequency </td><td width="100">0xB0,
</td></tr>
<tr><td>SD02_DTMF_VOL_HIGH_HIGH</td><td align="center">14137(0x3739)</td><td> V6dB high DTMF frequency high </td><td width="100">0x2D,
</td></tr>
<tr><td>SD02_PULSE_MAKE_LENGTH</td><td align="center">14138(0x373A)</td><td> L1 PSTN:dialPULSE </td><td width="100">40,
</td></tr>
<tr><td>SD02_PULSE_BREAK_LENGTH</td><td align="center">14139(0x373B)</td><td> L1 PSTN:dialPULSE </td><td width="100">60,
</td></tr>
<tr><td>SD02_PULSE_IDP_LENGTH</td><td align="center">14140(0x373C)</td><td> L1 PSTN:dialPULSE </td><td width="100">80,
</td></tr>
<tr><td>SD02_LCURRENT_CYCLE</td><td align="center">14141(0x373D)</td><td> L1 PSTN:PCA1070 </td><td width="100">50,
</td></tr>
<tr><td>SD02_LCURRENT_IDP</td><td align="center">14142(0x373E)</td><td> L1 PSTN:PCA1070 </td><td width="100">32,
</td></tr>
<tr><td>SD02_PAUSE_LENGTH</td><td align="center">14143(0x373F)</td><td> L1 PSTN/AUDIO:dial</td><td width="100">30,
</td></tr>
<tr><td>SD02_FLASH_LENGTH</td><td align="center">14144(0x3740)</td><td> L1 PSTN:dial </td><td width="100">10,
</td></tr>
<tr><td>SD02_EARTH_LENGTH</td><td align="center">14145(0x3741)</td><td> L1 PSTN:dial </td><td width="100">40,
</td></tr>
<tr><td>SD02_RING_MIN</td><td align="center">14146(0x3742)</td><td> L1 PSTN:ringer </td><td width="100">18,
</td></tr>
<tr><td>SD02_RING_MAX</td><td align="center">14147(0x3743)</td><td> L1 PSTN:ringer </td><td width="100">50,
</td></tr>
<tr><td>SD02_RON_DETECT</td><td align="center">14148(0x3744)</td><td> L1 PSTN:ringer </td><td width="100">9,
</td></tr>
<tr><td>SD02_RON_HOLD</td><td align="center">14149(0x3745)</td><td> L1 PSTN:ringer </td><td width="100">20,
</td></tr>
<tr><td>SD02_ROFF_DETECT</td><td align="center">14150(0x3746)</td><td> L1 PSTN:ringer </td><td width="100">11,
</td></tr>
<tr><td>SD02_ROFF_HOLD</td><td align="center">14151(0x3747)</td><td> L1 PSTN:ringer </td><td width="100">25,
</td></tr>
<tr><td>SD02_LIF_CURR_LO</td><td align="center">14152(0x3748)</td><td> L1 PSTN:l.current </td><td width="100">0,
</td></tr>
<tr><td>SD02_LIF_CURR_HI</td><td align="center">14153(0x3749)</td><td> L1 +1 </td><td width="100">0xFF,
</td></tr>
<tr><td>SD02_WETTING_TIME</td><td align="center">14154(0x374A)</td><td> L1 Wetting Pulse </td><td width="100">0x01,
</td></tr>
<tr><td>SD02_DTMF_D_TIME</td><td align="center">14155(0x374B)</td><td> L1 DTMF-D for CAS </td><td width="100">0x23,
</td></tr>
<tr><td>SD02_STUTTER_CYCLES</td><td align="center">14156(0x374C)</td><td> L1 # of Stutter </td><td width="100">0x0A,
</td></tr>
<tr><td>SD02_CID_DET_ENBL_TIME</td><td align="center">14157(0x374D)</td><td> L1 CID detection 100ms steps </td><td width="100">38,
</td></tr>
<tr><td>SD02_FSK_START_TIME</td><td align="center">14158(0x374E)</td><td> L1 CID-2 detection </td><td width="100">0xE0,
</td></tr>
<tr><td>SD02_FSK_OFFHOOK_TIME[2]</td><td align="center">14159(0x374F)</td><td> L2 CID-2 detection </td><td width="100">0xAD,
0x03,
</td></tr>
<tr><td>SD02_AFE_AFEMSGC1_HF</td><td align="center">14161(0x3751)</td><td> L1 AFE gains for Handsfree </td><td width="100">0x32,
</td></tr>
<tr><td>SD02_AFE_AFEMSGC2</td><td align="center">14162(0x3752)</td><td> L1 AFE gains </td><td width="100">0x51,
</td></tr>
<tr><td>SD02_EAR_VOL_TAB[10]</td><td align="center">14163(0x3753)</td><td> L10 10 volume values for polyphonic ringing (increasing order)</td><td width="100">0x02,0x03,0x04,0x06,0x08,
0x09,0x0A,0x0B,0x0c,0x0d,
</td></tr>
<tr><td>SD02_RVBC1C_VAL</td><td align="center">14173(0x375D)</td><td> L1 Codec 1 (In base Spk) control </td><td width="100">0xC0,
</td></tr>
<tr><td>SD02_RVBC1G_VAL</td><td align="center">14174(0x375E)</td><td> L1 Codec 1 (In base Spk) gain </td><td width="100">0x4F,
</td></tr>
<tr><td>SD02_RVBC1C_VAL_HF</td><td align="center">14175(0x375F)</td><td> L1 Codec 1 (In base Spk) control for HF</td><td width="100">0xC0,
</td></tr>
<tr><td>SD02_RVBC1G_VAL_HF</td><td align="center">14176(0x3760)</td><td> L1 Codec 1 (In base Spk) gain for HF</td><td width="100">0x4F,
</td></tr>
<tr><td>SD02_WBE_ENABLE</td><td align="center">14177(0x3761)</td><td> L1 WBE_FT Enable </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_RVDDC_FIX_ENABLE</td><td align="center">14178(0x3762)</td><td> L1 ENABLE/DISABLE Patch for RVDCDC HW bug</td><td width="100">0x00,
</td></tr>
<tr><td>SD02_INBAND_TONE_SELECT</td><td align="center">14179(0x3763)</td><td> L1 Select country for inband tone </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_DRV_UNUSED</td><td align="center">14180(0x3764)</td><td> <----------- unused </td><td width="100">0xFF,</td></tr>
<tr><td>SD02_ALLOC_LINE1[2]</td><td align="center">14180(0x3764)</td><td>handset allocation (see Protocol Interface) bitwise per handset: 1 = handset allocated;
(0xFF 0xFF indicates Collective ringing) for
each of the next 3 lines</td><td width="100">0xFF,0xFF,
</td></tr>
<tr><td>SD02_ALLOC_LINE2[2]</td><td align="center">14182(0x3766)</td><td></td><td width="100">0xFF,0xFF,
</td></tr>
<tr><td>SD02_ALLOC_LINE3[2]</td><td align="center">14184(0x3768)</td><td></td><td width="100">0xFF,0xFF,
</td></tr>
<tr><td>SD02_HS_TYPE_CATIQ30</td><td align="center">14186(0x376A)</td><td> Tells HS is CatIQ30 capable implemented for Max 8 HS only </td><td width="100">0x0,
</td></tr>
<tr><td>SD02_WB_TYPE_HSNR[2]</td><td align="center">14187(0x376B)</td><td> PT WB capability storage Note:For CAT-IQ builds user should not modify this location</td><td width="100">0,0,
</td></tr>
<tr><td>SD02_WB_LINE_TYPE</td><td align="center">14189(0x376D)</td><td> FT Line TYPE storgare(2= G711WB, 1 = WB , 0 =NB) </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_WB_LINE_SUB_TYPE</td><td align="center">14190(0x376E)</td><td> FT WB Line Sub Type ( 0 = G722 WB, 1 = G711 WB) </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_DH_MIX_RATIO</td><td align="center">14191(0x376F)</td><td></td><td width="100">0xFF,
</td></tr>
<tr><td>SD02_NEMO_PTS[2]</td><td align="center">14192(0x3770)</td><td> Two Bytes are used</td><td width="100">0xFF,0xFF,
</td></tr>
<tr><td>SD02_SPK_SLOT_TYPE</td><td align="center">14194(0x3772)</td><td> Slot type for SPK phone</td><td width="100">0x02,
</td></tr>
<tr><td>SD02_MAX_NUM_ACT_CALLS_PT</td><td align="center">14195(0x3773)</td><td> Maximum nmber of active calls of 1 PT.</td><td width="100">0x03,
</td></tr>
<tr><td>SD02_NEMO_DISABLED</td><td align="center">14196(0x3774)</td><td> bit 7 is used for permanent NEMo disable </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_HS_TYPE_CATIQ20[2]</td><td align="center">14197(0x3775)</td><td> L2: Two bytes for CAT-iq 2.0 Handset </td><td width="100">0x00,
0x00,
</td></tr>
<tr><td>SD02_FP_CUSTOM_FEATURES</td><td align="center">14199(0x3777)</td><td> Bit-0: INL 0-enable/1-disable, Bit-1: 0-conf,trfr enable/1-conf,trfr disable</td><td width="100">0x00,
</td></tr>
<tr><td>SD02_ENCRYPT_STATUS</td><td align="center">14200(0x3778)</td><td> L1: Encryption enable/disable</td><td width="100">0x01,
</td></tr>
<tr><td>SD02_MM_CAPABILITIES[10]</td><td align="center">14201(0x3779)</td><td> L10: MM Capabilities for each Handset.FTEEP_NUM_SUB/SD09_MAX_NUM_SUB is hard coded as 10 </td><td width="100">0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,
</td></tr>
<tr><td>SD02_ARBITRARY_TPUI[3]</td><td align="center">14211(0x3783)</td><td> L3 : 3 bytes to store arbitrary TPUI</td><td width="100">0x00,0x00,0x00,
</td></tr>
<tr><td>SD02_HS_TYPE_CATIQ21[2]</td><td align="center">14214(0x3786)</td><td> L2: Two bytes for CAT-iq 2.1 Handset </td><td width="100">0x00,0x00,
</td></tr>
<tr><td>SD02_INTERFERENCE_DETECTION_MEASUREMENT_INTERVAL</td><td align="center">14216(0x3788)</td><td> L1: Interference Detection Measurement Interval </td><td width="100">60,
</td></tr>
<tr><td>SD02_INTERFERENCE_DETECTION_NOISE_INTERVAL</td><td align="center">14217(0x3789)</td><td> L1: Interference Detection Noise Interval </td><td width="100">30,
</td></tr>
<tr><td>SD02_INTERFERENCE_DETECTION_CONFIG1</td><td align="center">14218(0x378A)</td><td> L1: Interference Detection config1, bit 0-7: Active Carriers Mask, carriers 1-8 </td><td width="100">0xFF,
</td></tr>
<tr><td>SD02_INTERFERENCE_DETECTION_CONFIG2</td><td align="center">14219(0x378B)</td><td> L1: Interference Detection config2, bit 0-1: Active Carriers Mask, carriers 9-10; bit7: 1-Enable/0-Disable Interference Detection alg.</td><td width="100">0x83,
</td></tr>
<tr><td>SD02_INTERFERENCE_DETECTION_TRAFFIC_SLOTS_IN_FRAME</td><td align="center">14220(0x378C)</td><td> L1: Interference Detection Traffic Slots In Frame </td><td width="100">0x03,
</td></tr>
<tr><td>SD02_INTERFERENCE_DETECTION_INTERFERENCE_LEVEL</td><td align="center">14221(0x378D)</td><td> L1: Interference Detection Interference Level </td><td width="100">0x98,
</td></tr>
<tr><td>SD02_NEMO_CONTROL</td><td align="center">14222(0x378E)</td><td> L1: MSB enables HM00_NEMO_DUMMY_USE_RSSI_FOR_IF_CHECK, others are for extending NEMO WA bearer time </td><td width="100">0x00,
</td></tr>
<tr><td>FCAC_HLP_END</td><td align="center">14223(0x378F)</td><td> </td><td width="100"></td></tr>
<tr><td>SD02_RINGER_EXPIRY</td><td align="center">14223(0x378F)</td><td> L1 FTMI:X line </td><td width="100">45,
</td></tr>
<tr><td>SD02_LINE_EXPIRY</td><td align="center">14224(0x3790)</td><td> L1 FTMI:release </td><td width="100">85,
</td></tr>
<tr><td>SD02_RINGER_MELODY</td><td align="center">14225(0x3791)</td><td> L1 FTMI:ringer </td><td width="100">9,
</td></tr>
<tr><td>SD02_RINGER_VOLUME</td><td align="center">14226(0x3792)</td><td> L1 FTMI:ringer </td><td width="100">3,
</td></tr>
<tr><td>SD02_DIAL_MODI</td><td align="center">14227(0x3793)</td><td> L1 FTMI:dtmf/reca</td><td width="100">0xD3,
</td></tr>
<tr><td>SD02_DLT_CTRL</td><td align="center">14228(0x3794)</td><td> L1 FTMI:dialTone </td><td width="100">0x3A,
</td></tr>
<tr><td>SD02_TONDET_SEL</td><td align="center">14229(0x3795)</td><td> L1 FTMI:ena/disa enable tone detection features: 0x80: DTAS
0x40: RPAS
0x41: RPASFR
0x20: MFCR</td><td width="100">0x80+0x41+0x20,
</td></tr>
<tr><td>SD02_LRMS_SUPPORT[2]</td><td align="center">14230(0x3796)</td><td> L2 FTMI:LRMS sup. 1 Bit per handset. 1 indicates LMRS support
of the according handset.</td><td width="100">0x00, 0x00,
</td></tr>
<tr><td>SD02_SMS1_PLUS_SUPPORT[2]</td><td align="center">14232(0x3798)</td><td> L2 FTMI:SMS1_PLUS sup. 1 Bit per handset. 1 indicates SMS1+ support
of the according handset.</td><td width="100">0x00, 0x00,
</td></tr>
<tr><td>SD02_COUNTRY_IDENTIFICATION</td><td align="center">14234(0x379A)</td><td> L1 FTMMS </td><td width="100">0x01,
</td></tr>
<tr><td>SD02_SMS_TP_MR</td><td align="center">14235(0x379B)</td><td> L1 FTMMS </td><td width="100">0xfd,
</td></tr>
<tr><td>SD02_DTAM_RING</td><td align="center">14236(0x379C)</td><td> DTAM: ringtones </td><td width="100">0x5,
</td></tr>
<tr><td>SD02_PREF_LINE[9]</td><td align="center">14237(0x379D)</td><td> L9 FTMI:ogo line, up to 9 </td><td width="100">0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
</td></tr>
<tr><td>SD02_PRIOR_HS[30]</td><td align="center">14246(0x37A6)</td><td> L2 FTMI:inc line, up to 3 incoming prioritized HS line 1
ring count of prior. HS line 1
incoming prioritized HS line 2
ring count of prior. HS line 2
incoming prioritized HS line 3
ring count of prior. HS line 3</td><td width="100">0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
</td></tr>
<tr><td>SD02_BLINDCALL_TIM1</td><td align="center">14276(0x37C4)</td><td> Blind call transfer timeout 1 </td><td width="100">0x1E,
</td></tr>
<tr><td>SD02_BLINDCALL_TIM2</td><td align="center">14277(0x37C5)</td><td> Blind call transfer timeout 2 </td><td width="100">0x1E,
</td></tr>
<tr><td>SD02_PARKED_TIM</td><td align="center">14278(0x37C6)</td><td> Parked line timeout </td><td width="100">0x3c,
</td></tr>
<tr><td>SD02_OVERLAP_SEND_TIM</td><td align="center">14279(0x37C7)</td><td> Overlap sending timer </td><td width="100">0x4,
</td></tr>
<tr><td>SD02_DTAM_ENABLE</td><td align="center">14280(0x37C8)</td><td> DTAM: ON/OFF </td><td width="100">0x1,
</td></tr>
<tr><td>SD02_DTAM_ICM_CR</td><td align="center">14281(0x37C9)</td><td> DTAM: codRates ICM </td><td width="100">0xFF,
</td></tr>
<tr><td>SD02_DTAM_OGM_CR</td><td align="center">14282(0x37CA)</td><td> DTAM: codRates OGM </td><td width="100">0xFF,
</td></tr>
<tr><td>SD02_DTAM_PILL_CR</td><td align="center">14283(0x37CB)</td><td> DTAM: codRates Pill</td><td width="100">0xFF,
</td></tr>
<tr><td>SD02_EARVOL</td><td align="center">14284(0x37CC)</td><td> EAR Vol </td><td width="100">0x05,
</td></tr>
<tr><td>SD02_BS_CALL_SCREENING</td><td align="center">14285(0x37CD)</td><td> L1 Call Screening Enable/disable</td><td width="100">0x00,
</td></tr>
<tr><td>SD02_EMC_COMPLIANT[2]</td><td align="center">14286(0x37CE)</td><td> L2 stores the compliant of PT's i.e. whether EMC is equal </td><td width="100">0x00, 0x00,
</td></tr>
<tr><td>SD02_LU10_RN_UPDATE</td><td align="center">14288(0x37D0)</td><td> L1 Enable/disable update RN=SN+1 </td><td width="100">0x05,
</td></tr>
<tr><td>SD02_MMI_DECT_SECURITY</td><td align="center">14289(0x37D1)</td><td> L1 DECT SECURITY LEVEL </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_CR_PREFERRED_CODEC</td><td align="center">14290(0x37D2)</td><td> L1 holds the preferred codec for CR </td><td width="100">0x01,
</td></tr>
<tr><td>SD02_PAD_OPT_NORMAL</td><td align="center">14291(0x37D3)</td><td> L1 holds the Normal action for CR: 0- nothing 1 - Mute</td><td width="100">0x00,
</td></tr>
<tr><td>SD02_PAD_OPT_PROTECTED</td><td align="center">14292(0x37D4)</td><td> L1 holds the Protected action for CR: 0- nothing 1 - Mute</td><td width="100">0x00,
</td></tr>
<tr><td>SD02_CR_ACTION_ADPCM</td><td align="center">14293(0x37D5)</td><td> L1 holds the ADPCM action for 0- nothing 1 - Improved</td><td width="100">0x00,
</td></tr>
<tr><td>SD02_CLEARANGE_ENABLE</td><td align="center">14294(0x37D6)</td><td> L1 Enable CR feature </td><td width="100">0x01,
</td></tr>
<tr><td>SD02_REPEATER_TYPE</td><td align="center">14295(0x37D7)</td><td> L1 Hold the Repeater Type GAP,CAT-iq.NEMO </td><td width="100">0x00,
</td></tr>
<tr><td>SD02_ULE_MULTICAST_ENC_PARAMS[53]</td><td align="center">14296(0x37D8)</td><td> L48 ULE Multicast enc. parameter: 2x (CCM key, sequence number, Multicast ID) </td><td width="100">0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,
0xFF,
0x0,
0x0,
0x0, 0x00,
</td></tr>
<tr><td>SD02_DECT_SETTINGS_OFFSET</td><td align="center">14349(0x380D)</td><td> DECT settings List Offset </td><td width="100"></td></tr>
<tr><td>SD02_DSSL_CLOCK_MASTER</td><td align="center">14349(0x380D)</td><td> L1 </td><td width="100"></td></tr>
<tr><td>SD02_DSSL_BASE_RESET</td><td align="center">14350(0x380E)</td><td> L1 </td><td width="100"></td></tr>
<tr><td>SD02_DSSL_FW_VERSION[38]</td><td align="center">14351(0x380F)</td><td> L8 </td><td width="100"></td></tr>
<tr><td>SD02_DSSL_EEP_VERSION[38]</td><td align="center">14389(0x3835)</td><td> L8 </td><td width="100"></td></tr>
<tr><td>SD02_DSSL_HW_VERSION[38]</td><td align="center">14427(0x385B)</td><td> L8 </td><td width="100"></td></tr>
<tr><td>SD02_DSSL_NEW_PIN[4]</td><td align="center">14465(0x3881)</td><td> L4 </td><td width="100"></td></tr>
<tr><td>SD02_DSSL_EMISSION_MODE</td><td align="center">14469(0x3885)</td><td> L1 </td><td width="100"></td></tr>
<tr><td>SD02_DSSL_IP_TYPE</td><td align="center">14470(0x3886)</td><td> L1 </td><td width="100"></td></tr>
<tr><td>SD02_DSSL_IP_VALUE[17]</td><td align="center">14471(0x3887)</td><td> L17 </td><td width="100"></td></tr>
<tr><td>SD02_DSSL_IP_SUBNET_MASK[17]</td><td align="center">14488(0x3898)</td><td> L17 </td><td width="100"></td></tr>
<tr><td>SD02_DSSL_IP_GATEWAY[17]</td><td align="center">14505(0x38A9)</td><td> L17 </td><td width="100"></td></tr>
<tr><td>SD02_DSSL_IP_DNS_SERVER[17]</td><td align="center">14522(0x38BA)</td><td> L17 </td><td width="100"></td></tr>
<tr><td>SD02_DSSL_FP_POWER_LEVEL</td><td align="center">14539(0x38CB)</td><td> L1 </td><td width="100"></td></tr>
<tr><td>SD02_LINE_SETTINGS_OFFSET[75]</td><td align="center">14540(0x38CC)</td><td> Line Settings List Offset </td><td width="100"></td></tr>
<tr><td>SD02_INL_DATA_OFFSET[375]</td><td align="center">14615(0x3917)</td><td> Internal Name List Offset </td><td width="100"></td></tr>
<tr><td>SD02_SUPTD_LIST_OFFSET[22]</td><td align="center">14990(0x3A8E)</td><td> Supported List Offset</td><td width="100"></td></tr>
<tr><td>SD02_BSNAME_LEN</td><td align="center">15012(0x3AA4)</td><td> L1 </td><td width="100"></td></tr>
<tr><td>SD02_BSNAME[19]</td><td align="center">15013(0x3AA5)</td><td> L13 Bytes of data MAX </td><td width="100"></td></tr>
<tr><td>SD02_SUB_IPUI[5]</td><td align="center">15032(0x3AB8)</td><td> L5 Data: IPUI </td><td width="100"></td></tr>
<tr><td>SD02_SUB_TPUI[3]</td><td align="center">15037(0x3ABD)</td><td> L3 Data: TPUI </td><td width="100"></td></tr>
<tr><td>SD02_SUB_DCK[16]</td><td align="center">15040(0x3AC0)</td><td> L16 Data: DCK </td><td width="100"></td></tr>
<tr><td>SD02_SUB_UAK[16]</td><td align="center">15056(0x3AD0)</td><td> L16 Data: UAK </td><td width="100"></td></tr>
<tr><td>SD02_SUB_AC[4]</td><td align="center">15072(0x3AE0)</td><td> L4 Data: authentication code AC </td><td width="100"></td></tr>
<tr><td>SD02_SUB_UAK_AUTH</td><td align="center">15076(0x3AE4)</td><td> L1 Data: UAK authorization </td><td width="100"></td></tr>
<tr><td>SD02_SUB_STATUS</td><td align="center">15077(0x3AE5)</td><td> L1 Data: status </td><td width="100"></td></tr>
<tr><td>SD02_SUB_HANDSET_NR</td><td align="center">15078(0x3AE6)</td><td> L1 Data: handset number </td><td width="100"></td></tr>
<tr><td>SD02_SUB_DCK_ASSIGNED</td><td align="center">15079(0x3AE7)</td><td> L1 Data: DCK assigned </td><td width="100"></td></tr>
<tr><td>SD02_SUB_CK_LEN</td><td align="center">15080(0x3AE8)</td><td> L1 Data: Cipher Key Length </td><td width="100"></td></tr>
<tr><td>SD02_SUB_FEATURES</td><td align="center">15081(0x3AE9)</td><td> L1 Data: Handset ULE feature support </td><td width="100"></td></tr>
<tr><td>SD02_SUB_LEN[15032]</td><td align="center">50(0x32)</td><td> End of first subscribtion </td><td width="100"></td></tr>
<tr><td>FNCA_SUB(i)[250]</td><td align="center">15082(0x3AEA)</td><td> This place is reserved for the rest of the HS and includes all perameters:SD02_SUB_IPUI-SD02_SUB_DCK_ASSIGNED (40Byte x Number of handsets)</td><td width="100"></td></tr>
<tr><td>SD02_SUB_UNUSED[6]</td><td align="center">15332(0x3BE4)</td><td> <----------- unused </td><td width="100"></td></tr>
<tr><td>SD02_SUB_EX_DEFCK[16]</td><td align="center">15338(0x3BEA)</td><td> L16 Data: Default Cipher Key </td><td width="100"></td></tr>
<tr><td>SD02_SUB_EX_DEFCK_ASSIGNED</td><td align="center">15354(0x3BFA)</td><td> L1 Data: DefCK assigned </td><td width="100"></td></tr>
<tr><td>SD02_SUB_EX_LEN[15338]</td><td align="center">17(0x11)</td><td> End of first subscribtion </td><td width="100"></td></tr>
<tr><td>FNCA_SUB_EX(i)[85]</td><td align="center">15355(0x3BFB)</td><td> This place is reserved for the rest of the HS and includes all perameters:SD02_SUB_IPUI-SD02_SUB_DCK_ASSIGNED (40Byte x Number of handsets)</td><td width="100"></td></tr>
<tr><td>SD02_SUB_EX_UNUSED[4]</td><td align="center">15440(0x3C50)</td><td> <----------- unused </td><td width="100"></td></tr>
<tr><td>SD02_SUB_RFPI</td><td align="center">15444(0x3C54)</td><td> L5 RFPI </td><td width="100"></td></tr>
</tbody>
</table>
<h3>EEPROM SIZE = 32768</h3>
<h6>*All non exists values on default are zero upon EEPROM reset</h6>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
#!/bin/sh
SOUND_BASE=/lib/modules/$(uname -r)/kernel/sound
SOUND_MODULES="$SOUND_BASE/soundcore.ko $SOUND_BASE/core/snd.ko $SOUND_BASE/core/snd-timer.ko"
SOUND_MODULES="$SOUND_MODULES $SOUND_BASE/core/snd-pcm.ko $SOUND_BASE/core/snd-hwdep.ko"
SOUND_MODULES="$SOUND_MODULES $SOUND_BASE/core/seq/snd-seq-device.ko"
SOUND_MODULES="$SOUND_MODULES $SOUND_BASE/core/seq/snd-seq.ko $SOUND_BASE/core/snd-rawmidi.ko "
SOUND_MODULES="$SOUND_MODULES $SOUND_BASE/usb/snd-usbmidi-lib.ko $SOUND_BASE/usb/snd-usb-audio.ko"
load_sound_modules() {
for mod in $SOUND_MODULES; do
insmod $mod
done
}
unload_sound_modules() {
local modules=
# reverse the order
for mod in $SOUND_MODULES; do
modules="$mod $modules"
done
for mod in $modules; do
rmmod $mod
done
}

308
dectmngr/src/LICENSE Normal file
View File

@@ -0,0 +1,308 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
dspg_test_app - DSPG CMBS Host Software Test Application
Copyright (C) 2020 iopsys Software Solutions AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

6
dectmngr/src/Makefile Normal file
View File

@@ -0,0 +1,6 @@
.PHONY: dspg_test_app
dspg_test_app:
$(MAKE) -C test

42
dectmngr/src/cmbs/cmbs.mak Executable file
View File

@@ -0,0 +1,42 @@
ifdef CMBSDIR
CMBSBASE:=$(CMBSDIR)/cmbs
includes += -I$(CMBSDIR)/include
else
CMBSBASE:=$(PROJDIR)/cmbs
endif
includes += -I$(CMBSBASE)
cmbs_objects:=
####################################################################
# settle includes
#includes += -I$(FRAMEBASE) -I$(FRAMEBASE)/vone
####################################################################
# settle objects
ifdef CMBS_HOST
OBJ_EXT = o
else
OBJ_EXT = otwi
endif
cmbs_objects += $(OBJDIR)/cmbs_int.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_api.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_dcm.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_dsr.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_dee.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_dem.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_ie.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_cmd.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_suota.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_rtp.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_util.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_fifo.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_dbg.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_han.$(OBJ_EXT)
cmbs_objects += $(OBJDIR)/cmbs_han_ie.$(OBJ_EXT)
####################################################################
# settle vpath
vpath %.c $(CMBSBASE)

118
dectmngr/src/cmbs/cmbs_api.c Executable file
View File

@@ -0,0 +1,118 @@
/*!
* \file cmbs_api.c
* \brief API Maintenance functions
* \Author CMBS Team
*
* @(#) %filespec: cmbs_api.c~DMZD53#7 %
*
*******************************************************************************/
#include <string.h>
#include "cmbs_int.h"
#define TARGET_ANSWER_TIMEOUT 10000
ST_CB_LOG_BUFFER g_LogBufferCb;
#ifdef __linux
extern void _cmbs_int_MsgQDestroy(int nMsgQId);
extern int _cmbs_int_MsgQCreate(void);
#endif
/*****************************************************************************
* API Maintenance functions
*****************************************************************************/
PST_CB_LOG_BUFFER cmbs_api_get_LogBufferCb(void)
{
return &g_LogBufferCb;
}
E_CMBS_RC cmbs_api_Init( E_CMBS_API_MODE e_Mode, ST_CMBS_DEV * pst_DevCtl, ST_CMBS_DEV * pst_DevMedia )
{
#if !defined ( CMBS_API_TARGET )
E_CMBS_RC ReturnCode;
#endif
// initialize host environment
if(cmbs_int_EnvCreate( e_Mode, pst_DevCtl, pst_DevMedia ) != CMBS_RC_OK)
return CMBS_RC_ERROR_GENERAL;
memcpy(&g_CMBSInstance.st_ApplSlot.pFnCbLogBuffer, cmbs_api_get_LogBufferCb(), sizeof(ST_CB_LOG_BUFFER));
#if !defined ( CMBS_API_TARGET )
// establish communication with the module
cmbs_int_SendHello(pst_DevCtl, pst_DevMedia);
// wait for target answer
ReturnCode = cmbs_int_WaitForResponse(TARGET_ANSWER_TIMEOUT);
if (ReturnCode == CMBS_RC_OK)
{
if (g_CMBSInstance.u16_TargetVersion != 0x0001)
{
// try to get Target capabilities (if no response, it means target does not support this message)
cmbs_int_cmd_SendCapablities();
cmbs_int_WaitForResponse(TARGET_ANSWER_TIMEOUT);
}
}
return ReturnCode;
#else
return CMBS_RC_OK;
#endif
}
void cmbs_api_UnInit( void )
{
cmbs_int_EnvDestroy();
}
void* cmbs_api_RegisterCb( void * pv_AppRef, PFN_CMBS_API_CB pfn_api_Cb, u16 u16_bcdVersion )
{
return cmbs_int_RegisterCb( pv_AppRef, pfn_api_Cb, u16_bcdVersion );
}
void cmbs_api_UnregisterCb( void * pv_AppRefHandle )
{
cmbs_int_UnregisterCb( pv_AppRefHandle );
}
u16 cmbs_api_ModuleVersionGet( void )
{
return cmbs_int_ModuleVersionGet();
}
u16 cmbs_api_ModuleVersionBuildGet( void )
{
return cmbs_int_ModuleVersionBuildGet();
}
#ifdef __linux
void cmbs_api_MsgQDestroy(int nMsgQId)
{
_cmbs_int_MsgQDestroy(nMsgQId);
}
int cmbs_api_MsgQCreate(void)
{
return _cmbs_int_MsgQCreate();
}
#elif WIN32
void cmbs_api_MsgQDestroy(PST_ICOM_ENTRY pMsgQId)
{
cfr_MQueueDestroy ( pMsgQId);
}
PST_ICOM_ENTRY cmbs_api_MsgQCreate(u32 u32_ThreadID, u32 u32_Timeout)
{
return cfr_MQueueCreate(u32_ThreadID, u32_Timeout);
}
#endif
void cmbs_api_RegisterLogBufferCb(void* pv_AppRef, PST_CB_LOG_BUFFER pfn_log_buffer_Cb)
{
cmbs_int_RegisterLogBufferCb(pv_AppRef, pfn_log_buffer_Cb);
}
#if !defined( CMBS_API_TARGET )
void cmbs_api_ParseDectMsg(u8 * buff, u8 u8_ILen, u8 u8_HandsetNumber)
{
cmbs_int_ParseDectMsg(buff, u8_ILen, u8_HandsetNumber);
}
#endif //#if !defined( CMBS_API_TARGET )
//*/

13800
dectmngr/src/cmbs/cmbs_api.h Executable file

File diff suppressed because it is too large Load Diff

769
dectmngr/src/cmbs/cmbs_cmd.c Executable file
View File

@@ -0,0 +1,769 @@
/*!
* \file cmbs_cmd.c
* \brief Implementation of the CMBS internal command protocol
* \Author kelbch
*
* @(#) %filespec: cmbs_cmd.c~DMZD53#16 %
*
*******************************************************************************
* \par History
* \n==== History ============================================================\n
* date name version action \n
* ----------------------------------------------------------------------------\n
* 13-Jan-2014 tcmc_asa -- GIT-- take checksum changes from 3.46.x to 3_x main (3.5x)
* 20-Dec-13 tcmc_asa GIT Added CHECKSUM_SUPPORT
* 16-Feb-09 Kelbch 1 Initialize \n
* 18-Feb-09 Kelbch 2 Update Version information on Hello Reply \n
* 18-Feb-09 Kelbch 3 Adapted Version information on Hello Reply \n
* 19-Feb-09 Kelbch 4 Extend hello-reply procedure to block conditions\n
* 19-Feb-09 Kelbch 5 Add flow control commands\n
* 09-Apr-09 Kelbch 161 Update of Media Configuration during start-up \n
*******************************************************************************/
#if defined(__arm)
#include "tclib.h"
#include "embedded.h"
#include <stdio.h>
#include "bsd09cnf.h" /* component-globalal, system configuration */
#include "bsd09ddl.h" /* messages and processes */
#include "bsd02eep.h"
#include "cdr03eep.h"
#else
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#endif
#include "cmbs_int.h" // CMBS internal API structure and defines
#include "cfr_debug.h" // CMBS debug definition
ST_CAPABLITIES g_st_CMBSCapabilities;
#if defined ( CMBS_API_TARGET )
#include "cfr_uart.h"
#include "tapp.h"
#include "tapp_log.h"
extern void _cfr_uartTransmitterReset( void );
extern void p_cmbs14_SuspendTxRes(u8 u8_Response);
extern void p_cmbs14_ResumeTxRes(u8 u8_Response);
extern ST_CMBS_APP g_CMBSApp;
#if defined (CRASH_DUMP)
extern bool tapp_dsr_IsCrashDumpAvailable(void);
#endif
#if defined (CRASH_DUMP)
#include "csys0reg.h"
#include "csys2vpb.h"
#include "csys5os.h"
#endif
#endif
extern void tapp_util_ConfigureUARTFlowCTRL(E_CMBS_FLOW_CTRL flowCTRL);
E_CMBS_RC _cmbs_int_cmd_SendOPUSPayload(void);
void _cmbs_int_cmd_CapabilitiesReply(u8 *pu8_Buffer);
void _cmbs_int_cmd_Capabilities(u8 *pu8_Buffer);
void _cmbs_int_cmd_StoreRAMDump(void);
int InitDuslicXS(void);
int SLIC_init(void);
// ========== _cmbs_int_cmd_Reset ===========
/*!
\brief reset the communication module
\param[in] < none >
\return < none >
*/
void _cmbs_int_cmd_Reset( void )
{
#ifdef OS_TASK_CONTROL
extern volatile u32 G_u32_tapp_ParamAreaGetRspFlag;
extern volatile u32 G_u32_tapp_ParamAreaGetRspOffset;
extern volatile u32 G_u32_tapp_ParamAreaGetRspDataLen;
#endif // OS_TASK_CONTROL
CFR_DBG_OUT ( "CMBS-API: Reset communication module \n" ) ;
#if defined ( CMBS_API_TARGET )
cfr_uartInitalize ( );
#endif
g_CMBSInstance.e_DestFlowState = E_CMBS_FLOW_STATE_GO;
g_CMBSInstance.e_OrigFlowState = E_CMBS_FLOW_STATE_GO;
#ifdef OS_TASK_CONTROL
G_u32_tapp_ParamAreaGetRspFlag = 0;
G_u32_tapp_ParamAreaGetRspOffset = 0;
G_u32_tapp_ParamAreaGetRspDataLen = 0;
#endif // OS_TASK_CONTROL
}
// ========== _cmbs_int_cmd_Hello ===========
/*!
\brief reset communication buffer and reply to host, ready to go.
\param[in,out] pu8_Buffer pointer to buffer, currently NULL, u16_Size size of buffer
\return < none >
*/
extern void cmbs_applNewTDMReconfigure ( u8 u8_Master, u8 u8_Speed, u8 u8_Sync, u16 u16_SlotEnable, u8 u8_Loop );
void _cmbs_int_cmd_Hello( u8 * pu8_Buffer, u16 u16_Size )
{
#if defined ( CMBS_API_TARGET )
u8 u8_Buffer[5];
#if !defined( CMBS_USB_AUDIO )
u8 u8_Master = FALSE, u8_Loop = FALSE;
#endif
if( pu8_Buffer )
{
CFR_DBG_OUT ( "CMBS-API: Receive Hello message with Media Information %02x %02x %02x\n",
pu8_Buffer[0],
pu8_Buffer[1],
pu8_Buffer[2]
);
#if !defined( CMBS_USB_AUDIO )
switch ( pu8_Buffer[0])
{
case CMBS_TDM_TYPE_MASTER:
u8_Master = TRUE;
u8_Loop = FALSE;
break;
case CMBS_TDM_TYPE_SLAVE:
u8_Master = FALSE;
u8_Loop = FALSE;
break;
case CMBS_TDM_TYPE_MASTER_LOOP:
u8_Master = TRUE;
u8_Loop = TRUE;
break;
case CMBS_TDM_TYPE_SLAVE_LOOP:
u8_Master = FALSE;
u8_Loop = TRUE;
break;
}
#ifndef NEW_TDM
cmbs_applTDMReconfigure( u8_Master, pu8_Buffer[1], pu8_Buffer[2], 0xFFFF, u8_Loop );
#else
cmbs_applNewTDMReconfigure( u8_Master, pu8_Buffer[1], pu8_Buffer[2], 0xFFFF, u8_Loop );
#endif //NEW_TDM
#endif //!defined( CMBS_USB_AUDIO )
if (u16_Size > LEGACY_CMD_HELLO_LENGTH) //means we also received UART Flow control configuration
{
#if (defined (UART) && !defined(USB)) || defined (CMBS_UART)
CFR_DBG_OUT ( "CMBS-API: Receive Hello message with UART Configuration %02x\n", pu8_Buffer[5]);
tapp_util_ConfigureUARTFlowCTRL(pu8_Buffer[5]);
#endif
}
}
else
{
CFR_DBG_OUT ( "CMBS-API: Receive Hello message without Media Information\n" );
}
// (Re-)Init transmit (to avoid problem occurred with USB, when old info is still in buffer when serial port is closed)
_cfr_uartTransmitterReset();
_cmbs_int_cmd_Reset();
cfr_ie_ser_u16( u8_Buffer, CMBS_API_TARGET_VERSION );
cfr_ie_ser_u16( u8_Buffer+sizeof(u16),CMBS_TARGET_BUILD );
u8_Buffer[4] = g_CMBSInstance.e_Mode;
#ifdef QSPIC_EEPROM
p_dr13_EEPONF_DisableFlashing(); // should call p_cmbs14_ResumeTxRes instead ?
#endif
#ifdef CMBS_TARGET_UP_RETRANSMISSION
tapp_dsr_UpdateHelloArrived(true);
#endif
tapp_util_Release_All_External_Calls(&g_CMBSApp); // If any Open Call
cmbs_int_cmd_Send( (u8)CMBS_CMD_HELLO_RPLY, u8_Buffer, sizeof(u8_Buffer) );
#else
UNUSED_PARAMETER(u16_Size);
#endif // CMBS_API_TARGET
UNUSED_PARAMETER( pu8_Buffer );
}
// ========== _cmbs_int_cmd_HelloRply ===========
/*!
\brief target reply received, get version info of target
\param[in,out] pu8_Buffer pointer to parameter, e.g. version info,etc.
\return < none >
*/
void _cmbs_int_cmd_HelloRply( u8 * pu8_Buffer )
{
#if !defined ( CMBS_API_TARGET )
u16 u16_Version;
cfr_ie_dser_u16 (pu8_Buffer, &u16_Version );
g_CMBSInstance.u16_TargetVersion = u16_Version;
if(u16_Version & 0xF000)
{
CFR_DBG_OUT( "TARGET API version: %x.%02x.%x\n", (u16_Version>>12),((u16_Version & 0xFF0)>>4), (u16_Version & 0xF) );
}
else
{
CFR_DBG_OUT( "TARGET API version: %02x.%02x\n", (u16_Version>>8),(u16_Version &0xFF) );
}
cfr_ie_dser_u16 (pu8_Buffer+2, &u16_Version );
g_CMBSInstance.u16_TargetBuild = u16_Version;
CFR_DBG_OUT( "TARGET BUILD : %02x.%02x\n", (u16_Version>>8),(u16_Version &0xFF) );
CFR_DBG_OUT( "TARGET mode : %d\n", pu8_Buffer[5] );
if ( g_CMBSInstance.u16_TargetVersion == 0x0001 )
{
// bootloader does not support checksum
g_st_CMBSCapabilities.u8_Checksum = 0;
}
_cmbs_int_StartupBlockSignal( &g_CMBSInstance );
#endif
}
// ========== cmbs_int_cmd_FlowNOK ===========
/*!
\brief destination side signal that it's not able to receive any packets.
stop transmission for destination.
\param[in,out] pu8_Buffer pointer to paramete, e.g. last received packet number
\return <none>
*/
void _cmbs_int_cmd_FlowNOK ( u8 * pu8_Buffer )
{
u16 u16_Packet;
cfr_ie_dser_u16 (pu8_Buffer, &u16_Packet );
g_CMBSInstance.e_DestFlowState = E_CMBS_FLOW_STATE_STOP;
#if !defined ( CMBS_TARGET_API )
CFR_DBG_WARN( "CMBS-API: Target side is busy, can't receive any more packets\n" );
#endif
}
// ========== cmbs_int_cmd_FlowRestart ===========
/*!
\brief destination side signal that it's able to receive packets.
enable transmission for destination.
\param[in,out] pu8_Buffer pointer to paramete, e.g. last received packet number
\return <none>
*/
void _cmbs_int_cmd_FlowRestart ( u8 * pu8_Buffer )
{
u16 u16_Packet;
cfr_ie_dser_u16 (pu8_Buffer, &u16_Packet );
g_CMBSInstance.e_DestFlowState = E_CMBS_FLOW_STATE_GO;
#if !defined ( CMBS_TARGET_API )
CFR_DBG_WARN( "CMBS-API: Target side is free, can receive packets again\n" );
#endif
}
// ========== cmbs_int_cmd_Dispatcher ===========
/*!
\brief dispatch internal CMBS commands
\param[in] u8_Cmd internal CMBS Command ID
\param[in] pu8_Buffer pointer to parameter
\param[in] u16_Size size of parameter
\return <none>
*/
void cmbs_int_cmd_Dispatcher( u8 u8_Cmd, u8 * pu8_Buffer, u16 u16_Size )
{
if( u16_Size ){} // unused u16_Size; eliminate "unused parameter" compiler warning
switch ( u8_Cmd )
{
#if defined ( CMBS_API_TARGET )
// start up command of host to target
case CMBS_CMD_HELLO:
/// Hello buffer configure also the IOM channel
if ( u16_Size )
_cmbs_int_cmd_Hello( pu8_Buffer, u16_Size );
else
_cmbs_int_cmd_Hello( NULL, 0 );
// preset with 0, maybe a different host now.
g_st_CMBSCapabilities.u8_Checksum = 0;
break;
case CMBS_CMD_FLASH_START_RES:
p_cmbs14_SuspendTxRes( 1 );
break;
case CMBS_CMD_FLASH_STOP_RES:
p_cmbs14_ResumeTxRes( 1 );
break;
// checksum command of host to target
case CMBS_CMD_CAPABILITIES:
/// Capabilities buffer configure also the IOM channel
if ( u16_Size )
_cmbs_int_cmd_Capabilities(pu8_Buffer);
else
_cmbs_int_cmd_Capabilities(NULL);
// send own Capabilities in a reply message
cmbs_int_cmd_SendCapablitiesReply();
break;
// checksum command of host to target
case CMBS_CMD_STORE_RAM_DUMP:
/// To Forcefully reset the CMBS to capture the RAM Dump
_cmbs_int_cmd_StoreRAMDump();
break;
#endif
#if !defined ( CMBS_API_TARGET )
// start up reply command from target to host
case CMBS_CMD_HELLO_RPLY:
_cmbs_int_cmd_HelloRply( pu8_Buffer );
break;
case CMBS_CMD_FLASH_START_REQ:
_cmbs_int_SuspendTxCommands();
break;
case CMBS_CMD_FLASH_STOP_REQ:
_cmbs_int_ResumeTxCommands();
break;
// capabilities reply command from target to host
case CMBS_CMD_CAPABILITIES_RPLY:
_cmbs_int_cmd_CapabilitiesReply(pu8_Buffer);
break;
case CMBS_CMD_SEND_OPUS_PAYLOAD:
_cmbs_int_cmd_SendOPUSPayload();
break;
#endif
case CMBS_CMD_FLOW_NOK:
// destination side is busy and not able to receive any more packets
_cmbs_int_cmd_FlowNOK( pu8_Buffer );
break;
case CMBS_CMD_FLOW_RESTART:
// destination side is free and restart to receive packets
_cmbs_int_cmd_FlowRestart(pu8_Buffer );
break;
case CMBS_CMD_RESET:
_cmbs_int_cmd_Reset();
break;
default:
CFR_DBG_WARN( "ProtCMD Dispatcher: %d is not implemented, yet!\n", u8_Cmd );
}
}
u32 cmbs_cmd_parser( CMBS_CMD id, u8* pu8_Buffer, u8* pu8_Buffer_parse, u32 u32_Pos)
{
switch ( id )
{
case CMBS_CMD_HELLO:
// byte 0 = TDM config
switch(pu8_Buffer[0])
{
case CMBS_TDM_TYPE_MASTER: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n TDM config = %s ", "CMBS_TDM_TYPE_MASTER");
break;
case CMBS_TDM_TYPE_SLAVE: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n TDM config = %s ", "CMBS_TDM_TYPE_SLAVE");
break;
case CMBS_TDM_TYPE_MASTER_LOOP: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n TDM config = %s ", "CMBS_TDM_TYPE_MASTER_LOOP");
break;
case CMBS_TDM_TYPE_SLAVE_LOOP: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n TDM config = %s ", "CMBS_TDM_TYPE_SLAVE_LOOP");
break;
}
// byte 1 = speed config
switch(pu8_Buffer[1])
{
case CMBS_TDM_PCM_512: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n speed config = %s ", "CMBS_TDM_PCM_512");
break;
case CMBS_TDM_PCM_768: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n speed config = %s ", "CMBS_TDM_PCM_768");
break;
case CMBS_TDM_PCM_1536: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n speed config = %s ", "CMBS_TDM_PCM_1536");
break;
case CMBS_TDM_PCM_2048: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n speed config = %s ", "CMBS_TDM_PCM_2048");
break;
case CMBS_TDM_IOM_512: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n speed config = %s ", "CMBS_TDM_IOM_512");
break;
case CMBS_TDM_IOM_768: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n speed config = %s ", "CMBS_TDM_IOM_768");
break;
case CMBS_TDM_IOM_1536: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n speed config = %s ", "CMBS_TDM_IOM_1536");
break;
case CMBS_TDM_IOM_2048: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n speed config = %s ", "CMBS_TDM_IOM_2048");
break;
}
// byte 2 = sync config
switch(pu8_Buffer[2])
{
case CMBS_TDM_SYNC_SHORT_FR: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n sync config = %s ", "CMBS_TDM_SYNC_SHORT_FR");
break;
case CMBS_TDM_SYNC_SHORT_FF: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n sync config = %s ", "CMBS_TDM_SYNC_SHORT_FF");
break;
case CMBS_TDM_SYNC_SHORT_LF: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n sync config = %s ", "CMBS_TDM_SYNC_SHORT_LF");
break;
case CMBS_TDM_SYNC_LONG: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n sync config = %s ", "CMBS_TDM_SYNC_LONG");
break;
}
u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos), "\n SlotEnable = 0x%04x", (pu8_Buffer[4] << 8) | pu8_Buffer[3]);
switch(pu8_Buffer[5])
{
case CMBS_FLOW_CTRL_NONE: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n device type = %s ", "CMBS_FLOW_CTRL_NONE");
break;
case CMBS_FLOW_CTRL_XON_XOFF: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n device type = %s ", "CMBS_FLOW_CTRL_XON_XOFF");
break;
case CMBS_FLOW_CTRL_RTS_CTS: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n device type = %s ", "CMBS_FLOW_CTRL_RTS_CTS");
break;
case CMBS_FLOW_CTRL_DSR_DTR: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n device type = %s ", "CMBS_FLOW_CTRL_DSR_DTR");
break;
}
break;
case CMBS_CMD_HELLO_RPLY:
u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos), "\n CMBS_API_TARGET_VERSION = 0x%04x", (pu8_Buffer[1] << 8) | pu8_Buffer[0]);
u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos), "\n CMBS_TARGET_BUILD = 0x%04x ", (pu8_Buffer[3]<<8) | pu8_Buffer[2]);
switch(pu8_Buffer[4])
{
case CMBS_MODE_MLB: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n mode = %s ", "CMBS_MODE_MLB");
break;
case CMBS_MODE_AMLB: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n mode = %s ", "CMBS_MODE_AMLB");
break;
case CMBS_MODE_DECT_PIPE: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n mode = %s ", "CMBS_MODE_DECT_PIPE");
break;
case CMBS_MODE_DECT_MAC_PIPE: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n mode = %s ", "CMBS_MODE_DECT_MAC_PIPE");
break;
case CMBS_MODE_MAX: u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n mode = %s ", "CMBS_MODE_MAX");
break;
}
break;
case CMBS_CMD_CAPABILITIES:
case CMBS_CMD_CAPABILITIES_RPLY:
if(pu8_Buffer[4] & 1)
{
u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n %s ", "CHECKSUM_SUPPORT");
}
else
{
u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos),"\n %s ", "CHECKSUM_NOT_SUPPORT");
}
break;
case CMBS_CMD_FLOW_NOK:
case CMBS_CMD_FLOW_RESTART:
u32_Pos+=sprintf((char*)(pu8_Buffer_parse+u32_Pos), "\n packet = 0x%04x", (pu8_Buffer[0] << 8) | pu8_Buffer[1]);
break;
case CMBS_CMD_FLASH_START_RES:
case CMBS_CMD_FLASH_STOP_RES:
case CMBS_CMD_FLASH_START_REQ:
case CMBS_CMD_FLASH_STOP_REQ:
case CMBS_CMD_RESET:
case CMBS_CMD_STORE_RAM_DUMP:
case CMBS_CMD_SEND_OPUS_PAYLOAD:
break;
}
return u32_Pos ;
}
// ========== cmbs_int_cmd_FlowNOKHandle ===========
/*!
\brief send information to other side to stop transmission
\param[in,out] void
\return < none >
*/
void cmbs_int_cmd_FlowNOKHandle ( u16 u16_Packet )
{
u8 u8_Buffer[2];
if ( g_CMBSInstance.e_OrigFlowState == E_CMBS_FLOW_STATE_GO )
{
g_CMBSInstance.e_OrigFlowState = E_CMBS_FLOW_STATE_STOP;
cfr_ie_ser_u16 ( u8_Buffer, u16_Packet );
cmbs_int_cmd_Send( (u8)CMBS_CMD_FLOW_NOK, u8_Buffer, sizeof(u8_Buffer) );
}
}
// ========== cmbs_int_cmd_FlowRestartHandle ===========
/*!
\brief send information to other side to re-enable transmission
\param[in,out] void
\return void cmbs_int_cmdFlowStop description
*/
void cmbs_int_cmd_FlowRestartHandle ( u16 u16_Packet )
{
u8 u8_Buffer[2];
if ( g_CMBSInstance.e_OrigFlowState == E_CMBS_FLOW_STATE_STOP )
{
g_CMBSInstance.e_OrigFlowState = E_CMBS_FLOW_STATE_GO;
cfr_ie_ser_u16 ( u8_Buffer, u16_Packet );
cmbs_int_cmd_Send( (u8)CMBS_CMD_FLOW_RESTART, u8_Buffer, sizeof(u8_Buffer) );
}
}
void cmbs_int_cmd_ReceiveEarly ( u8 * pu8_Buffer )
{
PST_CMBS_SER_MSG p_Mssg = (PST_CMBS_SER_MSG)pu8_Buffer;
// int i;
// CFR_DBG_OUT ( "CMBS-API: message Early Receive\n" );
// CFR_DBG_OUT ( "CMBS-API: packet => ");
// for ( i=0; i < 6; i++ )
// CFR_DBG_OUT ( "%02x ", pu8_Buffer[i] );
// CFR_DBG_OUT ( "\n" );
if ( (p_Mssg->st_MsgHdr.u16_EventID & CMBS_CMD_MASK) == CMBS_CMD_MASK)
{
// cmbs_dbg_CmdTrace ( pu8_Buffer, 0 );
cmbs_int_cmd_Dispatcher( (u8)p_Mssg->st_MsgHdr.u16_EventID, (u8*)p_Mssg->u8_Param, 0 );
}
}
u8 cmbs_int_cmd_FlowStateGet ( void )
{
return (u8)g_CMBSInstance.e_DestFlowState;
}
// ========== _cmbs_int_cmd_Capabilities ===========
/*!
\brief Capabilities of the Host received, e.g. checksum.
\param[in,out] pu8_Buffer pointer to buffer, currently NULL
\return < none >
*/
void _cmbs_int_cmd_Capabilities(u8 *pu8_Buffer)
{
#if defined ( CMBS_API_TARGET )
// u8 u8_Buffer[5];
if ( pu8_Buffer )
{
// Curretnyl 4 Bytes of capabilities are sent, but it could be extented for future use
// first byte is the length.
if ( pu8_Buffer[4] & CMBS_CAPABILITY_MASK )
{
// currently the only supported capability
// Store this capability
g_st_CMBSCapabilities.u8_Checksum = 1;
}
else
{
g_st_CMBSCapabilities.u8_Checksum = 0;
}
}
#endif // CMBS_API_TARGET
if( pu8_Buffer ){} // pu8_Buffer irrelevat here; eliminate "unused parameter" compiler warning
}
// ========== _cmbs_int_cmd_SendOPUSPayload ===========
/*!
\brief Send OPUS Payload to Target, with checksum.
\param[in,out] < none >
\return < none >
*/
void cmbs_send_OPUSPayload(PST_CFR_IE_LIST p_List, u8 *pu8_OPUSData, u16 u16_OPUSData_Size)
{
#if !defined(CMBS_API_TARGET)
cmbs_api_ie_OPUSDataAdd(p_List, pu8_OPUSData, u16_OPUSData_Size);
cmbs_int_EventSend(CMBS_EV_DEM_OPUS_DATA, p_List->pu8_Buffer, p_List->u16_CurSize);
#endif
}
#if !defined(CMBS_API_TARGET)
u8 OPUS_30ms_buff[240];
#ifdef DEBUG_UART_DATA_PIPE
u8 u8_Init = 1;
#endif
#endif
E_CMBS_RC _cmbs_int_cmd_SendOPUSPayload(void)
{
#if !defined(CMBS_API_TARGET)
#ifndef DEBUG_UART_DATA_PIPE
static char *filename_stereo = "../feel_it_still.opus";
static FILE *fp = NULL;
#endif
PST_CFR_IE_LIST p_List;
ST_IE_DATA st_Data;
#ifndef DEBUG_UART_DATA_PIPE
if (fp == NULL) {
fp = fopen(filename_stereo, "rb");
if (fp)
{
char file_header[16];
fread(&file_header, 1, 16, fp);
}
}
memset(&OPUS_30ms_buff, 0x0 , 240);
if (fp)
{
char PKTheader[2];
fread(&PKTheader, 1, 2, fp);
fread(&OPUS_30ms_buff, 1, 76, fp);
fread(&PKTheader, 1, 2, fp);
fread(&OPUS_30ms_buff[76], 1, 76, fp);
fread(&PKTheader, 1, 2, fp);
fread(&OPUS_30ms_buff[152], 1, 76, fp);
//printf("We have read the '%d' bytes from file\n", ret);
if (feof(fp))
{
/* We have reached the end of the file, rewind and start again.... Infinite loop */
//printf("We have reached the end of the file\n");
fclose(fp);
fp = NULL;
}
}
//else
{
//printf("We failed to open the file name '%s'\n", filename_stereo);
}
#endif
#ifdef DEBUG_UART_DATA_PIPE
if (u8_Init)
{
memset(&OPUS_30ms_buff[0], 'u', 76);
memset(&OPUS_30ms_buff[76], 'v', 76);
memset(&OPUS_30ms_buff[152], 'w', 76);
u8_Init = 0;
}
else
{
memset(&OPUS_30ms_buff[0], 'x', 76);
memset(&OPUS_30ms_buff[76], 'y', 76);
memset(&OPUS_30ms_buff[152], 'z', 76);
u8_Init = 1;
}
#endif
ALLOCATE_IE_LIST(p_List);
st_Data.u16_DataLen = 228;
st_Data.pu8_Data = OPUS_30ms_buff;
cmbs_send_OPUSPayload(p_List, st_Data.pu8_Data, st_Data.u16_DataLen);
return CMBS_RC_OK;
#else
return CMBS_RC_OK;
#endif // CMBS_API_TARGET
}
// ========== _cmbs_int_cmd_CapabilitiesReply ===========
/*!
\brief Capabilities of the Target received, e.g. checksum.
\param[in,out] pu8_Buffer pointer to buffer, currently NULL
\return < none >
*/
void _cmbs_int_cmd_CapabilitiesReply(u8 *pu8_Buffer)
{
#if !defined ( CMBS_API_TARGET )
if ( pu8_Buffer )
{
// Curretnyl 4 Bytes of capabilities are sent, but it could be extented for future use
// first byte is the length.
if ( pu8_Buffer[4] & CMBS_CAPABILITY_MASK )
{
// curretnlyx the only supported capability
// Store this capability
g_st_CMBSCapabilities.u8_Checksum = 1;
CFR_DBG_INFO("\n CHECKSUM_SET received\n");
}
}
// notify upper layer
_cmbs_int_StartupBlockSignal(&g_CMBSInstance);
#endif // CMBS_API_TARGET
if( pu8_Buffer ){} // pu8_Buffer irrelevat here; eliminate "unused parameter" compiler warning
}
// ========== _cmbs_int_cmd_StoreRAMDump ===========
/*!
\brief To forcefully reset the CMBS to capture RAM Dump
\param[in,out] < none >
\return < none >
*/
void _cmbs_int_cmd_StoreRAMDump(void)
{
#if defined ( CMBS_API_TARGET ) && defined ( CRASH_DUMP )
typedef void (*pfn_Crash)(void);
{
pfn_Crash p_Crashfn;
p_Crashfn = (pfn_Crash)0xFFFFFFFF;
p_Crashfn();
}
// wait for WD reset
while (1);
#endif // CMBS_API_TARGET
}
//*/

1393
dectmngr/src/cmbs/cmbs_dbg.c Executable file

File diff suppressed because it is too large Load Diff

48
dectmngr/src/cmbs/cmbs_dbg.h Executable file
View File

@@ -0,0 +1,48 @@
/*!
* \file cmbs_dbg.h
* \brief This file contains debug functions for CMBS API
* \author andriig
*
* @(#) %filespec: cmbs_dbg.h~DMZD53#6 %
*
*******************************************************************************/
#if !defined( CMBS_DBG_H )
#define CMBS_DBG_H
#include "cmbs_api.h" /* CMBS API definition */
#include "cmbs_han.h"
const char* cmbs_dbg_GetEventName(E_CMBS_EVENT_ID id);
const char* cmbs_dbg_GetCommandName(CMBS_CMD id);
const char* cmbs_dbg_GetParamName(E_CMBS_PARAM e_ParamId);
const char* cmbs_dbg_GetIEName(E_CMBS_IE_TYPE e_IE);
const char* cmbs_dbg_GetHsTypeName(E_CMBS_HS_TYPE e_HsType);
const char* cmbs_dbg_GetToneName(E_CMBS_TONE e_Tone);
const char* cmbs_dbg_GetCallProgressName(E_CMBS_CALL_PROGRESS e_Prog);
const char* cmbs_dbg_GetCallTypeName(E_CMBS_CALL_STATE_TYPE e_CallType);
const char* cmbs_dbg_GetCallStateName(E_CMBS_CALL_STATE_STATUS e_CallStatus);
E_CMBS_PARAM cmbs_dbg_String2E_CMBS_PARAM(const char *psz_Value);
E_CMBS_TONE cmbs_dbg_String2E_CMBS_TONE(const char *psz_Value);
E_CMBS_CALL_PROGRESS cmbs_dbg_String2E_CMBS_CALL_PROGR(const char *psz_Value);
void cmbs_dbg_DumpIEList(u8 *pu8_Buffer, u16 u16_Size);
void cmbs_dbg_CmdTrace(const char *message, ST_CMBS_SER_MSGHDR *pst_Hdr, u8 *pu8_Buffer);
void cmbs_dbg_getTimestampString(char *buffer);
/* Parse IE Function */
typedef u32 (*pfn_cmbs_dbg_ParseIEFunc)(char *pOutput, u32 u32_OutputSize, void *pv_IE, u16 u16_IE);
void cmbs_dbg_SetParseIEFunc(pfn_cmbs_dbg_ParseIEFunc);
typedef enum
{
CMBS_LOG_OUTPUT_TERMINAL = 0x0,
CMBS_LOG_OUTPUT_LOGFILE,
CMBS_LOG_OUTPUT_BOTH,
CMBS_LOG_OUTPUT_NONE,
CMBS_LOG_OUTPUT_MAX
}E_CMBS_LOG_OUTPUT;
#define CMBS_MAX_IE_PRINT_SIZE 14000
#endif

35
dectmngr/src/cmbs/cmbs_dcm.c Executable file
View File

@@ -0,0 +1,35 @@
/*!
* \file cmbs_dcm.c
* \brief API cakk media functions
* \Author CMBS Team
*
* @(#) %filespec: cmbs_dcm.c~DMZD53#7 %
*
*******************************************************************************/
#include "cmbs_int.h"
E_CMBS_RC cmbs_dcm_CallTransferRes(PST_IE_CALLTRANSFERREQ pst_TrfReq, PST_IE_RESPONSE pst_Resp)
{
PST_CFR_IE_LIST p_List;
ALLOCATE_IE_LIST(p_List);
cmbs_api_ie_CallTransferReqAdd((void*)p_List, pst_TrfReq);
cmbs_api_ie_ResponseAdd((void*)p_List, pst_Resp);
return cmbs_int_EventSend( CMBS_EV_DCM_CALL_TRANSFER_RES, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dcm_CallConferenceRes(PST_IE_CALLTRANSFERREQ pst_TrfReq, PST_IE_RESPONSE pst_Resp)
{
PST_CFR_IE_LIST p_List;
ALLOCATE_IE_LIST(p_List);
cmbs_api_ie_CallTransferReqAdd((void*)p_List, pst_TrfReq);
cmbs_api_ie_ResponseAdd((void*)p_List, pst_Resp);
return cmbs_int_EventSend( CMBS_EV_DCM_CALL_CONFERENCE_RES, p_List->pu8_Buffer, p_List->u16_CurSize );
}

299
dectmngr/src/cmbs/cmbs_dee.c Executable file
View File

@@ -0,0 +1,299 @@
/*!
* \file cmbs_dee.c
* \brief DEE (external endpoint) functions
* \Author stein
*
* @(#) %filespec: cmbs_dee.c~DMZD53#9 %
*
*******************************************************************************/
#if defined(__arm)
# include "tclib.h"
# include "embedded.h"
#else
# include <stdlib.h>
# include <stdio.h>
# include <string.h>
#endif
#include "cmbs_int.h"
typedef enum
{
FXS_EV_UNDEF,
FXS_EV_OFFHOOK, /*!< OffHook event */
FXS_EV_ONHOOK, /*!< OnHook event */
FXS_EV_KEYPAD, /*!< Keypad event */
FXS_EV_OFFHOOK_INT, /* Off hook to make inter com call (call class)*/
FXS_EV_OFFHOOK_EXT, /* Off hook to make External call (call class)*/
FXS_EV_PARL_EXT_CALL,
FXS_EV_PARL_INT_CALL,
FXS_EV_CW_ACCEPT,
FXS_EV_CALL_HOLD,
FXS_EV_CALL_RESUME,
FXS_EV_CALL_TRFR,
FXS_EV_CALL_CONF,
FXS_EV_CALL_RELEASE,
FXS_EV_CALL_TOGGLE,
FXS_EV_HOST_CONFIG,
FXS_EV_REG_FXS,
FXS_EV_MAX
} FXS_EV;
typedef enum
{
E_TAPP_AUD_CHANNEL_MODE_UNDEF, /*!< channel is not used */
E_TAPP_AUD_CHANNEL_MODE_PCM_16_NB, /*!< channel is used as PCM 16 bit linear narrow-band 8 KHz*/
E_TAPP_AUD_CHANNEL_MODE_PCM_16_WB, /*!< channel is used as PCM 16 bit linear wide-band 16 KHz */
E_TAPP_AUD_CHANNEL_MODE_PCM_8_ALAW, /*!< channel is used as PCM 8 bit a-law 8 KHz */
E_TAPP_AUD_CHANNEL_MODE_PCM_8_ULAW, /*!< channel is used as PCM 8 bit u-law 8 KHz */
E_TAPP_AUD_CHANNEL_MODE_PCM_8, /*!< channel is used as PCM 8 bit linear 8 KHz */
E_TAPP_AUD_CHANNEL_MODE_WB_16_ALAW, /*!< channel is used as PCM 8 bit a-law 16 KHz */
E_TAPP_AUD_CHANNEL_MODE_WB_16_ULAW, /*!< channel is used as PCM 8 bit u-law 16 KHz */
E_TAPP_AUD_CHANNEL_MODE_MAX /*!< channel mode max definition */
} E_TAPP_AUD_CHANNEL_MODE;
u32 cmbs_dee_CallInstanceNew( void * pv_AppRefHandle )
{
UNUSED_PARAMETER( pv_AppRefHandle );
return ++g_CMBSInstance.u32_CallInstanceCount;
}
E_CMBS_RC cmbs_dee_CallEstablish( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_ESTABLISH, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_ReconnectCallSwitch( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DSR_RECON_CALL_SWITCH, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallProgress( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_PROGRESS, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallAnswer( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_ANSWER, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallRelease( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_RELEASE, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallReleaseComplete( void * pv_AppRefHandle, u32 u32_CallInstance )
{
PST_CFR_IE_LIST p_List = cmbs_api_ie_GetList();
UNUSED_PARAMETER( pv_AppRefHandle );
cmbs_api_ie_CallInstanceAdd( p_List, u32_CallInstance );
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_RELEASECOMPLETE, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallInbandInfo(void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_INBANDINFO, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallMediaOffer( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_MEDIA_OFFER, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallMediaOfferRes( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_MEDIA_OFFER_RES, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_HsCodecCfmFailed( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_HS_CODEC_CFM_FAILED, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallHold( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_HOLD, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallResume( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_RESUME, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallHoldRes( void * pv_AppRefHandle, u32 u32_CallInstance, u16 u16_HsNum, E_CMBS_RESPONSE e_Response )
{
ST_IE_RESPONSE st_Response;
PST_CFR_IE_LIST pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
ALLOCATE_IE_LIST(pv_RefIEList);
st_Response.e_Response = e_Response;
// Add call Instance IE
cmbs_api_ie_CallInstanceAdd( (void*)pv_RefIEList, u32_CallInstance );
cmbs_api_ie_ResponseAdd( (void*)pv_RefIEList, &st_Response );
cmbs_api_ie_HandsetsAdd( (void*)pv_RefIEList, u16_HsNum);
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_HOLD_RES, pv_RefIEList->pu8_Buffer, pv_RefIEList->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallResumeRes( void * pv_AppRefHandle, u32 u32_CallInstance, u16 u16_HsNum, E_CMBS_RESPONSE e_Response )
{
ST_IE_RESPONSE st_Response;
PST_CFR_IE_LIST pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
ALLOCATE_IE_LIST(pv_RefIEList);
st_Response.e_Response = e_Response;
// Add call Instance IE
cmbs_api_ie_CallInstanceAdd( (void*)pv_RefIEList, u32_CallInstance );
cmbs_api_ie_ResponseAdd( (void*)pv_RefIEList, &st_Response );
cmbs_api_ie_HandsetsAdd( (void*)pv_RefIEList, u16_HsNum);
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_RESUME_RES, pv_RefIEList->pu8_Buffer, pv_RefIEList->u16_CurSize );
}
E_CMBS_RC cmbs_dee_HandsetLinkRelease(u8 Handset)
{
PST_CFR_IE_LIST pv_RefIEList;
ALLOCATE_IE_LIST(pv_RefIEList);
cmbs_api_ie_HsNumberAdd((void*)pv_RefIEList, Handset);
return cmbs_int_EventSend( CMBS_EV_DEE_HANDSET_LINK_RELEASE , pv_RefIEList->pu8_Buffer, pv_RefIEList->u16_CurSize );
}
E_CMBS_RC cmbs_dee_MergeCalls( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_MERGE_CALLS, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_AnsFxsCall( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend(CMBS_EV_DEE_ANS_FXS_CALL, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_MakeSPKOgCall( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend(CMBS_EV_DEE_SPK_OG_CALL, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_EmergencyCallRelease( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_EMERGENCY_RELEASE, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallScreening( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_SCREENING, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallDeflection( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_DEFLECTION, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dee_CallDeflectionRes( void * pv_AppRefHandle, u32 u32_CallInstance, u16 u16_HsNum, E_CMBS_RESPONSE e_Response )
{
ST_IE_RESPONSE st_Response;
PST_CFR_IE_LIST pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
ALLOCATE_IE_LIST(pv_RefIEList);
st_Response.e_Response = e_Response;
// Add call Instance IE
cmbs_api_ie_CallInstanceAdd( (void*)pv_RefIEList, u32_CallInstance );
cmbs_api_ie_ResponseAdd( (void*)pv_RefIEList, &st_Response );
cmbs_api_ie_HandsetsAdd( (void*)pv_RefIEList, u16_HsNum);
return cmbs_int_EventSend( CMBS_EV_DEE_CALL_DEFLECTION_RES, pv_RefIEList->pu8_Buffer, pv_RefIEList->u16_CurSize );
}
//*/

100
dectmngr/src/cmbs/cmbs_dem.c Executable file
View File

@@ -0,0 +1,100 @@
/*!
* \file cmbs_dem.c
* \brief DEM (external media) functions
* \Author stein
*
* @(#) %filespec: cmbs_dem.c~DMZD53#4 %
*
*******************************************************************************/
#if defined(__arm)
# include "tclib.h"
# include "embedded.h"
#else
# include <stdlib.h>
# include <stdio.h>
# include <string.h>
#endif
#include "cmbs_int.h"
#include "cfr_ie.h"
#include "cfr_debug.h"
E_CMBS_RC cmbs_dem_ChannelStart( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEM_CHANNEL_START, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dem_ChannelStop( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEM_CHANNEL_STOP, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dem_ChannelInternalConnect( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEM_CHANNEL_INTERNAL_CONNECT, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dem_ToneStart( void *pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEM_TONE_START, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dem_ToneStop( void *pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEM_TONE_STOP, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dem_TDMLoopbackStart( void *pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEM_TDM_LOOPBACK_START, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dem_TDMLoopbackStop( void *pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_DEM_TDM_LOOPBACK_STOP, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dem_ConfigTDMSlots(void *pv_AppRefHandle, u32 u32_TDMSlots)
{
PST_CFR_IE_LIST p_List;
UNUSED_PARAMETER( pv_AppRefHandle );
ALLOCATE_IE_LIST(p_List);
cmbs_api_ie_TDMSlotsAdd( (void*)p_List, u32_TDMSlots );
return cmbs_int_EventSend( CMBS_EV_DEM_CONFIG_TDM_SLOTS, p_List->pu8_Buffer, p_List->u16_CurSize );
}
//*/

2714
dectmngr/src/cmbs/cmbs_dsr.c Executable file

File diff suppressed because it is too large Load Diff

224
dectmngr/src/cmbs/cmbs_fifo.c Executable file
View File

@@ -0,0 +1,224 @@
/*!
* \file cmbs_fifo.c
* \brief Fifo message queue for CMBS host and CMBS target
*
*******************************************************************************
* \par History
* \n==== History ============================================================\n
* date name version action \n
* ---------------------------------------------------------------------------\n
*
*******************************************************************************/
#include "cmbs_api.h"
#include "cmbs_int.h"
#include "cfr_ie.h"
#include "cfr_debug.h"
#include "cmbs_fifo.h"
#include "cfr_mssg.h"
#if defined(CMBS_API_TARGET)
#include "cg0type.h"
#include "csys0reg.h"
#include "cos00int.h" // Needed for critical section
#if defined (CSS)
#include "plicu.h"
#include "priorities.h"
#endif
#endif
#if defined( __linux__ )
#include <stdio.h>
#include <string.h>
#endif
// Brief
//------------
// Init the FIFO
void cmbs_util_FifoInit(ST_CMBS_FIFO *p_Fifo,
void *pv_Buffer,
const u16 u16_ElementSize,
const u16 u16_Size,
CFR_CMBS_CRITICALSECTION p_cSection)
{
//printf("cmbs_util_FifoInit-->\n");
p_Fifo->u16_Count = 0;
p_Fifo->u16_ElemSize = u16_ElementSize;
p_Fifo->p_Read = p_Fifo->p_Write = pv_Buffer;
p_Fifo->u16_Size = p_Fifo->u16_Read2End = p_Fifo->u16_Write2End = u16_Size;
p_Fifo->p_cSection = p_cSection;
//init statistics
p_Fifo->s_fifo_statistics.u32_MaxInUse = 0;
p_Fifo->s_fifo_statistics.u32_CountFIFOIsFull= 0;
CFR_CMBS_INIT_CRITICALSECTION ( p_Fifo->p_cSection );
}
// Brief
//------------
// Push a message to FIFO
u8 cmbs_util_FifoPush(ST_CMBS_FIFO *p_Fifo, void *pv_Element)
{
u16 u16_Write2End;
u8 *p_Write;
//printf("cmbs_util_FifoPush-->\n");
CFR_CMBS_ENTER_CRITICALSECTION ( p_Fifo->p_cSection );
if ( p_Fifo->u16_Count >= p_Fifo->u16_Size )
{
p_Fifo->s_fifo_statistics.u32_CountFIFOIsFull++;
p_Fifo->s_fifo_statistics.u32_MaxInUse = 0;
CFR_CMBS_LEAVE_CRITICALSECTION ( p_Fifo->p_cSection );
CFR_DBG_WARN("cmbs_util_FifoPush: FIFO full\n");
return 0;
}
p_Write = p_Fifo->p_Write;
memcpy(p_Write, pv_Element, p_Fifo->u16_ElemSize);
p_Write += p_Fifo->u16_ElemSize;
u16_Write2End = p_Fifo->u16_Write2End;
if ( --u16_Write2End == 0 )
{
u16_Write2End = p_Fifo->u16_Size;
p_Write -= u16_Write2End * p_Fifo->u16_ElemSize;
}
p_Fifo->u16_Write2End = u16_Write2End;
p_Fifo->p_Write = p_Write;
p_Fifo->u16_Count++;
if(p_Fifo->u16_Count > p_Fifo->s_fifo_statistics.u32_MaxInUse)
{
p_Fifo->s_fifo_statistics.u32_MaxInUse = p_Fifo->u16_Count;
}
CFR_CMBS_LEAVE_CRITICALSECTION ( p_Fifo->p_cSection );
return 1;
}
// Brief
//------------
// Get a message from FIFO
void* cmbs_util_FifoGet(ST_CMBS_FIFO *p_Fifo)
{
//printf("cmbs_util_FifoGet-->\n");
CFR_CMBS_ENTER_CRITICALSECTION ( p_Fifo->p_cSection );
if ( p_Fifo->u16_Count == 0 )
{
// CFR_DBG_WARN( "cmbs_util_FifoGet: FIFO empty\n" );
CFR_CMBS_LEAVE_CRITICALSECTION ( p_Fifo->p_cSection );
return NULL;
}
CFR_CMBS_LEAVE_CRITICALSECTION ( p_Fifo->p_cSection );
return p_Fifo->p_Read;
}
// Brief
//------------
// Pop (extract) a message from a FIFO
void* cmbs_util_FifoPop(ST_CMBS_FIFO *p_Fifo)
{
u16 u16_Read2End;
u8 *p_Read;
void *p_Element;
//printf("cmbs_util_FifoPop-->\n");
CFR_CMBS_ENTER_CRITICALSECTION ( p_Fifo->p_cSection );
if ( p_Fifo->u16_Count == 0 )
{
CFR_DBG_WARN( "cmbs_util_FifoGet: FIFO empty\n" );
CFR_CMBS_LEAVE_CRITICALSECTION ( p_Fifo->p_cSection );
return NULL;
}
u16_Read2End = p_Fifo->u16_Read2End;
p_Read = p_Fifo->p_Read;
p_Element = p_Read;
p_Read += p_Fifo->u16_ElemSize;
if ( --u16_Read2End == 0 )
{
u16_Read2End = p_Fifo->u16_Size;
p_Read -= u16_Read2End * p_Fifo->u16_ElemSize;
}
p_Fifo->p_Read = p_Read;
p_Fifo->u16_Read2End = u16_Read2End;
p_Fifo->u16_Count--;
CFR_CMBS_LEAVE_CRITICALSECTION ( p_Fifo->p_cSection );
return p_Element;
}
// Brief
//------------
// Pop all messages from a FIFO. Return no. of popped messages
u16 cmbs_util_FifoClear(ST_CMBS_FIFO *p_Fifo)
{
u16 u16_count=0;
while (cmbs_util_FifoPop(p_Fifo)) // pop untill return NULL
{
u16_count++;
}
return u16_count;
}
void cmbs_util_FifoPrintStatistics(ST_CMBS_FIFO* p_Fifo)
{
CFR_CMBS_ENTER_CRITICALSECTION(p_Fifo->p_cSection);
printf("\n\tCurrent use in fifo: %d",p_Fifo->u16_Count);
printf("\n\tMax use in fifo: %d",p_Fifo->s_fifo_statistics.u32_MaxInUse);
printf("\n\tCount of full fifo: %d\n\n",p_Fifo->s_fifo_statistics.u32_CountFIFOIsFull);
CFR_CMBS_LEAVE_CRITICALSECTION(p_Fifo->p_cSection);
}
u16 cmbs_util_FifoCount(ST_CMBS_FIFO *p_Fifo)
{
u16 u16_count;
CFR_CMBS_ENTER_CRITICALSECTION(p_Fifo->p_cSection);
u16_count = p_Fifo->u16_Count;
CFR_CMBS_LEAVE_CRITICALSECTION(p_Fifo->p_cSection);
return u16_count;
}
/*[----------- End Of File -------------------------------------------------------------------------------------------------------------]*/

85
dectmngr/src/cmbs/cmbs_fifo.h Executable file
View File

@@ -0,0 +1,85 @@
/*!
* \file cmbs_fifo.h
* \brief Fifo message queue for CMBS host and CMBS target
*
*******************************************************************************
* \par History
* \n==== History ============================================================\n
* date name version action \n
* ----------------------------------------------------------------------------\n
*
*******************************************************************************/
#if !defined( CMBS_FIFO_H )
#define CMBS_FIFO_H
#include "cmbs_int.h"
#include "cfr_mssg.h"
#if (VDSW_FEATURES & VDSW_ENC_REPEATER)
#define FIFO_NUM_ENTRIES SD09_MAX_NUM_SUB + SD09_MAX_SUB_CRFP
#else
#define FIFO_NUM_ENTRIES SD09_MAX_NUM_SUB
#endif
typedef struct
{
u32 u32_MaxInUse;
u32 u32_CountFIFOIsFull;
}
t_st_Fifo_Statistics;
/*! \brief simple FIFO definition */
typedef struct
{
u16 u16_Count; // number of elements
u16 u16_Size; // buffer size( max number of elements )
u16 u16_ElemSize; // element size
void * p_Read; // read pointer
void * p_Write; // write pointer
u16 u16_Read2End; // number of unused elements until fifo end
u16 u16_Write2End; // number of unused elements until fifo end
CFR_CMBS_CRITICALSECTION p_cSection; // Critical Section for the queue
t_st_Fifo_Statistics s_fifo_statistics; // statistics for queue
} ST_CMBS_FIFO, * PST_CMBS_FIFO;
#if defined( __cplusplus )
extern "C"
{
#endif
/*****************************************************************************
* Utilities
*****************************************************************************/
void cmbs_util_FifoInit( ST_CMBS_FIFO * p_Fifo,
void * pv_Buffer,
const u16 u16_ElementSize,
const u16 u16_Size,
CFR_CMBS_CRITICALSECTION p_cSection);
u8 cmbs_util_FifoPush( ST_CMBS_FIFO * p_Fifo, void * pv_Element );
void * cmbs_util_FifoGet( ST_CMBS_FIFO * p_Fifo );
void * cmbs_util_FifoPop( ST_CMBS_FIFO * p_Fifo );
u16 cmbs_util_FifoClear( ST_CMBS_FIFO * p_Fifo );
u16 cmbs_util_FifoCount(ST_CMBS_FIFO *p_Fifo);
void cmbs_util_FifoPrintStatistics(ST_CMBS_FIFO* p_Fifo);
#if defined( __cplusplus )
}
#endif
#endif // CMBS_FIFO_H

131
dectmngr/src/cmbs/cmbs_fun.h Executable file
View File

@@ -0,0 +1,131 @@
/*!
* \file fun_util.h
* \brief HAN FUN API
* \author ULE BS Team
*
*
*******************************************************************************/
#if !defined( _CMBS_FUN_H )
#define _CMBS_FUN_H
#include "cmbs_api.h"
/*Device Management Interface ID
====================================
This interface is used for registering Devices and Units with their associated data
such as Unit Type and the list of interfaces they are supporting.
It is also used for discovering all device and units by a configuration application
*/
#define DEVICE_MGMT_INTERFACE_ID 0x0001
/* Device Management Interface - Server */
/* Attributes */
#define DEVICE_MGMT_IF_SERVER_ATTR_ID_NUM_OF_DEVICES 0x0001
/* Commands */
#define DEVICE_MGMT_IF_SERVER_CMD_ID_REGISTER_DEVICE 0x0001
#define FUN_IF_DEV_MNGT_CMD_REGISTER_DEVICE 0x0001
#define FUN_IF_DEV_MNGT_CMD_DEREGISTER_DEVICE 0x0002
#define FUN_IF_DEV_MNGT_CMD_START_SESS_READ_REG_INFO 0x0003
#define FUN_IF_DEV_MNGT_CMD_END_SESS_READ_REG_INFO 0x0004
#define FUN_IF_DEV_MNGT_CMD_GET_ENTRIES 0x0005
#define MAX_NUM_OF_OPTIONAL_INTERFACES_IN_UNIT 8
#define MAX_NUM_OF_UNITS_IN_DEVICE 6
/////////////////////////////////
///////// Structs /////////
/////////////////////////////////
typedef struct
{
u8 UnitId;
u16 UnitType;
u16 NumberOfOptionalInterfaces;
u16 OptionalInterfaces[MAX_NUM_OF_OPTIONAL_INTERFACES_IN_UNIT];
} ST_FUN_UNIT_INFO;
typedef struct
{
u16 DeviceId;
u16 DeviceEMC;
u8 NumOfUnits;
ST_FUN_UNIT_INFO Units[MAX_NUM_OF_UNITS_IN_DEVICE];
} ST_FUN_DEVICE_INFO, * PST_FUN_DEVICE_INFO;
#define CMBS_HAN_IE_FUN_DEVICE_INFO_SIZE sizeof(ST_FUN_DEVICE_INFO)
// TODO: store request id as cookie and remove constant value
#define CMBS_HAN_FUN_REGISTRATION_REQ_ID 50
///////////////////////////////////////////////////////////////////////////////
// brief Macro which defines a bitfield mask in u8/u16/u32 value
//
// param FieldName Variable prefix
// Type u8, u16, u32
// BitOffset The offset of the bitfield in the value
// BitWidth Number of bits in the bitfield
///////////////////////////////////////////////////////////////////////////////
#define DEFINE_BITFIELD( FieldName, Type, BitOffet, BitWidth ) \
enum \
{ \
FieldName##_OFS = (BitOffet), \
FieldName##_WIDTH = (BitWidth), \
FieldName##_MASK = (Type)((( (Type)1<<(BitWidth))-1) << (BitOffet)), \
};
#define GET_BITFIELD_VAL( Var, FieldName ) \
( ((Var) & FieldName##_MASK ) >> FieldName##_OFS )
#define SET_BITFIELD_VAL( Var, FieldName, NewValue ) \
( ((Var) & (~FieldName##_MASK)) | ((NewValue) << FieldName##_OFS) )
typedef enum
{
FUN_IF_DEV_MNGT_REG_RESP_UID_TYPE_NONE = 0x0,
FUN_IF_DEV_MNGT_REG_RESP_UID_TYPE_IPUI = 0x1,
FUN_IF_DEV_MNGT_REG_RESP_UID_TYPE_IEEE_MAC_48 = 0x2,
FUN_IF_DEV_MNGT_REG_RESP_UID_TYPE_URI = 0x3,
}
t_en_hanIf_DevMngt_Reg_Dev_UID_Type;
typedef enum
{
FUN_IF_DEV_MNGT_REG_RESP_DISCR_TYPE_NON_PROPRIETARY = 0x0,
FUN_IF_DEV_MNGT_REG_RESP_DISCR_TYPE_PROPRIETARY = 0x1,
}
t_en_hanIf_DevMngt_RegResp_DiscrType;
#define FUN_IF_DEV_MNGT_UID_LENGTH_IPUI 5
#define FUN_IF_DEV_MNGT_UID_LENGTH_IEEE_MAC_48 12
#define OTA_BASE_DEVICE_ID 0
#define OTA_BASE_UNIT_MANAGMENT_UNIT_ID 0
#define OTA_DST_UNIT_MANAGMENT_UNIT_ID 0
#define OTA_MSG_TYPE_COMMAND_RESPONSE 3
#define OTA_ADDR_TYPE_INDIVIDUAL 0
#define OTA_INTERFACE_TYPE_SERVER 1
#define FUN_INTERFACE_DEVICE_MGNT 1
///////////////////////////////////////////////////////////////////////////////////////////////////////
// Define bitfields for Device Managment interface ///
// FieldName Type BitOffet BitWidth ///
///////////////////////////////////////////////////////////////////////////////////////////////////////
DEFINE_BITFIELD( FUN_IF_DEV_MNGT_REG_DISCRIMINATOR_TYPE, u8, 7, 1 );
DEFINE_BITFIELD( FUN_IF_DEV_MNGT_REG_DEV_UID_TYPE, u8, 0, 7 );
DEFINE_BITFIELD( FUN_IF_DEV_MNGT_REG_RES_DISCRIMINATOR_TYPE, u16, 15, 1 );
DEFINE_BITFIELD( FUN_IF_DEV_MNGT_REG_RES_DEVICE_ADDRESS, u16, 0, 15);
#endif // _FUN_UTIL_H
/**********************[End Of File]**********************************************************************************************************/

809
dectmngr/src/cmbs/cmbs_han.c Executable file
View File

@@ -0,0 +1,809 @@
/*!
* \file cmbs_han.c
* \brief
* \Author CMBS Team
*
*
*******************************************************************************/
#if defined(__arm)
#include "tclib.h"
#include "embedded.h"
#else
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#endif
#include "cmbs_int.h"
#include "cmbs_han_ie.h"
E_CMBS_RC cmbs_dsr_han_mngr_Init(void *pv_AppRefHandle, ST_HAN_CONFIG * pst_HANConfig)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
ST_IE_HAN_CONFIG st_HanCfgIe;
UNUSED_PARAMETER(pv_AppRefHandle);
st_HanCfgIe.st_HanCfg = *pst_HANConfig;
cmbs_api_ie_HanCfgAdd(p_List,&st_HanCfgIe);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_MNGR_INIT,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_mngr_Start (void *pv_AppRefHandle)
{
UNUSED_PARAMETER(pv_AppRefHandle);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_MNGR_START,NULL, 0);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_device_ReadTable (void *pv_AppRefHandle, u16 u16_NumOfEntries, u16 u16_IndexOfFirstEntry, u8 IsBrief )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_ShortValueAdd(p_List,u16_NumOfEntries, CMBS_IE_HAN_NUM_OF_ENTRIES);
cmbs_api_ie_ShortValueAdd(p_List,u16_IndexOfFirstEntry, CMBS_IE_HAN_INDEX_1ST_ENTRY);
cmbs_api_ie_ByteValueAdd(p_List, IsBrief ? CMBS_HAN_DEVICE_TABLE_ENTRY_TYPE_BRIEF : CMBS_HAN_DEVICE_TABLE_ENTRY_TYPE_EXTENDED, CMBS_IE_HAN_TABLE_ENTRY_TYPE);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_DEVICE_READ_TABLE,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_device_ReadExtendedDeviceTablePhase2 (void *pv_AppRefHandle, u16 u16_NumOfEntries, u16 u16_IndexOfFirstEntry)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_ShortValueAdd(p_List,u16_NumOfEntries, CMBS_IE_HAN_NUM_OF_ENTRIES);
cmbs_api_ie_ShortValueAdd(p_List,u16_IndexOfFirstEntry, CMBS_IE_HAN_INDEX_1ST_ENTRY);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_DEVICE_READ_EXTENDED_TABLE_PHASE_2, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_device_ReadBlackListedDeviceTable (void *pv_AppRefHandle, u16 u16_NumOfEntries, u16 u16_IndexOfFirstEntry)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_ShortValueAdd(p_List,u16_NumOfEntries, CMBS_IE_HAN_NUM_OF_ENTRIES);
cmbs_api_ie_ShortValueAdd(p_List,u16_IndexOfFirstEntry, CMBS_IE_HAN_INDEX_1ST_ENTRY);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_DEVICE_READ_BLACK_LIST_DEVICE_TABLE, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_device_WriteTable (void *pv_AppRefHandle, u16 u16_NumOfEntries, u16 u16_IndexOfFirstEntry, ST_HAN_DEVICE_ENTRY * pst_HANDeviceEntriesArray)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(u16_NumOfEntries);
UNUSED_PARAMETER(pv_AppRefHandle);
UNUSED_PARAMETER(u16_IndexOfFirstEntry);
UNUSED_PARAMETER(pst_HANDeviceEntriesArray);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_DEVICE_WRITE_TABLE,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_bind_ReadTable (void *pv_AppRefHandle, u16 u16_NumOfEntries, u16 u16_IndexOfFirstEntry)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_ShortValueAdd(p_List,u16_NumOfEntries, CMBS_IE_HAN_NUM_OF_ENTRIES);
cmbs_api_ie_ShortValueAdd(p_List,u16_IndexOfFirstEntry, CMBS_IE_HAN_INDEX_1ST_ENTRY);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_BIND_READ_TABLE,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_bind_WriteTable (void *pv_AppRefHandle, u16 u16_NumOfEntries, u16 u16_IndexOfFirstEntry, ST_HAN_BIND_ENTRY * pst_HANBindEntriesArray)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
ST_IE_HAN_BIND_ENTRIES stIe_Binds;
UNUSED_PARAMETER(pv_AppRefHandle);
stIe_Binds.u16_NumOfEntries = u16_NumOfEntries;
stIe_Binds.u16_StartEntryIndex = u16_IndexOfFirstEntry;
stIe_Binds.pst_BindEntries = pst_HANBindEntriesArray;
cmbs_api_ie_HANBindTableAdd(p_List,&stIe_Binds);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_BIND_WRITE_TABLE,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_bind_AddEntry (void *pv_AppRefHandle, PST_HAN_BIND_ENTRY pst_HANBindEntry)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANBindEntryAdd(p_List, pst_HANBindEntry);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_BIND_ADD_ENTRY, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_bind_RemoveEntry (void *pv_AppRefHandle, PST_HAN_BIND_ENTRY pst_HANBindEntry)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANBindEntryAdd(p_List, pst_HANBindEntry);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_BIND_REMOVE_ENTRY ,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_bind_ClearTable (void *pv_AppRefHandle)
{
UNUSED_PARAMETER(pv_AppRefHandle);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_BIND_CLEAR_TABLE, NULL, 0);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_group_ReadTable (void *pv_AppRefHandle, u16 u16_NumOfEntries, u16 u16_IndexOfFirstEntry, u16 u16_GroupId)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANNumOfEntriesAdd(p_List, u16_NumOfEntries);
cmbs_api_ie_HANIndex1stEntryAdd(p_List, u16_IndexOfFirstEntry);
cmbs_api_ie_HANGroupIdAdd(p_List, u16_GroupId);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_GROUP_READ_TABLE, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_group_ReadList (void *pv_AppRefHandle, u16 u16_NumOfEntries, u16 u16_IndexOfFirstEntry)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_ShortValueAdd(p_List,u16_NumOfEntries, CMBS_IE_HAN_NUM_OF_ENTRIES);
cmbs_api_ie_ShortValueAdd(p_List,u16_IndexOfFirstEntry, CMBS_IE_HAN_INDEX_1ST_ENTRY);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_GROUP_READ_LIST, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Broadcast_ReadChannelTable (void *pv_AppRefHandle, u16 u16_NumOfEntries, u16 u16_IndexOfFirstEntry)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_ShortValueAdd(p_List,u16_NumOfEntries, CMBS_IE_HAN_NUM_OF_ENTRIES);
cmbs_api_ie_ShortValueAdd(p_List,u16_IndexOfFirstEntry, CMBS_IE_HAN_INDEX_1ST_ENTRY);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_BROADCAST_READ_CHANNEL_TABLE, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_group_WriteTable (void *pv_AppRefHandle, u16 u16_NumOfEntries, u16 u16_IndexOfFirstEntry, ST_HAN_GROUP_TABLE_ENTRY * pst_HANGroupEntriesArray)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
ST_IE_HAN_GROUP_ENTRIES stIe_Groups;
UNUSED_PARAMETER(pv_AppRefHandle);
stIe_Groups.u16_NumOfEntries = u16_NumOfEntries;
stIe_Groups.u16_StartEntryIndex = u16_IndexOfFirstEntry;
stIe_Groups.pst_GroupEntries = pst_HANGroupEntriesArray;
cmbs_api_ie_HANGroupTableAdd(p_List,&stIe_Groups);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_GROUP_WRITE_TABLE,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_group_CreateGroup (void *pv_AppRefHandle, u8 u8_BroadcastChannelId)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANBroadcastChannelIdAdd(p_List, u8_BroadcastChannelId);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_GROUP_CREATE_GROUP, p_List->pu8_Buffer, p_List->u16_CurSize );
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_group_RemoveGroup (void *pv_AppRefHandle, u16 u16_GroupId )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANGroupIdAdd(p_List, u16_GroupId);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_GROUP_REMOVE_GROUP, p_List->pu8_Buffer, p_List->u16_CurSize );
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_group_AddDeviceToGroup (void *pv_AppRefHandle, u16 u16_GroupId, u16 u16_DeviceId, u8 u8_UnitId )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANGroupIdAdd(p_List, u16_GroupId);
cmbs_api_ie_HANDeviceAdd(p_List, u16_DeviceId);
cmbs_api_ie_HANUnitIdAdd(p_List, u8_UnitId);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_GROUP_ADD_DEVICE_TO_GROUP, p_List->pu8_Buffer, p_List->u16_CurSize );
}
//////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_group_RemoveDeviceFromGroup (void *pv_AppRefHandle, u16 u16_GroupId, u16 u16_DeviceId, u8 u8_UnitId )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANGroupIdAdd(p_List, u16_GroupId);
cmbs_api_ie_HANDeviceAdd(p_List, u16_DeviceId);
cmbs_api_ie_HANUnitIdAdd(p_List, u8_UnitId);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_GROUP_REMOVE_DEVICE_FROM_GROUP, p_List->pu8_Buffer, p_List->u16_CurSize );
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_msg_RecvRegister (void *pv_AppRefHandle, ST_HAN_MSG_REG_INFO * pst_HANMsgRegInfo)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HanMsgRegInfoAdd(p_List,pst_HANMsgRegInfo);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_MSG_RECV_REGISTER,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_msg_RecvUnregister (void *pv_AppRefHandle, ST_HAN_MSG_REG_INFO * pst_HANMsgRegInfo)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HanMsgRegInfoAdd(p_List,pst_HANMsgRegInfo);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_MSG_RECV_UNREGISTER,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_msg_SendTxRequest (void *pv_AppRefHandle, u16 u16_DeviceId)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANDeviceAdd(p_List,u16_DeviceId);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_MSG_SEND_TX_START_REQUEST,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_msg_SendTxEnd(void *pv_AppRefHandle, u16 u16_DeviceId)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANDeviceAdd(p_List,u16_DeviceId);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_MSG_SEND_TX_END_REQUEST,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_msg_Send (void *pv_AppRefHandle, u16 u16_RequestId, PST_IE_HAN_MSG_CTL pst_MsgCtrl, ST_IE_HAN_MSG * pst_HANMsg)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_ShortValueAdd(p_List,u16_RequestId, CMBS_IE_REQUEST_ID);
cmbs_api_ie_HANMsgAdd(p_List,pst_HANMsg);
cmbs_api_ie_HANMsgCtlAdd(p_List, pst_MsgCtrl );
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_MSG_SEND,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_raw_msg_Send (void *pv_AppRefHandle, u16 u16_RequestId, ST_IE_HAN_MSG_CTL* pst_MsgCtrl, ST_IE_DATA * pst_HANRawMsg, u16 u16_DeviceId)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_ShortValueAdd(p_List,u16_RequestId, CMBS_IE_REQUEST_ID);
cmbs_api_ie_DataAdd(p_List, pst_HANRawMsg);
cmbs_api_ie_HANDeviceAdd(p_List,u16_DeviceId);
cmbs_api_ie_HANMsgCtlAdd(p_List, pst_MsgCtrl );
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_RAW_MSG_SEND,p_List->pu8_Buffer, p_List->u16_CurSize);
}
E_CMBS_RC cmbs_dsr_han_ModificationULEPagingInterval(u16 u16_DeviceId, u32 u32_ULEPagingIntervalMs)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
cmbs_api_ie_HANDeviceAdd(p_List,u16_DeviceId);
cmbs_api_ie_HanULEPagingIntervalAdd(p_List,u32_ULEPagingIntervalMs);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_MODIFICATION_ULE_PAGING_INTERVAL,p_List->pu8_Buffer, p_List->u16_CurSize);
}
E_CMBS_RC cmbs_dsr_han_NodeSetupAttemptsEnable(bool b_enable)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
if(b_enable)
{
cmbs_api_ie_HanNodeSetupAttemptsEnableAdd(p_List,CMBS_HAN_NODE_SETUP_ATTEMPTS_ENABLE);
}
else
{
cmbs_api_ie_HanNodeSetupAttemptsEnableAdd(p_List,CMBS_HAN_NODE_SETUP_ATTEMPTS_DISABLE);
}
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_NODE_SETUP_ATTEMPTS,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_GetMaxNumOfDevices (void *pv_AppRefHandle)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
return cmbs_int_EventSend(CMBS_EV_DSR_HAN_GET_MAX_NUM_OF_DEVICES, p_List->pu8_Buffer, p_List->u16_CurSize);
}
E_CMBS_RC cmbs_dsr_han_GetNumOfRegDevices (void *pv_AppRefHandle)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
return cmbs_int_EventSend(CMBS_EV_DSR_HAN_GET_NUM_OF_REG_DEVICES, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_device_Delete (void *pv_AppRefHandle, u16 u16_DeviceId )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANDeviceAdd( p_List, u16_DeviceId );
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_DEVICE_FORCEFUL_DELETE,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_DeviceBlackListDelete(void *pv_AppRefHandle, u16 u16_DeviceId)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANDeviceAdd( p_List, u16_DeviceId );
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_DEVICE_BLACK_LIST_DELETE,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_send_base_updated_notification (void *pv_AppRefHandle, u16 u16_DeviceId )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANDeviceAdd( p_List, u16_DeviceId );
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_SEND_BASE_UPDATED_NOTIFICATION,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_get_fun_protocol_info (void *pv_AppRefHandle)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_GET_FUN_PROTOCOL_INFO, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_device_GetConnectionStatus (void *pv_AppRefHandle, u16 u16_DeviceId )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANDeviceAdd( p_List, u16_DeviceId );
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_DEVICE_GET_CONNECTION_STATUS ,p_List->pu8_Buffer, p_List->u16_CurSize);
}
E_CMBS_RC cmbs_dsr_han_fun_RegistationMsgRecv (void *pv_AppRefHandle, PST_FUN_DEVICE_INFO pst_FunDeviceInfo)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HanFUNDeviceInfoAdd( p_List, pst_FunDeviceInfo );
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_FUN_REG_MSG_RECV_RES, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_device_ReadDeviceRegistrationInformation (void *pv_AppRefHandle, u16 u16_DeviceId)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANDeviceAdd(p_List,u16_DeviceId);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_DEVICE_MANGER_READ_DEVICE_SUB_INFO,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_device_ReadDeviceRegistrationInformationPhase2 (void *pv_AppRefHandle, u16 u16_DeviceId)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANDeviceAdd(p_List,u16_DeviceId);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_DEVICE_MANGER_READ_DEVICE_SUB_INFO_PHASE_2,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Logger_SetLogLevel (void *pv_AppRefHandle, u8 u8_LogLevel)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANLogLevelAdd(p_List,u8_LogLevel);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_SET_LOG_LEVEL,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Logger_GetLogLevel (void *pv_AppRefHandle)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_GET_LOG_LEVEL,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_device_ReadDeviceFullRegistrationInfo (void *pv_AppRefHandle, u16 u16_DeviceId)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_ShortValueAdd(p_List,u16_DeviceId, CMBS_IE_HAN_DEVICE);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_DEVICE_MANGER_READ_DEVICE_FULL_REGISTRATION_INFO,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_device_WriteDeviceFullRegistrationInfo (void *pv_AppRefHandle, u16 u16_DeviceId, ST_HAN_FULL_DEVICE_REGISTRATION_INFO *pst_DeviceRegistrationInfo)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_ShortValueAdd(p_List,u16_DeviceId, CMBS_IE_HAN_DEVICE);
cmbs_api_ie_HANDeviceFullRegistrationInfoAdd(p_List ,pst_DeviceRegistrationInfo);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_DEVICE_MANGER_WRITE_DEVICE_FULL_REGISTRATION_INFO, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_logger_Control (void *pv_AppRefHandle, bool b_enable)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
if (b_enable)
{
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_GENERAL_LOGGER_ENABLED, p_List->pu8_Buffer, p_List->u16_CurSize);
}
else
{
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_GENERAL_LOGGER_DISABLED, p_List->pu8_Buffer, p_List->u16_CurSize);
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_cp_logger_Control (void *pv_AppRefHandle, bool b_enable)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
if (b_enable)
{
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_CP_LOGGER_ENABLED, p_List->pu8_Buffer, p_List->u16_CurSize);
}
else
{
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_CP_LOGGER_DISABLED, p_List->pu8_Buffer, p_List->u16_CurSize);
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Certification_MarkCcmKeyAsUsed(void *pv_AppRefHandle, u16 u16_DeviceNumber , u8 u8_CCMKeyUsed)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANCertificationOperationAdd(p_List, (u8) CMBS_HAN_ULE_DEVICE_CERTIFICATION_OPERATION_MARK_CCM_KEY_AS_USED);
cmbs_api_ie_HANDeviceAdd(p_List, u16_DeviceNumber);
cmbs_api_ie_HANCcmKeyAsUsedAdd(p_List, u8_CCMKeyUsed);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_CERTIFICATION_OPERATION_REQ, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Certification_SetTxMicCorruptNum(void *pv_AppRefHandle,u16 u16_DeviceNumber)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANCertificationOperationAdd(p_List, (u8) CMBS_HAN_ULE_DEVICE_CERTIFICATION_OPERATION_SET_TX_MIC_CORRUPTION_NUMBER);
cmbs_api_ie_HANDeviceAdd(p_List, u16_DeviceNumber);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_CERTIFICATION_OPERATION_REQ, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Certification_SetTxSeqNum(void *pv_AppRefHandle, u16 u16_DeviceNumber, u16 u16_TxSequenceNumber )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANCertificationOperationAdd(p_List, (u8) CMBS_HAN_ULE_DEVICE_CERTIFICATION_OPERATION_SET_TX_SEQUENCE_NUMBER);
cmbs_api_ie_HANDeviceAdd(p_List, u16_DeviceNumber);
cmbs_api_ie_HANTxSequenceNumberAdd(p_List, u16_TxSequenceNumber);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_CERTIFICATION_OPERATION_REQ, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Certification_GetTxSeqNum(void *pv_AppRefHandle, u16 u16_DeviceNumber)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANCertificationOperationAdd(p_List, (u8) CMBS_HAN_ULE_DEVICE_CERTIFICATION_OPERATION_GET_TX_SEQUENCE_NUMBER);
cmbs_api_ie_HANDeviceAdd(p_List, u16_DeviceNumber);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_CERTIFICATION_OPERATION_REQ, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Certification_GetRxSeqNum(void *pv_AppRefHandle, u16 u16_DeviceNumber)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANCertificationOperationAdd(p_List, (u8) CMBS_HAN_ULE_DEVICE_CERTIFICATION_OPERATION_GET_RX_SEQUENCE_NUMBER);
cmbs_api_ie_HANDeviceAdd(p_List, u16_DeviceNumber);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_CERTIFICATION_OPERATION_REQ, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Certification_SetTxAckDropNum(void *pv_AppRefHandle, u16 u16_TxAckDropNumber)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANCertificationOperationAdd(p_List, (u8) CMBS_HAN_ULE_DEVICE_CERTIFICATION_OPERATION_SET_TX_ACK_DROP_NUMBER);
cmbs_api_ie_HANTxAckDropNumberAdd(p_List, u16_TxAckDropNumber);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_CERTIFICATION_OPERATION_REQ, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Certification_SetPvcState(void *pv_AppRefHandle, u16 u16_DeviceNumber, u8 u8_PVCState )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANCertificationOperationAdd(p_List, (u8) CMBS_HAN_ULE_DEVICE_CERTIFICATION_OPERATION_SET_PVC_STATE);
cmbs_api_ie_HANDeviceAdd(p_List, u16_DeviceNumber);
cmbs_api_ie_HANPvcStateAdd(p_List, u8_PVCState);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_CERTIFICATION_OPERATION_REQ, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_SetRxGain(void *pv_AppRefHandle, u8 u8_RxGainVal )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANRxGainAdd(p_List, u8_RxGainVal);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_SET_RX_GAIN, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_GetRxGain(void *pv_AppRefHandle)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_GET_RX_GAIN, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_SendPvcResetReq(void *pv_AppRefHandle, u16 u16_DeviceNumber)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
cmbs_api_ie_HANDeviceAdd(p_List, u16_DeviceNumber);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_PVC_RESET_REQ, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_GetPvcResetReqState(void *pv_AppRefHandle, u16 u16_DeviceNumber)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
cmbs_api_ie_HANDeviceAdd(p_List, u16_DeviceNumber);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_PVC_RESET_REQ_STATE, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_NotifyOnVoiceCall (void *pv_AppRefHandle, u16 u16_DeviceId)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANDeviceAdd(p_List,u16_DeviceId);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_NOTIFY_ON_VOICE_CALL_REQUEST,
p_List->pu8_Buffer,
p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_TBR6SendPM(void *pv_AppRefHandle, u8 u8_Carrier , u32 u32_Period )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANTBR6CarrierAdd(p_List, u8_Carrier);
cmbs_api_ie_HANTBR6PeriodAdd(p_List, u32_Period);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_TBR6_SEND_PM, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_TBR6SetGUCI(void *pv_AppRefHandle, u8 * pu8_IPUI )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANULEDeviceIPUIAdd(p_List, (ST_IE_HAN_ULE_DEVICE_IPUI *)pu8_IPUI);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_TBR6_SET_GUCI, p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_TBR6ResetStatistics (void *pv_AppRefHandle)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_TBR6_RESET_STATISTICS,p_List->pu8_Buffer, p_List->u16_CurSize);
}
E_CMBS_RC cmbs_dsr_han_UpdateDevicePMSeqNumbers (void *pv_AppRefHandle, u16 u16_DeviceId , u16 u16_RxSeqNum, u16 u16_TxSeqNum)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANDeviceAdd( p_List, u16_DeviceId );
cmbs_api_ie_HANRxSequenceNumberAdd (p_List,u16_RxSeqNum);
cmbs_api_ie_HANTxSequenceNumberAdd (p_List,u16_TxSeqNum);
return cmbs_int_EventSend( CMBS_EV_DSR_UPDATE_DEVICE_PM_SEQ_NUMBERS,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Start_Vbs(void * pv_AppRefHandle, u16 u16_GroupId)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANGroupIdAdd(p_List,u16_GroupId);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_START_VBS,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Stop_Vbs(void * pv_AppRefHandle, u16 u16_GroupId, PST_IE_MEDIA_CHANNEL pst_MediaChannel)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANGroupIdAdd(p_List,u16_GroupId);
if (pst_MediaChannel->u32_ChannelID != 0xFF)
{
cmbs_api_ie_MediaChannelAdd(p_List, pst_MediaChannel);
}
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_STOP_VBS,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Read_Broadcast_Channel_Type(void * pv_AppRefHandle, u8 u8_BroadcastChannelId)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANBroadcastChannelIdAdd(p_List,u8_BroadcastChannelId);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_READ_BROADCAST_CHANNEL_TYPE,p_List->pu8_Buffer, p_List->u16_CurSize);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
E_CMBS_RC cmbs_dsr_han_Read_Device_VBS_Capabilties(void * pv_AppRefHandle, u16 u16_DeviceId)
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER(pv_AppRefHandle);
cmbs_api_ie_HANDeviceAdd(p_List,u16_DeviceId);
return cmbs_int_EventSend( CMBS_EV_DSR_HAN_READ_DEVICE_VBS_CAPABILITIES,p_List->pu8_Buffer, p_List->u16_CurSize);
}
/*---------[End Of File]---------------------------------------------------------------------------------------------------------------------------*/

1994
dectmngr/src/cmbs/cmbs_han.h Executable file

File diff suppressed because it is too large Load Diff

2237
dectmngr/src/cmbs/cmbs_han_ie.c Executable file

File diff suppressed because it is too large Load Diff

218
dectmngr/src/cmbs/cmbs_han_ie.h Executable file
View File

@@ -0,0 +1,218 @@
/*!
* \file cmbs_han_ie.h
* \brief Information Elements List functions for HAN
* \author andriig
*
* @(#) %filespec: cmbs_han_ie.h~ILD53#3 %
*
*******************************************************************************/
#if !defined( CMBS_HAN_IE_H )
#define CMBS_HAN_IE_H
#include "cmbs_han.h" /* CMBS HAN API definition */
#include "cmbs_fun.h"
E_CMBS_RC cmbs_api_ie_HanCfgAdd( void * pv_RefIEList, ST_IE_HAN_CONFIG* pst_Cfg);
E_CMBS_RC cmbs_api_ie_HanCfgGet( void * pv_RefIEList, ST_IE_HAN_CONFIG* pst_Cfg);
E_CMBS_RC cmbs_api_ie_HanUleBaseInfoAdd( void * pv_RefIEList, ST_IE_HAN_BASE_INFO* pst_HanBaseInfo);
E_CMBS_RC cmbs_api_ie_HanUleBaseInfoGet( void * pv_RefIEList, ST_IE_HAN_BASE_INFO* pst_HanBaseInfo);
E_CMBS_RC cmbs_api_ie_HANDeviceSubInfoAdd( void * pv_RefIEList, ST_HAN_EXTENDED_DEVICE_INFO * pst_HANExtendedDeviceEntry);
E_CMBS_RC cmbs_api_ie_HANDeviceSubInfoGet( void * pv_RefIEList, ST_HAN_EXTENDED_DEVICE_INFO * pst_HANExtendedDeviceEntry);
E_CMBS_RC cmbs_api_ie_HANDeviceTableBriefAdd ( void * pv_RefIEList, ST_IE_HAN_BRIEF_DEVICE_ENTRIES* pst_HanDeviceEntries);
E_CMBS_RC cmbs_api_ie_HANDeviceTableBriefGet (void * pv_RefIE, ST_IE_HAN_BRIEF_DEVICE_ENTRIES * pst_HANDeviceTable);
E_CMBS_RC cmbs_api_ie_HANDeviceTableExtendedAdd ( void * pv_RefIEList, ST_IE_HAN_EXTENDED_DEVICE_ENTRIES* pst_HANExtendedDeviceEntries);
E_CMBS_RC cmbs_api_ie_HANDeviceTableExtendedGet (void * pv_RefIE, ST_IE_HAN_EXTENDED_DEVICE_ENTRIES* pst_HANExtendedDeviceEntries);
E_CMBS_RC cmbs_api_ie_HANRegStage1OKResParamsAdd ( void * pv_RefIEList, ST_HAN_REG_STAGE_1_STATUS* pst_RegStatus);
E_CMBS_RC cmbs_api_ie_HANRegStage1OKResParamsGet (void * pv_RefIE, ST_HAN_REG_STAGE_1_STATUS* pst_RegStatus);
E_CMBS_RC cmbs_api_ie_HANRegStage2OKResParamsAdd ( void * pv_RefIEList,ST_HAN_REG_STAGE_2_STATUS* pst_RegStatus);
E_CMBS_RC cmbs_api_ie_HANRegStage2OKResParamsGet (void * pv_RefIE, ST_HAN_REG_STAGE_2_STATUS* pst_RegStatus);
E_CMBS_RC cmbs_api_ie_HANBindTableAdd ( void * pv_RefIEList, ST_IE_HAN_BIND_ENTRIES* pst_HanBinds);
E_CMBS_RC cmbs_api_ie_HANBindTableGet (void * pv_RefIE, ST_IE_HAN_BIND_TABLE * pst_HANBindTable);
E_CMBS_RC cmbs_api_ie_HANGroupTableAdd ( void * pv_RefIEList, ST_IE_HAN_GROUP_ENTRIES* pst_HanGroups);
E_CMBS_RC cmbs_api_ie_HANGroupTableGet (void * pv_RefIE, ST_IE_HAN_GROUP_TABLE * pst_HANGroupTable);
E_CMBS_RC cmbs_api_ie_HanMsgRegInfoAdd ( void * pv_RefIEList, ST_HAN_MSG_REG_INFO * pst_HANMsgRegInfo);
E_CMBS_RC cmbs_api_ie_HanMsgRegInfoGet ( void * pv_RefIEList, ST_HAN_MSG_REG_INFO * pst_HANMsgRegInfo);
E_CMBS_RC cmbs_api_ie_HANMsgAdd ( void * pv_RefIE, ST_IE_HAN_MSG * pst_HANMsg);
E_CMBS_RC cmbs_api_ie_HANMsgGet (void * pv_RefIE, ST_IE_HAN_MSG * pst_HANMsg);
E_CMBS_RC cmbs_api_ie_HANDeviceAdd (void * pv_RefIE, u16 pu16_HANDevice);
E_CMBS_RC cmbs_api_ie_HANDeviceGet (void * pv_RefIE, u16* pu16_HANDevice);
E_CMBS_RC cmbs_api_ie_HANSendErrorReasonAdd (void * pv_RefIE, u16 u16_Reason);
E_CMBS_RC cmbs_api_ie_HANSendErrorReasonGet (void * pv_RefIE, u16* pu16_Reason);
E_CMBS_RC cmbs_api_ie_HANTxEndedReasonAdd (void * pv_RefIE, u16 u16_Reason);
E_CMBS_RC cmbs_api_ie_HANTxEndedReasonGet (void * pv_RefIE, u16* pu16_Reason);
E_CMBS_RC cmbs_api_ie_HANNumOfEntriesAdd( void * pv_RefIEList, u16 u16_NumOfEntries);
E_CMBS_RC cmbs_api_ie_HANNumOfEntriesGet( void * pv_RefIEList, u16 * pu16_NumOfEntries);
E_CMBS_RC cmbs_api_ie_HANIndex1stEntryAdd( void * pv_RefIEList, u16 u16_IndexOfFirstEntry);
E_CMBS_RC cmbs_api_ie_HANIndex1stEntryGet( void * pv_RefIEList, u16 * pu16_IndexOfFirstEntry);
E_CMBS_RC cmbs_api_ie_HANTableUpdateInfoAdd (void * pv_RefIE, ST_IE_HAN_TABLE_UPDATE_INFO * pst_HANTableUpdateInfo);
E_CMBS_RC cmbs_api_ie_HANTableUpdateInfoGet (void * pv_RefIE, ST_IE_HAN_TABLE_UPDATE_INFO * pst_HANTableUpdateInfo);
E_CMBS_RC cmbs_api_ie_HANGeneralStatusAdd( void * pv_RefIEList, ST_HAN_GENERAL_STATUS* pst_Status);
E_CMBS_RC cmbs_api_ie_HANGeneralStatusGet( void * pv_RefIEList, ST_HAN_GENERAL_STATUS* pst_Status);
E_CMBS_RC cmbs_api_ie_HANUnknownDeviceContactedParamsAdd( void * pv_RefIEList, ST_HAN_UNKNOWN_DEVICE_CONTACT_PARAMS* pst_Params);
E_CMBS_RC cmbs_api_ie_HANUnknownDeviceContactedParamsGet( void * pv_RefIEList, ST_HAN_UNKNOWN_DEVICE_CONTACT_PARAMS* pst_Params);
E_CMBS_RC cmbs_api_ie_HANConnectionStatusAdd (void * pv_RefIE, u16 pu16_ConnectionStatus);
E_CMBS_RC cmbs_api_ie_HANConnectionStatusGet (void * pv_RefIE, u16* pu16_ConnectionStatus);
E_CMBS_RC cmbs_api_ie_HANForcefulDeRegErrorReasonAdd (void * pv_RefIE, u16 u16_Reason);
E_CMBS_RC cmbs_api_ie_HANForcefulDeRegErrorReasonGet (void * pv_RefIE, u16* pu16_Reason);
E_CMBS_RC cmbs_api_ie_HANRegErrorReasonAdd (void * pv_RefIE, u16 u16_Reason);
E_CMBS_RC cmbs_api_ie_HANRegErrorReasonGet (void * pv_RefIE, u16* pu16_Reason);
E_CMBS_RC cmbs_api_ie_HANReqIDAdd (void * pv_RefIE, u16 u16_RequestID );
E_CMBS_RC cmbs_api_ie_HANReqIDGet (void * pv_RefIE, u16* pu16_RequestID);
E_CMBS_RC cmbs_api_ie_HANMsgCtlAdd (void * pv_RefIE, PST_IE_HAN_MSG_CTL pst_MessageControl);
E_CMBS_RC cmbs_api_ie_HANMsgCtlGet (void * pv_RefIE, PST_IE_HAN_MSG_CTL pst_MessageControl);
E_CMBS_RC cmbs_api_ie_HanFUNDeviceInfoAdd( void * pv_RefIEList, ST_FUN_DEVICE_INFO* FunDevInfo);
E_CMBS_RC cmbs_api_ie_HanFUNDeviceInfoGet( void * pv_RefIEList, ST_FUN_DEVICE_INFO* FunDevInfo);
E_CMBS_RC cmbs_api_ie_HANBindEntryAdd ( void * pv_RefIEList, PST_HAN_BIND_ENTRY pst_HANBindEntry);
E_CMBS_RC cmbs_api_ie_HANBindEntryGet ( void * pv_RefIEList, PST_HAN_BIND_ENTRY pst_HANBindEntry);
E_CMBS_RC cmbs_api_ie_HANTxReqResReasonAdd (void * pv_RefIE, u16 u16_TxReqResReason);
E_CMBS_RC cmbs_api_ie_HANTxReqResReasonGet (void * pv_RefIE, u16* pu16_TxReqResReason);
E_CMBS_RC cmbs_api_ie_HANLogLevelAdd (void * pv_RefIE, u8 u8_LogLevel);
E_CMBS_RC cmbs_api_ie_HANLogLevelGet (void * pv_RefIE, u8 *pu8_LogLevel);
E_CMBS_RC cmbs_api_ie_HANCertificationOperationAdd (void * pv_RefIE, u8 u8_CertificationOperationValue);
E_CMBS_RC cmbs_api_ie_HANCertificationOperationGet (void * pv_RefIE, u8 *pu8_CertificationOperationValue);
E_CMBS_RC cmbs_api_ie_HANCcmKeyAsUsedAdd(void * pv_RefIE, u8 u8_CcmKeyUsed);
E_CMBS_RC cmbs_api_ie_HANCcmKeyAsUsedGet(void * pv_RefIE, u8 *pu8_CcmKeyUsed);
E_CMBS_RC cmbs_api_ie_HANRxSequenceNumberAdd(void * pv_RefIE, u16 u16_RxSequenceNumber);
E_CMBS_RC cmbs_api_ie_HANRxSequenceNumberGet (void * pv_RefIE, u16 *pu16_RxSequenceNumber);
E_CMBS_RC cmbs_api_ie_HANTxSequenceNumberAdd(void * pv_RefIE, u16 u16_TxSequenceNumber);
E_CMBS_RC cmbs_api_ie_HANTxSequenceNumberGet (void * pv_RefIE, u16 *pu16_TxSequenceNumber);
E_CMBS_RC cmbs_api_ie_HANTxAckDropNumberAdd(void * pv_RefIE, u16 u16_TxAckDropNumber);
E_CMBS_RC cmbs_api_ie_HANTxAckDropNumberGet(void * pv_RefIE, u16 *pu16_TxAckDropNumber);
E_CMBS_RC cmbs_api_ie_HANPvcStateAdd(void * pv_RefIE, u8 u8_PVCState);
E_CMBS_RC cmbs_api_ie_HANPvcStateGet (void * pv_RefIE, u8 *pu8_PVCState);
E_CMBS_RC cmbs_api_ie_HANRxGainGet (void * pv_RefIE, u8 *pu8_RxGain);
E_CMBS_RC cmbs_api_ie_HANRxGainAdd (void * pv_RefIE, u8 u8_RxGain);
E_CMBS_RC cmbs_api_ie_HANDeviceFullRegistrationInfoAdd( void * pv_RefIEList, ST_HAN_FULL_DEVICE_REGISTRATION_INFO* pst_HANCompleteRegistrationDeviceEntry);
E_CMBS_RC cmbs_api_ie_HANDeviceFullRegistrationInfoGet( void * pv_RefIEList, ST_HAN_FULL_DEVICE_REGISTRATION_INFO* pst_HANCompleteRegistrationDeviceEntry);
E_CMBS_RC cmbs_api_ie_HANReadDeviceFullRegInfoResReasonAdd (void * pv_RefIE, u8 u8_ReadDeviceFullRegInfoResReason);
E_CMBS_RC cmbs_api_ie_HANReadDeviceFullRegInfoResReasonGet (void * pv_RefIE, u8 * pu8_ReadDeviceFullRegInfoResReason);
E_CMBS_RC cmbs_api_ie_HANTBR6CarrierGet (void * pv_RefIE, u8 *pu8_TBR6Carrier);
E_CMBS_RC cmbs_api_ie_HANTBR6CarrierAdd (void * pv_RefIE, u8 u8_TBR6Carrier);
E_CMBS_RC cmbs_api_ie_HANTBR6PeriodGet (void * pv_RefIE, u32 *pu32_TBR6Period);
E_CMBS_RC cmbs_api_ie_HANTBR6PeriodAdd (void * pv_RefIE, u32 u32_TBR6Period);
E_CMBS_RC cmbs_api_ie_HANULEDeviceIPUIAdd ( void * pv_RefIEList, ST_IE_HAN_ULE_DEVICE_IPUI* pst_Ipui);
E_CMBS_RC cmbs_api_ie_HANULEDeviceIPUIGet (void * pv_RefIE,ST_IE_HAN_ULE_DEVICE_IPUI* pst_Ipui);
E_CMBS_RC cmbs_api_ie_HANULETBR6StatisticsAdd (void * pv_RefIE,ST_IE_HAN_ULE_TBR6_STATISTICS * p_cp_st_ULETBR6Stats);
E_CMBS_RC cmbs_api_ie_HANULETBR6StatisticsGet (void * pv_RefIE,ST_IE_HAN_ULE_TBR6_STATISTICS * p_cp_st_ULETBR6Stats);
E_CMBS_RC cmbs_api_ie_HANCarrierGet (void * pv_RefIE, u8 *pu8_Carrier);
E_CMBS_RC cmbs_api_ie_HANCarrierAdd (void * pv_RefIE, u8 u8_Carrier);
E_CMBS_RC cmbs_api_ie_HANSlotGet (void * pv_RefIE, u8 *pu8_Slot);
E_CMBS_RC cmbs_api_ie_HANSlotAdd (void * pv_RefIE, u8 u8_Slot);
E_CMBS_RC cmbs_api_ie_HanReqFailureReasonGet (void * pv_RefIE, u8 *u8_Reason);
E_CMBS_RC cmbs_api_ie_HanReqFailureReasonAdd (void * pv_RefIE, u8 u8_Reason);
E_CMBS_RC cmbs_api_ie_HanULEPagingIntervalGet (void * pv_RefIE, u32 *u32_ULEPagingInterval);
E_CMBS_RC cmbs_api_ie_HanULEPagingIntervalAdd (void * pv_RefIE, u32 u32_ULEPagingInterval);
E_CMBS_RC cmbs_api_ie_HanULEPagingIntervalModificationFailureReasonGet (void * pv_RefIE, u8 *u8_Reason);
E_CMBS_RC cmbs_api_ie_HanULEPagingIntervalModificationFailureReasonAdd (void * pv_RefIE, u8 u8_Reason);
E_CMBS_RC cmbs_api_ie_HanNodeSetupAttemptsEnableGet (void * pv_RefIE, u8 *u8_Enable);
E_CMBS_RC cmbs_api_ie_HanNodeSetupAttemptsEnableAdd (void * pv_RefIE, u8 u8_Enable);
E_CMBS_RC cmbs_api_ie_HanDeviceLinkReleaseReasonGet (void * pv_RefIE, u8 *pu8_ReleaseReason);
E_CMBS_RC cmbs_api_ie_HanDeviceLinkReleaseReasonAdd (void * pv_RefIE, u8 u8_ReleaseReason);
E_CMBS_RC cmbs_api_ie_HanMaxNumOfDevicesGet (void * pv_RefIE, u16 *pu16_MaxNumOfDevices);
E_CMBS_RC cmbs_api_ie_HanMaxNumOfDevicesAdd (void * pv_RefIE, u16 u16_MaxNumOfDevices);
E_CMBS_RC cmbs_api_ie_HanNumOfRegDevicesGet(void * pv_RefIE, u16 * pu16_NumOfRegDevices);
E_CMBS_RC cmbs_api_ie_HanNumOfRegDevicesAdd(void * pv_RefIE, u16 u16_NumOfRegDevices);
E_CMBS_RC cmbs_api_ie_HANGroupIdAdd (void * pv_RefIE, u16 u16_GroupId);
E_CMBS_RC cmbs_api_ie_HANGroupIdGet (void * pv_RefIE, u16* pu16_GroupId);
E_CMBS_RC cmbs_api_ie_HANGroupCommandFailureReasonAdd (void * pv_RefIE, u8 u8_GroupCommandFailReason);
E_CMBS_RC cmbs_api_ie_HANGroupCommandFailureReasonGet (void * pv_RefIE, u8* pu8_GroupCommandFailReason);
E_CMBS_RC cmbs_api_ie_HANUnitIdAdd (void * pv_RefIE, u8 pu8_UnitId);
E_CMBS_RC cmbs_api_ie_HANUnitIdGet (void * pv_RefIE, u8* pu8_UnitId);
E_CMBS_RC cmbs_api_ie_HANGroupListAdd ( void * pv_RefIEList, ST_IE_HAN_GROUP_LIST_ENTRIES* pst_HanGroupList);
E_CMBS_RC cmbs_api_ie_HANGroupListGet ( void * pv_RefIEList, ST_IE_HAN_GROUP_LIST_ENTRIES* pst_HanGroupList);
E_CMBS_RC cmbs_api_ie_HANMsgRSSIAdd ( void * pv_RefIE, u8 u8_RSSI);
E_CMBS_RC cmbs_api_ie_HANMsgRSSIGet ( void * pv_RefIE, u8* u8_RSSI);
E_CMBS_RC cmbs_api_ie_HANDeviceBlackListDeleteErrorReasonAdd (void * pv_RefIE, u16 u16_Reason);
E_CMBS_RC cmbs_api_ie_HANDeviceBlackListDeleteErrorReasonGet (void * pv_RefIE, u16* pu16_Reason);
E_CMBS_RC cmbs_api_ie_HANUleCapabilitiesAdd (void * pv_RefIE, u16 u16_UleCapabilities);
E_CMBS_RC cmbs_api_ie_HANUleCapabilitiesGet (void * pv_RefIE, u16* pu16_UleCapabilities);
E_CMBS_RC cmbs_api_ie_HANBroadcastChannelIdGet (void * pv_RefIE, u8 *pu8_BroadcastChannelId);
E_CMBS_RC cmbs_api_ie_HANBroadcastChannelIdAdd (void * pv_RefIE, u8 u8_BroadcastChannelId);
E_CMBS_RC cmbs_api_ie_HANBroadcastChannelTableAdd ( void * pv_RefIEList, ST_IE_HAN_BROADCAST_CHANNEL_ENTRIES* pst_BroadcastChannelTable);
E_CMBS_RC cmbs_api_ie_HANBroadcastChannelTableGet ( void * pv_RefIEList, ST_IE_HAN_BROADCAST_CHANNEL_ENTRIES* pst_BroadcastChannelTable);
E_CMBS_RC cmbs_api_ie_HANPvcResetReqFailureReasonGet (void * pv_RefIE, u8 *pu8_PvcResetReqFailureReason);
E_CMBS_RC cmbs_api_ie_HANPvcResetReqFailureReasonAdd (void * pv_RefIE, u8 u8_PvcResetReqFailureReason);
E_CMBS_RC cmbs_api_ie_HANPvcResetReqStateFailureReasonGet (void * pv_RefIE, u8 *pu8_PvcResetReqStateFailureReason);
E_CMBS_RC cmbs_api_ie_HANPvcResetReqStateFailureReasonAdd (void * pv_RefIE, u8 u8_PvcResetReqStateFailureReason);
E_CMBS_RC cmbs_api_ie_HANPvcResetReqStateGet (void * pv_RefIE, u8 *pu8_PvcResetReqState);
E_CMBS_RC cmbs_api_ie_HANPvcResetReqStateAdd (void * pv_RefIE, u8 u8_PvcResetReqState);
E_CMBS_RC cmbs_api_ie_HANDeviceTableExtendedPhase2Get( void * pv_RefIEList,ST_IE_HAN_EXTENDED_DEVICE_PHASE_2_ENTRIES* pst_HANExtendedDeviceEntries);
E_CMBS_RC cmbs_api_ie_HANDeviceTableExtendedPhase2Add( void * pv_RefIEList, ST_IE_HAN_EXTENDED_DEVICE_PHASE_2_ENTRIES* pst_HANExtendedDeviceEntries);
E_CMBS_RC cmbs_api_ie_HANDeviceSubInfoPhase2Add( void * pv_RefIEList, ST_HAN_EXTENDED_DEVICE_INFO_PHASE_2 * pst_HANExtendedDeviceEntry);
E_CMBS_RC cmbs_api_ie_HANDeviceSubInfoPhase2Get( void * pv_RefIEList, ST_HAN_EXTENDED_DEVICE_INFO_PHASE_2 * pst_HANExtendedDeviceEntry);
E_CMBS_RC cmbs_api_ie_HANDeviceVBSCapAdd (void * pv_RefIE, u8 u8_VbsCap);
E_CMBS_RC cmbs_api_ie_HANDeviceVBSCapGet (void * pv_RefIE, u8* pu8_VbsCap);
E_CMBS_RC cmbs_api_ie_HANBroadcastChannelTypeGet (void * pv_RefIE, u8 *pu8_BroadcastChannelType);
E_CMBS_RC cmbs_api_ie_HANBroadcastChannelTypeAdd (void * pv_RefIE, u8 u8_BroadcastChannelType);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#endif // CMBS_HAN_IE_H

4398
dectmngr/src/cmbs/cmbs_ie.c Executable file

File diff suppressed because it is too large Load Diff

362
dectmngr/src/cmbs/cmbs_ie.h Executable file
View File

@@ -0,0 +1,362 @@
/*!
* \file cmbs_ie.h
* \brief Information Elements List functions
* \author andriig
*
* @(#) %filespec: cmbs_ie.h~7 %
*
*******************************************************************************/
#if !defined( CMBS_IE_H )
#define CMBS_IE_H
#include "cmbs_api.h" /* CMBS API definition */
/* Allocate IE list and verify it */
#define ALLOCATE_IE_LIST(p_List) \
p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList(); \
if(!p_List) \
return CMBS_RC_ERROR_OUT_OF_MEM;
/* Get IE type and check it */
#define CHECK_IE_TYPE(pu8_Buffer, IEType) \
{ \
u16 u16_Type = 0; \
cfr_ie_dser_u16( pu8_Buffer + CFR_IE_TYPE_POS, &u16_Type ); \
if ( IEType != u16_Type ) \
return CMBS_RC_ERROR_PARAMETER; \
}
void * cmbs_api_ie_GetList( void );
E_CMBS_RC cmbs_api_ie_DeregisterThread (u32 u32_ThreadId);
E_CMBS_RC cmbs_api_ie_GetFirst( void * pv_RefIEList, void ** ppv_RefIE, u16 * pu16_IEType );
E_CMBS_RC cmbs_api_ie_GetNext( void * pv_RefIEList, void ** ppv_RefIE, u16 * pu16_IEType );
E_CMBS_RC cmbs_api_ie_GetIE( void * pv_RefIEList, void ** ppv_RefIE, u16 pu16_IEType );
E_CMBS_RC cmbs_api_ie_ByteValueAdd( void * pv_RefIEList, u8 u8_Value, E_CMBS_IE_TYPE e_IETYPE );
E_CMBS_RC cmbs_api_ie_ByteValueGet( void * pv_RefIE, u8 * pu8_Value, E_CMBS_IE_TYPE e_IETYPE );
E_CMBS_RC cmbs_api_ie_ShortValueAdd( void * pv_RefIEList, u16 u16_Value, E_CMBS_IE_TYPE e_IETYPE );
E_CMBS_RC cmbs_api_ie_ShortValueGet( void * pv_RefIE, u16 * pu16_Value, E_CMBS_IE_TYPE e_IETYPE );
E_CMBS_RC cmbs_api_ie_u32ValueAdd( void * pv_RefIEList, u32 u32_Value, E_CMBS_IE_TYPE e_IEType );
E_CMBS_RC cmbs_api_ie_u32ValueGet( void * pv_RefIE, u32 * pu32_Value, E_CMBS_IE_TYPE e_IEType );
E_CMBS_RC cmbs_api_ie_IntValueAdd( void * pv_RefIEList, u32 u32_Value );
E_CMBS_RC cmbs_api_ie_IntValueGet( void * pv_RefIE, u32 * pu32_Value );
E_CMBS_RC cmbs_api_ie_LineIdAdd( void * pv_RefIEList, u8 u8_LineId );
E_CMBS_RC cmbs_api_ie_LineIdGet( void * pv_RefIE, u8 * pu8_LineId );
E_CMBS_RC cmbs_api_ie_MelodyAdd( void * pv_RefIEList, u8 u8_Melody );
E_CMBS_RC cmbs_api_ie_MelodyGet( void * pv_RefIE, u8 * pu8_Melody );
E_CMBS_RC cmbs_api_ie_SplashTimerAdd(void *pv_RefIEList, u8 u8_SplashTimer);
E_CMBS_RC cmbs_api_ie_SplashTimerGet(void *pv_RefIE, u8 *pu8_SplashTimer);
E_CMBS_RC cmbs_api_ie_ReconnectGet(void *pv_RefIE, u8 *pu8_Reconnect);
E_CMBS_RC cmbs_api_ie_CallInstanceAdd( void * pv_RefIEList, u32 u32_CallInstance );
E_CMBS_RC cmbs_api_ie_CallInstanceGet( void * pv_RefIE, u32 * pu32_CallInstance );
E_CMBS_RC cmbs_api_ie_RequestIdAdd( void * pv_RefIE, u16 pu16_RequestId );
E_CMBS_RC cmbs_api_ie_RequestIdGet( void * pv_RefIE, u16 * pu16_RequestId );
E_CMBS_RC cmbs_api_ie_HandsetsAdd( void * pv_RefIE, u16 u16_Handsets );
E_CMBS_RC cmbs_api_ie_HandsetsGet( void * pv_RefIE, u16 * pu16_Handsets );
E_CMBS_RC cmbs_api_ie_HsNumberAdd( void * pv_RefIEList, u8 u8_HsNumber );
E_CMBS_RC cmbs_api_ie_MaxRepSubAdd(void *pv_RefIEList, u8 u8_HsNumber);
E_CMBS_RC cmbs_api_ie_MaxRepHsSubAdd(void *pv_RefIEList, u8 u8_HsNumber);
E_CMBS_RC cmbs_api_ie_RepNumberGet(void *pv_RefIE, u8 *pu8_HsNumber);
E_CMBS_RC cmbs_api_ie_RepHsNumberGet(void *pv_RefIE, u8 *pu8_HsNumber);
E_CMBS_RC cmbs_api_ie_HsNumberGet( void * pv_RefIE, u8 * pu8_HsNumber );
E_CMBS_RC cmbs_api_ie_GpioAdd( void * pv_RefIEList, u16 u16_Gpio );
E_CMBS_RC cmbs_api_ie_GpioGet( void * pv_RefIE, u16 * pu16_Gpio );
E_CMBS_RC cmbs_api_ie_CallTransferReqAdd( void * pv_RefIEList, PST_IE_CALLTRANSFERREQ pst_CallTrf );
E_CMBS_RC cmbs_api_ie_CallTransferReqGet( void * pv_RefIE, PST_IE_CALLTRANSFERREQ pst_CallTrf );
E_CMBS_RC cmbs_api_ie_InternalCallTransferReqAdd( void * pv_RefIEList, PST_IE_INTERNAL_TRANSFER pst_InternalTransfer );
E_CMBS_RC cmbs_api_ie_InternalCallTransferReqGet( void * pv_RefIE, PST_IE_INTERNAL_TRANSFER pst_InternalTransfer );
E_CMBS_RC cmbs_api_ie_CallerPartyAdd( void * pv_RefIEList, ST_IE_CALLERPARTY * pst_CallerParty );
E_CMBS_RC cmbs_api_ie_CallerPartyGet( void * pv_RefIE, ST_IE_CALLERPARTY * pst_CallerParty );
E_CMBS_RC cmbs_api_ie_CalledPartyAdd( void * pv_RefIEList, ST_IE_CALLEDPARTY * pst_CalledParty );
E_CMBS_RC cmbs_api_ie_CalledPartyGet( void * pv_RefIE, ST_IE_CALLEDPARTY * pst_CalledParty );
E_CMBS_RC cmbs_api_ie_CallerNameAdd( void * pv_RefIEList, ST_IE_CALLERNAME * pst_CallerName );
E_CMBS_RC cmbs_api_ie_CallerNameGet( void * pv_RefIE, ST_IE_CALLERNAME * pst_CallerName );
E_CMBS_RC cmbs_api_ie_CallProgressAdd( void * pv_RefIEList, ST_IE_CALLPROGRESS * pst_CallProgress );
E_CMBS_RC cmbs_api_ie_CallProgressGet( void * pv_RefIE, ST_IE_CALLPROGRESS * pst_CallProgress );
E_CMBS_RC cmbs_api_ie_CallInfoAdd( void * pv_RefIEList, ST_IE_CALLINFO * pst_CallInfo );
E_CMBS_RC cmbs_api_ie_CallInfoGet( void * pv_RefIE, ST_IE_CALLINFO * pst_CallInfo );
E_CMBS_RC cmbs_api_ie_DisplayStringAdd( void * pv_RefIEList, ST_IE_DISPLAY_STRING * pst_DisplayString );
E_CMBS_RC cmbs_api_ie_CallReleaseReasonAdd( void * pv_RefIEList, ST_IE_RELEASE_REASON * pst_RelReason );
E_CMBS_RC cmbs_api_ie_CallReleaseReasonGet( void * pv_RefIE, ST_IE_RELEASE_REASON * pst_RelReason );
E_CMBS_RC cmbs_api_ie_CallStateGet( void * pv_RefIE, ST_IE_CALL_STATE * pst_CallState );
E_CMBS_RC cmbs_api_ie_UpdatedDeviceStateGet(void *pv_RefIE, ST_IE_UPDATED_DEVICE_STATE *st_DeviceState);
E_CMBS_RC cmbs_api_ie_DeviceListStatusGet(void *pv_RefIE, ST_IE_DEVICE_LIST_STATUS *st_DevListStatus);
E_CMBS_RC cmbs_api_ie_MediaChannelAdd( void * pv_RefIEList, ST_IE_MEDIA_CHANNEL * pst_MediaChannel );
E_CMBS_RC cmbs_api_ie_MediaChannelGet( void * pv_RefIE, ST_IE_MEDIA_CHANNEL * pst_MediaChannel );
E_CMBS_RC cmbs_api_ie_AudioShmemAdd( void * pv_RefIEList, ST_IE_AUDIO_SHMEM * pst_ShmemParams );
E_CMBS_RC cmbs_api_ie_AudioShmemGet( void * pv_RefIE, ST_IE_AUDIO_SHMEM * pst_ShmemParams );
E_CMBS_RC cmbs_api_ie_MediaICAdd( void * pv_RefIEList, ST_IE_MEDIA_INTERNAL_CONNECT * pst_MediaIC );
E_CMBS_RC cmbs_api_ie_MediaICGet( void * pv_RefIE, ST_IE_MEDIA_INTERNAL_CONNECT * pst_MediaIC );
E_CMBS_RC cmbs_api_ie_MediaDescAdd( void * pv_RefIEList, ST_IE_MEDIA_DESCRIPTOR * pst_MediaDesc );
E_CMBS_RC cmbs_api_ie_MediaDescGet( void * pv_RefIE, ST_IE_MEDIA_DESCRIPTOR * pst_MediaDesc );
E_CMBS_RC cmbs_api_ie_ToneAdd( void * pv_RefIEList, ST_IE_TONE * pst_Tone );
E_CMBS_RC cmbs_api_ie_ToneVolumeAdd(void *pv_RefIEList, u16 u16_TOGVOlume);
E_CMBS_RC cmbs_api_ie_ToneVolumeGet(void *pv_RefIE, u16 *pu16_TOGVOlume);
E_CMBS_RC cmbs_api_ie_TimeAdd( void * pv_RefIEList, ST_IE_TIMEOFDAY * pst_TimeOfDay );
E_CMBS_RC cmbs_api_ie_TimeGet( void * pv_RefIE, ST_IE_TIMEOFDAY * pst_TimeOfDay );
E_CMBS_RC cmbs_api_ie_HandsetInfoGet( void * pv_RefIE, ST_IE_HANDSETINFO * pst_HandsetInfo );
E_CMBS_RC cmbs_api_ie_ParameterGet( void * pv_RefIE, ST_IE_PARAMETER * pst_Parameter );
E_CMBS_RC cmbs_api_ie_SubscribedHSListAdd( void * pv_RefIE, ST_IE_SUBSCRIBED_HS_LIST * pst_SubscribedHsList );
E_CMBS_RC cmbs_api_ie_SubscribedHSListGet( void * pv_RefIE, ST_IE_SUBSCRIBED_HS_LIST * pst_SubscribedHsList );
E_CMBS_RC cmbs_api_ie_LAPropCmdAdd( void * pv_RefIE, ST_LA_PROP_CMD * pst_Cmd );
E_CMBS_RC cmbs_api_ie_LAPropCmdGet( void * pv_RefIE, ST_LA_PROP_CMD * pst_Cmd );
E_CMBS_RC cmbs_api_ie_LineSettingsListAdd( void * pv_RefIE, ST_IE_LINE_SETTINGS_LIST * pst_LineSettingsList );
E_CMBS_RC cmbs_api_ie_LineSettingsListGet( void * pv_RefIE, ST_IE_LINE_SETTINGS_LIST * pst_LineSettingsList );
E_CMBS_RC cmbs_api_ie_ParameterAreaGet( void * pv_RefIE, ST_IE_PARAMETER_AREA * pst_ParameterArea );
E_CMBS_RC cmbs_api_ie_FwVersionGet( void * pv_RefIE, ST_IE_FW_VERSION * pst_FwVersion );
E_CMBS_RC cmbs_api_ie_HwVersionGet( void * pv_RefIE, ST_IE_HW_VERSION * pst_HwVersion );
E_CMBS_RC cmbs_api_ie_EEPROMVersionGet( void * pv_RefIE, ST_IE_EEPROM_VERSION * pst_EEPROMVersion );
E_CMBS_RC cmbs_api_ie_SysLogGet( void * pv_RefIE, ST_IE_SYS_LOG * pst_SysLog );
E_CMBS_RC cmbs_api_ie_SysStatusGet( void * pv_RefIE, ST_IE_SYS_STATUS * pst_SysStatus );
E_CMBS_RC cmbs_api_ie_ResponseAdd( void * pv_RefIE, ST_IE_RESPONSE * pst_Response );
E_CMBS_RC cmbs_api_ie_ResponseGet( void * pv_RefIE, ST_IE_RESPONSE * pst_Response );
E_CMBS_RC cmbs_api_ie_DateTimeAdd( void * pv_RefIEList, ST_IE_DATETIME * pst_DateTime );
E_CMBS_RC cmbs_api_ie_DateTimeGet( void * pv_RefIE, ST_IE_DATETIME * pst_DateTime );
E_CMBS_RC cmbs_api_ie_DataGet( void * pv_RefIE, ST_IE_DATA * pst_Data );
E_CMBS_RC cmbs_api_ie_DataSessionIdAdd( void * pv_RefIE, u16 pu16_DataSessionId );
E_CMBS_RC cmbs_api_ie_DataSessionIdGet( void * pv_RefIE, u16 * pu16_DataSessionId );
E_CMBS_RC cmbs_api_ie_DataSessionTypeGet( void * pv_RefIE, ST_IE_DATA_SESSION_TYPE * pst_DataSessionType );
E_CMBS_RC cmbs_api_ie_LASessionIdAdd( void * pv_RefIE, u16 pu16_LASessionId );
E_CMBS_RC cmbs_api_ie_LASessionIdGet( void * pv_RefIE, u16 * pu16_LASessionId );
E_CMBS_RC cmbs_api_ie_LAListIdGet( void * pv_RefIE, u16 * pu16_LAListId );
E_CMBS_RC cmbs_api_ie_LAListIdAdd( void * pv_RefIE, u16 u16_LAListId );
E_CMBS_RC cmbs_api_ie_LAFieldsGet( void * pv_RefIE, ST_IE_LA_FIELDS * pst_LAFields );
E_CMBS_RC cmbs_api_ie_LASearchCriteriaGet( void * pv_RefIE, ST_IE_LA_SEARCH_CRITERIA * pst_LASearchCriteria );
E_CMBS_RC cmbs_api_ie_LAEntryIdGet( void * pv_RefIE, u16 * pu16_LAEntryId );
E_CMBS_RC cmbs_api_ie_LAEntryIndexGet( void * pv_RefIE, u16 * pu16_LAEntryIndex );
E_CMBS_RC cmbs_api_ie_LAEntryCountGet( void * pv_RefIE, u16 * pu16_LAEntryCount );
E_CMBS_RC cmbs_api_ie_LAIsLastGet( void * pv_RefIE, u8 * pu8_LAIsLast );
E_CMBS_RC cmbs_api_ie_ATESettingsGet( void * pv_RefIE, ST_IE_ATE_SETTINGS * pst_AteSettings );
E_CMBS_RC cmbs_api_ie_ATESettingsAdd( void * pv_RefIEList, ST_IE_ATE_SETTINGS * pst_AteSettings );
E_CMBS_RC cmbs_api_ie_ReadDirectionAdd( void * pv_RefIEList, ST_IE_READ_DIRECTION * pst_ReadDirection );
E_CMBS_RC cmbs_api_ie_ReadDirectionGet( void * pv_RefIE, ST_IE_READ_DIRECTION * pst_ReadDirection );
E_CMBS_RC cmbs_api_ie_MarkRequestAdd( void * pv_RefIEList, ST_IE_MARK_REQUEST * pst_MarkRequest );
E_CMBS_RC cmbs_api_ie_MarkRequestGet( void * pv_RefIE, ST_IE_MARK_REQUEST * pst_MarkRequest );
E_CMBS_RC cmbs_api_ie_VersionAvailAdd( void * pv_RefIEList, ST_SUOTA_UPGRADE_DETAILS* st_HSVerAvail );
E_CMBS_RC cmbs_api_ie_VersionAvailGet (void * pv_RefIEList, ST_SUOTA_UPGRADE_DETAILS* pst_HSVerAvail );
E_CMBS_RC cmbs_api_ie_VersionBufferAdd( void * pv_RefIEList, ST_VERSION_BUFFER* pst_SwVersion);
E_CMBS_RC cmbs_api_ie_VersionBufferGet( void * pv_RefIEList, ST_VERSION_BUFFER* pst_SwVersion);
E_CMBS_RC cmbs_api_ie_VersionIndGet( void * pv_RefIEList, ST_SUOTA_HS_VERSION_IND* pst_HSVerInd);
E_CMBS_RC cmbs_api_ie_VersionIndAdd( void * pv_RefIEList, ST_SUOTA_HS_VERSION_IND* st_HSVerInd);
E_CMBS_RC cmbs_api_ie_UrlAdd( void * pv_RefIEList, ST_URL_BUFFER* pst_Url);
E_CMBS_RC cmbs_api_ie_UrlGet( void * pv_RefIEList, ST_URL_BUFFER* pst_Url);
E_CMBS_RC cmbs_api_ie_NBOTACodecAdd( void *pv_RefIEList, PST_IE_NB_CODEC_OTA pst_Codec );
E_CMBS_RC cmbs_api_ie_NBOTACodecGet( void *pv_RefIE, PST_IE_NB_CODEC_OTA pst_Codec );
E_CMBS_RC cmbs_api_ie_TargetListChangeNotifAdd( void *pv_RefIEList, PST_IE_TARGET_LIST_CHANGE_NOTIF pst_Notif );
E_CMBS_RC cmbs_api_ie_TargetListChangeNotifGet( void * pv_RefIE, PST_IE_TARGET_LIST_CHANGE_NOTIF pst_Notif );
E_CMBS_RC cmbs_api_ie_DectSettingsListAdd( void * pv_RefIEList, ST_IE_DECT_SETTINGS_LIST * pst_DectSettings );
E_CMBS_RC cmbs_api_ie_DectSettingsListGet( void * pv_RefIE, ST_IE_DECT_SETTINGS_LIST * pst_DectSettings );
E_CMBS_RC cmbs_api_ie_RTPSessionInformationAdd( void * pv_RefIEList, const ST_IE_RTP_SESSION_INFORMATION * pst_RTPSessionInformation );
E_CMBS_RC cmbs_api_ie_RTPSessionInformationGet( void * pv_RefIE, ST_IE_RTP_SESSION_INFORMATION * pst_RTPSessionInformation );
E_CMBS_RC cmbs_api_ie_RTCPIntervalAdd( void * pv_RefIEList, u32 u32_RTCPInterval );
E_CMBS_RC cmbs_api_ie_RTCPIntervalGet( void * pv_RefIE, u32 * pu32_RTCPInterval );
E_CMBS_RC cmbs_api_ie_RTPDTMFEventAdd( void * pv_RefIEList, const ST_IE_RTP_DTMF_EVENT * pst_RTPDTMFEvent );
E_CMBS_RC cmbs_api_ie_RTPDTMFEventGet( void * pv_RefIE, ST_IE_RTP_DTMF_EVENT * pst_RTPDTMFEvent );
E_CMBS_RC cmbs_api_ie_RTPDTMFEventInfoAdd( void * pv_RefIEList, const ST_IE_RTP_DTMF_EVENT_INFO * pst_RTPDTMFEventInfo );
E_CMBS_RC cmbs_api_ie_RTPDTMFEventInfoGet( void * pv_RefIE, ST_IE_RTP_DTMF_EVENT_INFO * pst_RTPDTMFEventInfo );
E_CMBS_RC cmbs_api_ie_RTPFaxToneTypeAdd( void * pv_RefIEList, E_CMBS_FAX_TONE_TYPE e_FaxToneType );
E_CMBS_RC cmbs_api_ie_RTPFaxToneTypeGet( void * pv_RefIE, E_CMBS_FAX_TONE_TYPE * pe_FaxToneType );
E_CMBS_RC cmbs_api_ie_BaseNameAdd( void * pv_RefIE, ST_IE_BASE_NAME* pst_BaseName );
E_CMBS_RC cmbs_api_ie_BaseNameGet( void * pv_RefIE, ST_IE_BASE_NAME* pst_BaseName );
E_CMBS_RC cmbs_api_ie_RegCloseReasonGet(void * pv_RefIE, ST_IE_REG_CLOSE_REASON* st_Reg_Close_Reason);
E_CMBS_RC cmbs_api_ie_RegEnableTypeAdd(void *pv_RefIE, E_CMBS_HS_REGISTER_ENABLE e_RegEnable);
E_CMBS_RC cmbs_api_ie_RegEnableTypeGet(void *pv_RefIE, u8 *u8_RegEnable);
E_CMBS_RC cmbs_api_ie_DCRejectReasonGet(void * pv_RefIE, ST_IE_DC_REJECT_REASON* st_DC_Reject_Reason);
E_CMBS_RC cmbs_api_ie_DCRejectReasonAdd(void * pv_RefIE, ST_IE_DC_REJECT_REASON* st_DC_Reject_Reason);
E_CMBS_RC cmbs_api_ie_ParameterAdd( void * pv_RefIEList, ST_IE_PARAMETER * pst_Param );
E_CMBS_RC cmbs_api_ie_ParameterAreaAdd( void * pv_RefIEList, ST_IE_PARAMETER_AREA * pst_ParamArea );
E_CMBS_RC cmbs_api_ie_HandsetInfoAdd( void * pv_RefIEList, ST_IE_HANDSETINFO * pst_HandsetInfo );
E_CMBS_RC cmbs_api_ie_DisplayStringGet( void * pv_RefIE, ST_IE_DISPLAY_STRING * pst_DisplayString );
E_CMBS_RC cmbs_api_ie_ToneGet( void * pv_RefIE, ST_IE_TONE * pst_Tone );
E_CMBS_RC cmbs_api_ie_FwVersionAdd( void * pv_RefIEList, ST_IE_FW_VERSION * pst_FwVersion );
E_CMBS_RC cmbs_api_ie_EEPROMVersionAdd( void * pv_RefIEList, ST_IE_EEPROM_VERSION * pst_EEPROMVersion );
E_CMBS_RC cmbs_api_ie_HwVersionAdd( void * pv_RefIEList, ST_IE_HW_VERSION * pst_HwVersion );
E_CMBS_RC cmbs_api_ie_SysLogAdd( void * pv_RefIEList, ST_IE_SYS_LOG * pst_SysLog );
E_CMBS_RC cmbs_api_ie_SysStatusAdd( void * pv_RefIEList, ST_IE_SYS_STATUS * pst_SysStatus );
E_CMBS_RC cmbs_api_ie_GenEventAdd( void * pv_RefIEList, ST_IE_GEN_EVENT * pst_GenEvent );
E_CMBS_RC cmbs_api_ie_GenEventGet( void * pv_RefIE, ST_IE_GEN_EVENT * pst_GenEvent );
E_CMBS_RC cmbs_api_ie_PropEventAdd( void * pv_RefIEList, ST_IE_PROP_EVENT * pst_PropEvent );
E_CMBS_RC cmbs_api_ie_PropEventGet( void * pv_RefIE, ST_IE_PROP_EVENT * pst_PropEvent );
E_CMBS_RC cmbs_api_ie_PropEventNotifyAdd(void *pv_RefIEList, ST_IE_PROP_EVENT_NOTIFY *pst_PropEvent);
E_CMBS_RC cmbs_api_ie_PropEventNotifyGet(void *pv_RefIE, ST_IE_PROP_EVENT_NOTIFY *pst_PropEvent);
E_CMBS_RC cmbs_api_ie_GenEventDetailsAdd(void *pv_RefIEList, ST_IE_GEN_EVENT_DETAILS *pst_GenEventDetails);
E_CMBS_RC cmbs_api_ie_GenEventDetailsGet(void *pv_RefIE, ST_IE_GEN_EVENT_DETAILS *pst_GenEventDetails);
E_CMBS_RC cmbs_api_ie_DataSessionTypeAdd( void * pv_RefIEList, ST_IE_DATA_SESSION_TYPE * pst_DataSessionType );
E_CMBS_RC cmbs_api_ie_DataAdd( void * pv_RefIEList, ST_IE_DATA * pst_Data );
E_CMBS_RC cmbs_api_ie_CallStateAdd( void * pv_RefIEList, ST_IE_CALL_STATE * pst_CallState );
E_CMBS_RC cmbs_api_ie_LAFieldsAdd( void * pv_RefIEList, ST_IE_LA_FIELDS * pst_LAFields, E_CMBS_IE_TYPE e_IEType );
E_CMBS_RC cmbs_api_ie_LASelectionTypeAdd(void *pv_RefIE, u16 u16_SelectionType);
E_CMBS_RC cmbs_api_ie_LASelectionTypeGet(void *pv_RefIE, u16 *u16_SelectionType);
E_CMBS_RC cmbs_api_ie_LAEntryRangeAdd(void *pv_RefIEList, ST_IE_LA_ENTRY_RANGE *pst_EntryRange);
E_CMBS_RC cmbs_api_ie_LAEntryRangeGet(void *pv_RefIE, ST_IE_LA_ENTRY_RANGE *pst_EntryRange);
E_CMBS_RC cmbs_api_ie_LAEntryIdsAdd(void *pv_RefIEList, ST_IE_LA_ENTRY_IDS *pst_EntryIds);
E_CMBS_RC cmbs_api_ie_LAEntryIdsGet(void *pv_RefIE, ST_IE_LA_ENTRY_IDS *pst_EntryIds);
E_CMBS_RC cmbs_api_ie_LASearchCriteriaAdd( void * pv_RefIEList, ST_IE_LA_SEARCH_CRITERIA * pst_LASearchCriteria );
E_CMBS_RC cmbs_api_ie_RegCloseReasonAdd( void * pv_RefIEList, ST_IE_REG_CLOSE_REASON * pst_Reg_Close_Reason );
E_CMBS_RC cmbs_api_ie_UpdatedDeviceStateAdd(void *pv_RefIEList, ST_IE_UPDATED_DEVICE_STATE *st_DeviceState);
E_CMBS_RC cmbs_api_ie_DeviceListStatusAdd(void *pv_RefIEList, ST_IE_DEVICE_LIST_STATUS *st_DevListStatus);
E_CMBS_RC cmbs_api_ie_LAEntryIdAdd( void * pv_RefIE, u16 u16_LAEntryId );
E_CMBS_RC cmbs_api_ie_LAEntryIndexAdd( void * pv_RefIE, u16 u16_LAEntryIndex );
E_CMBS_RC cmbs_api_ie_LAEntryCountAdd( void * pv_RefIE, u16 u16_LAEntryCount );
E_CMBS_RC cmbs_api_ie_LAIsLastAdd( void * pv_RefIE, u8 u8_LAIsLast );
E_CMBS_RC cmbs_api_ie_LARejectReasonAdd( void * pv_RefIE, u8 u8_LARejectReason );
E_CMBS_RC cmbs_api_ie_LARejectReasonGet( void * pv_RefIE, u8 * pu8_LARejectReason );
E_CMBS_RC cmbs_api_ie_LANrOfEntriesAdd( void * pv_RefIE, u16 u16_LANrOfEntries );
E_CMBS_RC cmbs_api_ie_LANrOfEntriesGet( void * pv_RefIE, u16 * pu16_LANrOfEntries );
E_CMBS_RC cmbs_api_ie_LineSubtypeAdd( void * pv_RefIEList, u8 value );
E_CMBS_RC cmbs_api_ie_LineSubtypeGet( void * pv_RefIE, u8 * value );
E_CMBS_RC cmbs_api_ie_SuSubtypeAdd( void * pv_RefIEList, u8 value );
E_CMBS_RC cmbs_api_ie_SuSubtypeGet( void * pv_RefIE, u8 * value );
E_CMBS_RC cmbs_api_ie_NumOfUrlsAdd( void * pv_RefIEList, u8 value );
E_CMBS_RC cmbs_api_ie_NumOfUrlsGet( void * pv_RefIE, u8 * value );
E_CMBS_RC cmbs_api_ie_RejectReasonAdd( void * pv_RefIEList, u8 value );
E_CMBS_RC cmbs_api_ie_RejectReasonGet( void * pv_RefIE, u8 * value );
E_CMBS_RC cmbs_api_ie_SuotaAppIdAdd(void * pv_RefIE, u32 u32_SuotaAppId);
E_CMBS_RC cmbs_api_ie_SuotaAppIdGet(void * pv_RefIE, u32 * u32_SuotaAppId);
E_CMBS_RC cmbs_api_ie_SuotaSessionIdAdd(void * pv_RefIE, u32 u32_SuotaSessionId);
E_CMBS_RC cmbs_api_ie_SuotaSessionIdGet(void * pv_RefIE, u32 * u32_SuotaSessionId);
E_CMBS_RC cmbs_api_ie_HsPropEventAdd( void * pv_RefIEList, ST_IE_HS_PROP_EVENT * pst_Param );
E_CMBS_RC cmbs_api_ie_HsPropEventGet( void * pv_RefIE, ST_IE_HS_PROP_EVENT * pst_Parameter );
E_CMBS_RC cmbs_api_ie_SYPOSpecificationGet(void * pv_RefIE, ST_IE_SYPO_SPECIFICATION* pst_Parameter);
E_CMBS_RC cmbs_api_ie_SYPOSpecificationAdd(void * pv_RefIE, ST_IE_SYPO_SPECIFICATION * pst_Parameter);
E_CMBS_RC cmbs_api_ie_AFE_EndpointConnectionGet( void *pv_RefIE, ST_IE_AFE_ENDPOINTS_CONNECT *pst_Parameter );
E_CMBS_RC cmbs_api_ie_AFE_EndpointConnectionAdd( void *pv_RefIE, ST_IE_AFE_ENDPOINTS_CONNECT *pst_Parameter );
E_CMBS_RC cmbs_api_ie_AFE_EndpointGet( void *pv_RefIE, ST_IE_AFE_ENDPOINT *pst_Parameter );
E_CMBS_RC cmbs_api_ie_AFE_EndpointAdd( void * pv_RefIE, ST_IE_AFE_ENDPOINT * pst_Parameter );
E_CMBS_RC cmbs_api_ie_AFE_EndpointGainGet( void * pv_RefIE, ST_IE_AFE_ENDPOINT_GAIN *pst_Parameter );
E_CMBS_RC cmbs_api_ie_AFE_EndpointGainAdd( void * pv_RefIE, ST_IE_AFE_ENDPOINT_GAIN * pst_Parameter );
E_CMBS_RC cmbs_api_ie_AFE_EndpointGainDBGet( void * pv_RefIE, ST_IE_AFE_ENDPOINT_GAIN_DB * pst_Parameter );
E_CMBS_RC cmbs_api_ie_AFE_EndpointGainDBAdd( void * pv_RefIE, ST_IE_AFE_ENDPOINT_GAIN_DB * pst_Parameter );
E_CMBS_RC cmbs_api_ie_AFE_AUXMeasureSettingsGet( void * pv_RefIE, ST_IE_AFE_AUX_MEASUREMENT_SETTINGS* pst_Parameter );
E_CMBS_RC cmbs_api_ie_AFE_AUXMeasureSettingsAdd( void * pv_RefIE, ST_IE_AFE_AUX_MEASUREMENT_SETTINGS* pst_Parameter );
E_CMBS_RC cmbs_api_ie_AFE_AUXMeasureResultGet( void * pv_RefIE, ST_IE_AFE_AUX_MEASUREMENT_RESULT* pst_Parameter );
E_CMBS_RC cmbs_api_ie_AFE_AUXMeasureResultAdd( void * pv_RefIE, ST_IE_AFE_AUX_MEASUREMENT_RESULT* pst_Parameter );
E_CMBS_RC cmbs_api_ie_AFE_ResourceTypeAdd(void * pv_RefIE, u8 u8_ResourceType);
E_CMBS_RC cmbs_api_ie_AFE_ResourceTypeGet(void * pv_RefIE, u8 * u8_ResourceType);
E_CMBS_RC cmbs_api_ie_AFE_InstanceNumAdd(void * pv_RefIE, u8 u8_InstanceNum);
E_CMBS_RC cmbs_api_ie_AFE_InstanceNumGet(void * pv_RefIE, u8 * u8_InstanceNum);
E_CMBS_RC cmbs_api_ie_DHSGValueAdd(void * pv_RefIE, u8 u8_DHSGValue);
E_CMBS_RC cmbs_api_ie_DHSGValueGet(void * pv_RefIE, u8 *u8_DHSGValue);
E_CMBS_RC cmbs_api_ie_GPIOIDGet(void * pv_RefIE, PST_IE_GPIO_ID pst_GPIOID);
E_CMBS_RC cmbs_api_ie_GPIOIDAdd(void * pv_RefIE, PST_IE_GPIO_ID st_GPIOID);
E_CMBS_RC cmbs_api_ie_PWMIDAdd(void *pv_RefIE, PST_IE_PWM_ID st_PWMID);
E_CMBS_RC cmbs_api_ie_PWMIDGet(void *pv_RefIE,PST_IE_PWM_ID pst_PWMID);
E_CMBS_RC cmbs_api_ie_GPIOModeGet(void * pv_RefIE, u8 * u8_Mode);
E_CMBS_RC cmbs_api_ie_GPIOModeAdd(void * pv_RefIE, u8 u8_Mode);
E_CMBS_RC cmbs_api_ie_GPIOValueGet(void * pv_RefIE, u8 * u8_Value);
E_CMBS_RC cmbs_api_ie_GPIOValueAdd(void * pv_RefIE, u8 u8_Value);
E_CMBS_RC cmbs_api_ie_GPIOPullTypeGet(void * pv_RefIE, u8 * u8_PullType);
E_CMBS_RC cmbs_api_ie_GPIOPullTypeAdd(void * pv_RefIE, u8 u8_PullType);
E_CMBS_RC cmbs_api_ie_GPIOPullEnaGet(void * pv_RefIE, u8 * u8_PullEna);
E_CMBS_RC cmbs_api_ie_GPIOPullEnaAdd(void * pv_RefIE, u8 u8_PullEna);
E_CMBS_RC cmbs_api_ie_GPIOEnaGet(void * pv_RefIE, u8 * u8_Ena);
E_CMBS_RC cmbs_api_ie_GPIOEnaAdd(void * pv_RefIE, u8 u8_Ena);
E_CMBS_RC cmbs_api_ie_PWMEnaAdd(void *pv_RefIE, u8 u8_Ena);
E_CMBS_RC cmbs_api_ie_PWMEnaGet(void *pv_RefIE, u8 *u8_Ena);
E_CMBS_RC cmbs_api_ie_ExtIntNumGet(void * pv_RefIE, u8 * u8_IntNum);
E_CMBS_RC cmbs_api_ie_ExtIntNumAdd(void * pv_RefIE, u8 u8_IntNum);
E_CMBS_RC cmbs_api_ie_ExtIntConfigurationAdd(void * pv_RefIE, PST_IE_INT_CONFIGURATION st_INTConfiguration);
E_CMBS_RC cmbs_api_ie_ExtIntConfigurationGet(void * pv_RefIE, PST_IE_INT_CONFIGURATION st_INTConfiguration);
E_CMBS_RC cmbs_api_ie_TerminalCapabilitiesAdd(void * pv_RefIE, PST_IE_TERMINAL_CAPABILITIES pst_TermCapability);
E_CMBS_RC cmbs_api_ie_TerminalCapabilitiesGet(void * pv_RefIE, PST_IE_TERMINAL_CAPABILITIES pst_TermCapability);
E_CMBS_RC cmbs_api_ie_ChecksumErrorAdd( void * pv_RefIEList, PST_IE_CHECKSUM_ERROR pst_CheckSumError);
E_CMBS_RC cmbs_api_ie_ChecksumErrorGet( void * pv_RefIE, PST_IE_CHECKSUM_ERROR pst_CheckSumError );
E_CMBS_RC cmbs_api_ie_CallHoldReasonGet(void * pv_RefIE, PST_IE_CALL_HOLD_REASON pst_Reason);
E_CMBS_RC cmbs_api_ie_CallHoldReasonAdd(void * pv_RefIE, PST_IE_CALL_HOLD_REASON pst_Reason);
E_CMBS_RC cmbs_api_ie_SuotaFileInfoAdd(void *pv_RefIE, PST_IE_SUOTA_FILE_INFO pst_FileInfo);
E_CMBS_RC cmbs_api_ie_SuotaFileInfoGet(void *pv_RefIE, PST_IE_SUOTA_FILE_INFO pst_FileInfo);
E_CMBS_RC cmbs_api_ie_DTAMSessionIdAdd(void *pv_RefIE, u16 u16_SessionId);
E_CMBS_RC cmbs_api_ie_DTAMSessionIdGet(void *pv_RefIE, u16 *u16_SessionId);
E_CMBS_RC cmbs_api_ie_DTAMStartSessionCfmAdd(void *pv_RefIE, PST_CMBS_DTAM_START_SESSION_CFM pst_StartSessionCfm);
E_CMBS_RC cmbs_api_ie_DTAMStartSessionCfmGet(void *pv_RefIE, PST_CMBS_DTAM_START_SESSION_CFM pst_StartSessionCfm);
E_CMBS_RC cmbs_api_ie_DTAMCommandAdd(void *pv_RefIE, u8 u8_Command);
E_CMBS_RC cmbs_api_ie_DTAMCommandGet(void *pv_RefIE, u8 *u8_Command);
E_CMBS_RC cmbs_api_ie_DTAMCommandNackAdd(void *pv_RefIE, PST_CMBS_DTAM_NACK pst_CommandNack);
E_CMBS_RC cmbs_api_ie_DTAMCommandNackGet(void *pv_RefIE, PST_CMBS_DTAM_NACK pst_CommandNack);
E_CMBS_RC cmbs_api_ie_DTAMStatusAdd(void *pv_RefIE, PST_CMBS_DTAM_STATUS pst_DTAMStatus);
E_CMBS_RC cmbs_api_ie_DTAMStatusGet(void *pv_RefIE, PST_CMBS_DTAM_STATUS pst_DTAMStatus);
E_CMBS_RC cmbs_api_ie_DTAMSelectNextMsgAdd(void *pv_RefIE, u8 u8_Value);
E_CMBS_RC cmbs_api_ie_DTAMSelectNextMsgGet(void *pv_RefIE, u8 *pu8_Value);
E_CMBS_RC cmbs_api_ie_DTAMMsgTypeAdd(void *pv_RefIE, u8 u8_MsgType);
E_CMBS_RC cmbs_api_ie_DTAMMsgTypeGet(void *pv_RefIE, u8 *pu8_MsgType);
E_CMBS_RC cmbs_api_ie_DTAMMsgIdxGet(void *pv_RefIE, u8 *pu8_MsgIdx);
E_CMBS_RC cmbs_api_ie_DTAMMsgIdxAdd(void *pv_RefIE, u8 u8_MsgIdx);
E_CMBS_RC cmbs_api_ie_DTAMPlayModeAdd(void *pv_RefIE, u8 u8_PlayMode);
E_CMBS_RC cmbs_api_ie_DTAMPlayModeGet(void *pv_RefIE, u8 *pu8_PlayMode);
E_CMBS_RC cmbs_api_ie_DTAMNumOfSecAdd(void *pv_RefIE, u8 u8_NumOfSec);
E_CMBS_RC cmbs_api_ie_DTAMNumOfSecGet(void *pv_RefIE, u8 *pu8_NumOfSec);
E_CMBS_RC cmbs_api_ie_RSSIGet(void *pv_RefIE, u8 *u8_RSSI);
E_CMBS_RC cmbs_api_ie_RSSIAdd(void *pv_RefIE, u8 u8_RSSI);
E_CMBS_RC cmbs_api_ie_CallStateFilterGet(void *pv_RefIE, u8 *u8_FilterType);
E_CMBS_RC cmbs_api_ie_CallStateFilterAdd(void *pv_RefIE, u8 u8_FilterType);
E_CMBS_RC cmbs_api_ie_LineTestResultsGet(void *pv_RefIE, PST_IE_SLIC_LINE_TEST_RES pst_LineTestResults);
E_CMBS_RC cmbs_api_ie_LineTestResultsAdd(void *pv_RefIE, PST_IE_SLIC_LINE_TEST_RES pst_LineTestResults);
E_CMBS_RC cmbs_api_ie_NltCapTestResultsGet(void *pv_RefIE, PST_IE_SLIC_NLT_CAP_TEST_RES pst_NltCapTestResults);
E_CMBS_RC cmbs_api_ie_NltCapTestResultsAdd(void *pv_RefIE, PST_IE_SLIC_NLT_CAP_TEST_RES pst_NltCapTestResults);
E_CMBS_RC cmbs_api_ie_FxsHookStatusAdd(void *pv_RefIEList, ST_IE_FXS_HOOK_STATUS *pst_FxsHookStatus);
E_CMBS_RC cmbs_api_ie_FxsHookStatusGet(void *pv_RefIE, ST_IE_FXS_HOOK_STATUS *pst_FxsHookStatus);
E_CMBS_RC cmbs_api_ie_CallDirectionAdd(void *pv_RefIEList, ST_IE_CALL_DIRECTION *pst_CallDirection);
E_CMBS_RC cmbs_api_ie_CallDirectionGet(void *pv_RefIE, ST_IE_CALL_DIRECTION *pst_CallDirection);
E_CMBS_RC cmbs_api_ie_JEDECIdGet(void *pv_RefIE, PST_IE_CMBS_JEDEC_ID pst_JEDECid);
E_CMBS_RC cmbs_api_ie_JEDECIdAdd(void *pv_RefIE, PST_IE_CMBS_JEDEC_ID pst_JEDECid);
E_CMBS_RC cmbs_api_ie_DTMFToneDurAdd(void *pv_RefIE, u16 u16_ToneDur);
E_CMBS_RC cmbs_api_ie_DTMFToneDurGet(void *pv_RefIE, u16 *pu16_ToneDur);
E_CMBS_RC cmbs_api_ie_CallListAdd(void *pv_RefIEList, ST_IE_CALL_LIST *pst_CallList);
E_CMBS_RC cmbs_api_ie_CallListGet(void *pv_RefIE, ST_IE_CALL_LIST *pst_CallList);
E_CMBS_RC cmbs_api_ie_TDMSlotsAdd(void *pv_RefIEList, u32 u32_Slots);
E_CMBS_RC cmbs_api_ie_TDMSlotsGet(void *pv_RefIEList, u32 *pu32_Slots);
E_CMBS_RC cmbs_api_ie_DTMFToneToHSAdd(void *pv_RefIE, u16 u16_DTMFToneToHSMask);
E_CMBS_RC cmbs_api_ie_DTMFToneToHSGet(void *pv_RefIE, u16 *pu16_DTMFToneToHSMask);
E_CMBS_RC cmbs_api_ie_HSReleaseReasonAdd(void *pv_RefIEList, ST_IE_HS_RELEASE_REASON *pst_RelReason);
E_CMBS_RC cmbs_api_ie_HSReleaseReasonGet(void *pv_RefIE, ST_IE_HS_RELEASE_REASON *pst_RelReason);
E_CMBS_RC cmbs_api_ie_CrashDumpEnableStatusAdd(void *pv_RefIEList, PST_IE_CRASH_DUMP_ENABLE_STATUS pst_Enable);
E_CMBS_RC cmbs_api_ie_CrashDumpEnableStatusGet(void *pv_RefIEList, PST_IE_CRASH_DUMP_ENABLE_STATUS pst_Enable);
E_CMBS_RC cmbs_api_ie_PacketNumberAdd(void *pv_RefIEList, PST_IE_PACKET_NUMBER pst_PktNr);
E_CMBS_RC cmbs_api_ie_PacketNumberGet(void *pv_RefIEList, PST_IE_PACKET_NUMBER pst_PktNr);
E_CMBS_RC cmbs_api_ie_CallScreeningAdd(void *pv_RefIE, PST_IE_CALL_SCREENING pst_CallScreening);
E_CMBS_RC cmbs_api_ie_CallScreeningGet(void *pv_RefIE, PST_IE_CALL_SCREENING pst_CallScreening);
E_CMBS_RC cmbs_api_ie_ProductIDAdd(void *pv_RefIEList, PST_IE_PRODUCT_ID pst_ProductID);
E_CMBS_RC cmbs_api_ie_ProductIDGet(void *pv_RefIEList, PST_IE_PRODUCT_ID pst_ProductID);
E_CMBS_RC cmbs_api_ie_OPUSDataAdd(void *pv_RefIEList, u8 *pu8_OPUSData, u16 u16_OPUSData_Size);
E_CMBS_RC cmbs_api_ie_OPUSDataGet(void *pv_RefIEList, u8 **ppu8_OPUSData, u16 *pu16_OPUSData_Size);
// E_CMBS_RC cmbs_api_ie_CallDataAdd(void *pv_RefIEList, PST_IE_CALL_DATA pst_CallData, u8 u8_NR_OF_TERMINALS);
// E_CMBS_RC cmbs_api_ie_CSMTableAdd(void *pv_RefIEList, PST_IE_CSM_TABLE pst_CSMTable, u8 u8_MAX_NUM_CSM_SESSIONS);
// E_CMBS_RC cmbs_api_ie_LineSessionDataAdd(void *pv_RefIEList, PST_IE_LINE_SESSION_DATA pst_LineSessionData, u8 u8_MAX_NUM_LINE_SESSIONS);
E_CMBS_RC cmbs_api_ie_CallDataAdd(void *pv_RefIEList, u8 *pst_CallData, u8 u8_NR_OF_TERMINALS);
E_CMBS_RC cmbs_api_ie_CallDataGet(void *pv_RefIE, u8 *pst_CallData);
E_CMBS_RC cmbs_api_ie_CallDataSizeGet(void *pv_RefIE, u16 *pu16_CallDataSize);
E_CMBS_RC cmbs_api_ie_CSMTableAdd(void *pv_RefIEList, u8 *pst_CSMTable, u8 u8_MAX_NUM_CSM_SESSIONS);
E_CMBS_RC cmbs_api_ie_CSMTableGet(void *pv_RefIE, u8 *pst_CSMTable);
E_CMBS_RC cmbs_api_ie_CSMTableSizeGet(void *pv_RefIE, u16 *pu16_CSMTableSize);
E_CMBS_RC cmbs_api_ie_LineSessionDataAdd(void *pv_RefIEList, u8 *pst_LineSessionData, u8 u8_MAX_NUM_LINE_SESSIONS);
E_CMBS_RC cmbs_api_ie_LineSessionDataGet(void *pv_RefIE, u8 *pst_LineSessionData);
E_CMBS_RC cmbs_api_ie_LineSessionDataSizeGet(void *pv_RefIE, u16 *pu16_LineSessionDataSize);
E_CMBS_RC cmbs_api_ie_DebugInfoRequestAdd(void *pv_RefIE, u16 u16_RequestMask);
E_CMBS_RC cmbs_api_ie_DebugInfoReqGet(void *pv_RefIE, u16 *pu16_InfoRequest);
E_CMBS_RC cmbs_api_ie_CMBSAppLineAdd(void *pv_RefIEList, u8 *pst_CMBSAppLine, u8 u8_CMBS_APP_LINE_MAX);
E_CMBS_RC cmbs_api_ie_CMBSAppLineGet(void *pv_RefIE, u8 *pst_CMBSAppLine);
E_CMBS_RC cmbs_api_ie_CMBSAppLineSizeGet(void *pv_RefIE, u16 *pu16_CMBSAppLineSize);
E_CMBS_RC cmbs_api_ie_TermLineSessionAdd(void *pv_RefIE, ST_IE_CALL_INFO *pst_CallInfo);
E_CMBS_RC cmbs_api_ie_TermLineSessionGet(void *pv_RefIE, ST_IE_CALL_INFO *pst_CallInfo);
E_CMBS_RC cmbs_api_ie_CallReconnectAdd(void *pv_RefIEList, u8 u8_CallReconnect);
E_CMBS_RC cmbs_api_ie_PowerModeTypeGet (void *pv_RefIE, u8 *pu8_powerMode);
E_CMBS_RC cmbs_api_ie_NumOfSlotsGet (void *pv_RefIE, u8 *pu8_NumOfSlots);
E_CMBS_RC cmbs_api_ie_PowerModeResGet(void *pv_RefIE, u8 *u8_PowerModeRes);
#endif

3510
dectmngr/src/cmbs/cmbs_int.c Executable file

File diff suppressed because it is too large Load Diff

322
dectmngr/src/cmbs/cmbs_int.h Executable file
View File

@@ -0,0 +1,322 @@
/*!
* \file cmbs_int.h
* \brief This file contains internal structures and definitions of CMBS
*
* \author stein
*
* @(#) %filespec: cmbs_int.h~12.1.12 %
*
*******************************************************************************
* \par History
* \n==== History ============================================================\n
* date name version action \n
* ----------------------------------------------------------------------------\n
* 27-Jan-14 tcmc_asa ---GIT-- change type of cmbs_int_SendChecksumError
* 13-Jan-2014 tcmc_asa -- GIT-- take checksum changes from 3.46.x to 3_x main (3.5x)
* 20-Dec-13 tcmc_asa GIT Added CHECKSUM_SUPPORT
* 25-Feb-09 stein 61 Restructuration \n
* 18-Feb-09 kelbch 3 add target build version to HOST API structure \n
* 16-Feb-09 kelbch 2 Integration to host/target build\n
*******************************************************************************/
#if !defined( CMBS_INT_H )
#define CMBS_INT_H
#include "cmbs_api.h" /* CMBS API definition */
#include "cfr_ie.h" /* CMBS IE handling */
#include "cfr_mssg.h"
#if defined( __linux__ )
#include <pthread.h>
#include <unistd.h>
#endif
#ifdef WIN32
#include "windows.h"
#endif
/* Local definitions */
#if defined(CHECKSUM_SUPPORT) && defined(CMBS_DEBUG)
# define CHECKSUMPRINT(x) printf x
#else
# define CHECKSUMPRINT(x)
#endif
#if !defined ( CMBS_API_TARGET )
#ifndef CMBS_NUM_OF_HOST_THREADS
#define CMBS_NUM_OF_HOST_THREADS 8
/* Current host threads:
-1- Callback
-2- HAN
-3- UART
-4- Reconnect (temporary thread)
-5- SUOTA
-6- Log
-7- main
-8- RESERVED/FUTURE
*/
#endif
#define CMBS_UNKNOWN_THREAD 0xFF
///////////////////////////
#endif
/*!
brief endianess
*/
typedef enum
{
E_CMBS_ENDIAN_LITTLE, /*!< little endian */
E_CMBS_ENDIAN_BIG, /*!< big endian */
E_CMBS_ENDIAN_MIXED /*!< mixed endian */
} E_CMBS_ENDIAN;
/*!
\brief return value of DnA CMBS framework
*/
typedef enum
{
CFR_E_RETVAL_OK, /*!< successful return value*/
CFR_E_RETVAL_ERR, /*!< general error occured */
CFR_E_RETVAL_ERR_MEM, /*!< not enough memory available */
} CFR_E_RETVAL;
/*! currently default value of target module */
#define B0 0000000 /* hang up */
#define B50 0000001
#define B75 0000002
#define B110 0000003
#define B134 0000004
#define B150 0000005
#define B200 0000006
#define B300 0000007
#define B600 0000010
#define B1200 0000011
#define B1800 0000012
#define B2400 0000013
#define B4800 0000014
#define B9600 0000015
#define B19200 0000016
#define B38400 0000017
#define B57600 0010001
#define B115200 0010002
#define B230400 0010003
#define B460800 0010004
#define B500000 0010005
#define B576000 0010006
#define B921600 0010007
#define B1000000 0010010
#define B1152000 0010011
#define B1500000 0010012
#define B2000000 0010013
#define B2500000 0010014
#define B3000000 0010015
#define B3500000 0010016
#define B4000000 0010017
/*! \brief local application slot */
typedef struct
{
void * pv_AppRefHandle; /*!< store application reference pointer */
PFN_CMBS_API_CB pFnAppCb; /*!< store to be called function (reception of CMBS events)*/
ST_CB_LOG_BUFFER pFnCbLogBuffer; /*!< storage for callback of log buffer */
u16 u16_AppAPIVersion; /*!< requested API version of application (further needed to get compatibility)*/
#if defined ( CMBS_API_TARGET )
ST_CFR_IE_LIST st_TransmitterIEList; /*!< IE list of transmit direction */
u8 u8_IEBuffers[1][CMBS_BUF_SIZE]; /*!< 1 buffer of a complete IE list (one buffer for each thread, max. 1 thread) */
#else
ST_CFR_IE_LIST st_TransmitterIEList[CMBS_NUM_OF_HOST_THREADS]; /*!< IE list of transmit direction */
u8 u8_IEBuffers[CMBS_NUM_OF_HOST_THREADS][CMBS_BUF_SIZE]; /*!< 4 buffers of a complete IE list (one buffer for each thread, max. 4 threads) */
u32 u32_ThreadIdArray[CMBS_NUM_OF_HOST_THREADS]; /*!< Array to store thread id */
#endif // defined ( CMBS_API_TARGET )
} ST_CMBS_API_SLOT, * PST_CMBS_API_SLOT;
/*!
brief enum of commuication flow control
*/
typedef enum
{
E_CMBS_FLOW_STATE_GO, /*!< transmitter/receiver works fine */
E_CMBS_FLOW_STATE_STOP, /*!< transmitter/receiver is busy, no packet transmission*/
E_CMBS_FLOW_STATE_MAX
} E_CMBS_FLOW_STATE;
/*! \brief CMBS API Instance (local)*/
typedef struct
{
ST_CMBS_API_SLOT st_ApplSlot;
u16 u16_TargetVersion; /*!< target CMBS API version */
E_CMBS_HW_CHIP u8_HwChip; /*!< HW chip */
E_CMBS_HW_COM_TYPE u8_HwComType; /*!< HW communication */
u32 u32_CallInstanceCount;
//#if !defined ( CMBS_API_TARGET )
u16 u16_TargetBuild; /*!< contains the build version of target side*/
//#endif
E_CMBS_API_MODE e_Mode; /*!< request CMBSMode */
E_CMBS_FLOW_STATE e_OrigFlowState; /*!< Originator transmission state */
E_CMBS_FLOW_STATE e_DestFlowState; /*!< Destination transmission state */
E_CMBS_ENDIAN e_Endian; /*!< endianess: 0 = little */
#if defined( __linux__ )
E_CMBS_DEVTYPE eDevCtlType; /*!< control device type properties*/
int fdDevCtl; /*!< handle of such device */
E_CMBS_DEVTYPE eDevMediaType; /*!< media device type properties */
pthread_t serialThreadId; /*!< thread ID of serial pump */
pthread_t callbThreadId; /*!< thread ID of callback function */
pthread_mutex_t cond_Mutex;
pthread_cond_t cond_UnLock;
int msgQId; /*!< message queue information*/
#else
# if defined ( WIN32 )
E_CMBS_DEVTYPE eDevCtlType; /*!< control device type properties*/
E_CMBS_DEVTYPE eDevMediaType; /*!< media device type properties */
HANDLE h_InitBlock; /*!< handle to wait until CMBS is connected */
HANDLE h_RecPath; /*!< handle of synchronization path */
HANDLE h_RecThread; /*!< handle of receive data collector thread */
DWORD dw_ThreadID;
BOOL bo_Run;
# endif
#endif
CFR_CMBS_CRITICALSECTION h_CriticalSectionTransmission; /*!< Critical section for transmission of packets */
CFR_CMBS_CRITICALSECTION h_TxThreadCriticalSection;
} ST_CMBS_API_INST, * PST_CMBS_API_INST;
/*!
The following serialized message format shall be used:
0 1 2 3 4 5 6 7 8 9 10 11
| 0xda 0xda 0xda 0xda | 0xLO 0xHI | 0xLO 0xHI | 0xXX 0xYY | 0xLO 0xHI | parameter data
sync. total len packet nr. command param len
*/
#define CMBS_SYNC_LENGTH 4 /*!< Synchronization size */
#define CMBS_SYNC 0xDADADADA /*!< Synchronization value */
#define CMBS_RCV_STATE_IDLE 0
#define CMBS_RCV_STATE_SYNC 1
#define CMBS_RCV_STATE_DATA 2
/*! \brief CMBS API Instance (local)*/
/*! \brief Union representing a complete serial cmbs api message
the union uses to work on the message with byte or structure access */
typedef union
{
char serialBuf[sizeof(u32)+sizeof(ST_CMBS_SER_MSG)];
struct
{
u32 u32_Sync;
ST_CMBS_SER_MSG
st_Msg;
}st_Data;
} U_CMBS_SER_DATA, * PU_CMBS_SER_DATA;
#if defined(__linux__)
typedef struct
{
int nLength;
u8 u8_Data[CMBS_BUF_SIZE + sizeof(u32)];
} ST_CMBS_LIN_MSGDATA, * PST_CMBS_LIN_MSGDATA;
typedef struct
{
long msgType;
ST_CMBS_LIN_MSGDATA
msgData;
} ST_CMBS_LIN_MSG, * PST_CMBS_LIN_MSG;
#endif
#if defined( __cplusplus )
extern "C"
{
#endif
extern ST_CMBS_API_INST g_CMBSInstance;
extern ST_CAPABLITIES g_st_CMBSCapabilities;
/*****************************************************************************
* CMBS API Internal functions
*****************************************************************************/
E_CMBS_ENDIAN cmbs_int_EndiannessGet( void );
u16 cmbs_int_EndianCvt16( u16 u16_Value );
u32 cmbs_int_EndianCvt32( u32 u32_Value );
void cmbs_int_HdrEndianCvt( ST_CMBS_SER_MSGHDR *pst_Hdr );
// OS and environment dependent function
E_CMBS_RC cmbs_int_EnvCreate( E_CMBS_API_MODE e_Mode, ST_CMBS_DEV * pst_DevCtl, ST_CMBS_DEV * pst_DevMedia );
E_CMBS_RC cmbs_int_EnvDestroy( void );
// start-up blocking function to wait until CMBS is available
void _cmbs_int_StartupBlockSignal( PST_CMBS_API_INST pst_CMBSInst );
E_CMBS_RC cmbs_int_SendHello(ST_CMBS_DEV * pst_DevCtl, ST_CMBS_DEV * pst_DevMedia);
E_CMBS_RC cmbs_int_SendRAMDumpStoreCmd(void);
#if !defined( CMBS_API_TARGET )
E_CMBS_RC cmbs_int_WaitForResponse(u32 u32_TimeoutMs);
#endif
void * cmbs_int_RegisterCb( void * pv_AppRef, PFN_CMBS_API_CB pfn_api_Cb, u16 u16_bcdVersion );
void cmbs_int_RegisterLogBufferCb( void * pv_AppRef, PST_CB_LOG_BUFFER pfn_log_buffer_Cb );
void cmbs_int_UnregisterCb( void * pv_AppRefHandle );
u16 cmbs_int_ModuleVersionGet( void );
u16 cmbs_int_ModuleVersionBuildGet( void );
E_CMBS_RC cmbs_int_EventSend( E_CMBS_EVENT_ID e_EventID, u8 *pBuf, u16 u16_Length );
void cmbs_int_EventReceive ( u8 * pu8_Mssg, u16 u16_Size );
E_CMBS_RC cmbs_int_ResponseSend( E_CMBS_EVENT_ID e_ID, E_CMBS_RESPONSE e_RSPCode );
E_CMBS_RC cmbs_int_ResponseWithCallInstanceSend( E_CMBS_EVENT_ID e_ID,
E_CMBS_RESPONSE e_RSPCode,
u32 u32CallInstance);
E_CMBS_RC cmbs_int_RespWithCallInstChannelID(E_CMBS_EVENT_ID e_ID,
E_CMBS_RESPONSE e_RSPCode,
u32 u32CallInstance,
PST_IE_MEDIA_CHANNEL st_MediaChannel);
E_CMBS_RC cmbs_int_RespWithChannelID(E_CMBS_EVENT_ID e_ID,
E_CMBS_RESPONSE e_RSPCode,
PST_IE_MEDIA_CHANNEL pst_MediaChannel);
E_CMBS_RC cmbs_int_cmd_Send( u8 u8_Cmd, u8 * pBuf, u16 u16_Length );
void cmbs_int_cmd_Dispatcher( u8 u8_Cmd, u8 * pu8_Buffer, u16 u16_Size );
void cmbs_int_cmd_ReceiveEarly ( u8 * pu8_buffer );
void _cmbs_int_SuspendTxCommands( void );
void _cmbs_int_SuspendTxCommandswithoutSendingRES( void );
void _cmbs_int_ResumeTxCommands( void );
void _cmbs_int_ResumeTxCommandswithoutSendingRES( void );
void cmbs_int_cmd_FlowRestartHandle ( u16 u16_Packet );
void cmbs_int_cmd_FlowNOKHandle ( u16 u16_Packet );
u8 cmbs_int_cmd_FlowStateGet ( void );
u32 cmbs_cmd_parser( CMBS_CMD id, u8* pu8_Buffer, u8* pu8_Buffer_parse, u32 u32_Pos);
#ifdef CHECKSUM_SUPPORT
void p_cmbs_int_CalcChecksum(u8 * pCheckSum, u8 * pBuf, u16 u16_Length);
u8 p_cmbs_int_ChecksumVerify(u8 u8_Checksum[2], u8 * pBuf, u16 u16_Length);
E_CMBS_RC cmbs_int_SendChecksumError(E_CMBS_CHECKSUM_ERROR e_ErrorType, u16 u16_EventID);
void cmbs_int_SimulateChecksumError(char u8_ErrorType);
#endif
void cmbs_int_cmd_SendCapablities (void);
void cmbs_int_cmd_SendCapablitiesReply (void);
void cmbs_int_ParseDectMsg(u8 * buff, u8 u8_ILen, u8 u8_HandsetNumber);
E_CMBS_RC cmbs_int_ie_RingTypeGet( void * pv_RefIE, u32 * pu32_Value );
#if defined( __cplusplus )
}
#endif
#endif // CMBS_INT_H
// EOF

98
dectmngr/src/cmbs/cmbs_rtp.c Executable file
View File

@@ -0,0 +1,98 @@
/*!
* \file cmbs_rtp.c
* \brief CMBS RTP Extension
* \Author Denis Matiukha
*
* @(#) cmbs_rtp.c~1
*
*******************************************************************************/
#if defined(__arm)
#include "tclib.h"
#include "embedded.h"
#else
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#endif
#include "cmbs_int.h"
E_CMBS_RC cmbs_rtp_SessionStart ( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_RTP_SESSION_START, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_rtp_SessionStop ( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_RTP_SESSION_STOP, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_rtp_SessionUpdate ( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_RTP_SESSION_UPDATE, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_rtcp_SessionStart ( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_RTCP_SESSION_START, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_rtcp_SessionStop ( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_RTCP_SESSION_STOP, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_rtp_SendDTMF ( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_RTP_SEND_DTMF, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_rtp_EnableFaxAudioProcessingMode ( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_RTP_ENABLE_FAX_AUDIO_PROCESSING_MODE, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_rtp_DisableFaxAudioProcessingMode ( void * pv_AppRefHandle, void * pv_RefIEList )
{
PST_CFR_IE_LIST p_List = (PST_CFR_IE_LIST)pv_RefIEList;
UNUSED_PARAMETER( pv_AppRefHandle );
return cmbs_int_EventSend( CMBS_EV_RTP_DISABLE_FAX_AUDIO_PROCESSING_MODE, p_List->pu8_Buffer, p_List->u16_CurSize );
}

180
dectmngr/src/cmbs/cmbs_suota.c Executable file
View File

@@ -0,0 +1,180 @@
/*!
* \file cmbs_suota.c
* \brief
* \Author stein
*
* @(#) %filespec: cmbs_suota.c~7 %
*
*******************************************************************************/
#if defined(__arm)
#include "tclib.h"
#include "embedded.h"
#else
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#endif
#include "cmbs_int.h"
#define SUOTA_APPLICATION_ID 0x437
//effi
E_CMBS_RC cmbs_dsr_suota_Init(void *pv_AppRefHandle)
{
PST_CFR_IE_LIST p_List;
PST_CFR_IE_LIST p_List2;
E_CMBS_EVENT_ID e_EventID;
ST_IE_DATA st_Data;
char Buffer[4];
UNUSED_PARAMETER( pv_AppRefHandle );
p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
e_EventID = CMBS_EV_DSR_SUOTA_REG_CPLANE_CB;
// Add IEs
cmbs_api_ie_SuotaAppIdAdd(p_List, SUOTA_APPLICATION_ID);
cmbs_api_ie_SuotaSessionIdAdd(p_List, 0);
st_Data.u16_DataLen = 0;
st_Data.pu8_Data = 0;
cmbs_api_ie_DataAdd(p_List, &st_Data);
cmbs_int_EventSend(e_EventID, p_List->pu8_Buffer, p_List->u16_CurSize);
// app cb
p_List2 = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
e_EventID = CMBS_EV_DSR_SUOTA_REG_APP_CB;
memset(Buffer,0,4);
// Add IEs
cmbs_api_ie_SuotaAppIdAdd(p_List, SUOTA_APPLICATION_ID);
cmbs_api_ie_SuotaSessionIdAdd(p_List, 0);
st_Data.u16_DataLen = 4;
st_Data.pu8_Data = (u8*)Buffer;
cmbs_api_ie_DataAdd(p_List, &st_Data);
cmbs_int_EventSend(e_EventID, p_List2->pu8_Buffer, p_List2->u16_CurSize);
return 0;
}
E_CMBS_RC cmbs_dsr_suota_SendHSVersionAvail (void *pv_AppRefHandle, ST_SUOTA_UPGRADE_DETAILS st_HSVerAvail, u16 u16_Handset, ST_VERSION_BUFFER* pst_SwVersion, u16 u16_RequestId)
{
PST_CFR_IE_LIST p_List;
p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER( pv_AppRefHandle );
cmbs_api_ie_ShortValueAdd( p_List, u16_Handset, CMBS_IE_HANDSETS);
cmbs_api_ie_VersionAvailAdd(p_List, &st_HSVerAvail);
cmbs_api_ie_VersionBufferAdd( p_List, pst_SwVersion);
cmbs_api_ie_RequestIdAdd( p_List, u16_RequestId );
return cmbs_int_EventSend( CMBS_EV_DSR_SUOTA_SEND_VERS_AVAIL, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dsr_suota_SendSWUpdateInd ( void *pv_AppRefHandle, u16 u16_Handset, E_SUOTA_SU_SubType enSubType, u16 u16_RequestId )
{
PST_CFR_IE_LIST p_List;
UNUSED_PARAMETER( pv_AppRefHandle );
p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
cmbs_api_ie_ShortValueAdd( p_List, u16_Handset, CMBS_IE_HANDSETS);
cmbs_api_ie_ByteValueAdd(p_List,enSubType,CMBS_IE_SU_SUBTYPE);
cmbs_api_ie_RequestIdAdd( p_List, u16_RequestId );
return cmbs_int_EventSend( CMBS_EV_DSR_SUOTA_SEND_SW_UPD_IND, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dsr_suota_SendURL ( void *pv_AppRefHandle, u16 u16_Handset, u8 u8_URLToFollow, ST_URL_BUFFER* pst_Url, u16 u16_RequestId )
{
PST_CFR_IE_LIST p_List;
p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER( pv_AppRefHandle );
cmbs_api_ie_ShortValueAdd( p_List, u16_Handset, CMBS_IE_HANDSETS);
cmbs_api_ie_ByteValueAdd(p_List,u8_URLToFollow,CMBS_IE_NUM_OF_URLS);
cmbs_api_ie_UrlAdd(p_List,pst_Url);
cmbs_api_ie_RequestIdAdd( p_List, u16_RequestId );
return cmbs_int_EventSend( CMBS_EV_DSR_SUOTA_SEND_URL, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dsr_suota_SendNack ( void *pv_AppRefHandle, u16 u16_Handset, E_SUOTA_RejectReason RejectReason, u16 u16_RequestId )
{
PST_CFR_IE_LIST p_List;
p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER( pv_AppRefHandle );
cmbs_api_ie_ShortValueAdd( p_List, u16_Handset, CMBS_IE_HANDSETS);
cmbs_api_ie_ByteValueAdd(p_List,RejectReason,CMBS_IE_REJECT_REASON);
cmbs_api_ie_RequestIdAdd( p_List, u16_RequestId );
return cmbs_int_EventSend( CMBS_EV_DSR_SUOTA_SEND_NACK, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dsr_suota_Unreg_App_CB(void)
{
PST_CFR_IE_LIST p_List;
p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
return cmbs_int_EventSend(CMBS_EV_DSR_SUOTA_UNREG_APP_CB, p_List->pu8_Buffer, p_List->u16_CurSize);
}
E_CMBS_RC cmbs_dsr_suota_Session_Close ( void *pv_AppRefHandle, u32 u32_SessionId )
{
PST_CFR_IE_LIST p_List;
p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER( pv_AppRefHandle );
cmbs_api_ie_SuotaSessionIdAdd(p_List, u32_SessionId );
return cmbs_int_EventSend( CMBS_EV_DSR_SUOTA_SESSION_CLOSE, p_List->pu8_Buffer, p_List->u16_CurSize );
}
E_CMBS_RC cmbs_dsr_suota_DataSend (void *pv_AppRefHandle, u32 u32_appId, u32 u32_SessionId,
char *pSdu, u32 u32_SduLength,u16 u16_RequestId)
{
PST_CFR_IE_LIST p_List;
ST_IE_DATA st_Data;
p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER( pv_AppRefHandle );
cmbs_api_ie_RequestIdAdd( p_List, u16_RequestId );
cmbs_api_ie_SuotaAppIdAdd(p_List, u32_appId);
cmbs_api_ie_SuotaSessionIdAdd(p_List, u32_SessionId);
st_Data.u16_DataLen = u32_SduLength;
st_Data.pu8_Data = (u8*)pSdu;
cmbs_api_ie_DataAdd( p_List, &st_Data );
return cmbs_int_EventSend(CMBS_EV_DSR_SUOTA_DATA_SEND, p_List->pu8_Buffer, p_List->u16_CurSize);
}
E_CMBS_RC cmbs_dsr_suota_ExtendedDataSend (void *pv_AppRefHandle, u32 u32_appId, u32 u32_SessionId,
char *pSdu, u32 u32_SduLength,u16 u16_RequestId, PST_IE_SUOTA_FILE_INFO pst_FileInfo)
{
PST_CFR_IE_LIST p_List;
ST_IE_DATA st_Data;
p_List = (PST_CFR_IE_LIST)cmbs_api_ie_GetList();
UNUSED_PARAMETER( pv_AppRefHandle );
cmbs_api_ie_RequestIdAdd( p_List, u16_RequestId );
cmbs_api_ie_SuotaAppIdAdd(p_List, u32_appId);
cmbs_api_ie_SuotaSessionIdAdd(p_List, u32_SessionId);
cmbs_api_ie_SuotaFileInfoAdd(p_List, pst_FileInfo);
st_Data.u16_DataLen = u32_SduLength;
st_Data.pu8_Data = (u8*)pSdu;
cmbs_api_ie_DataAdd( p_List, &st_Data );
return cmbs_int_EventSend(CMBS_EV_DSR_SUOTA_DATA_SEND, p_List->pu8_Buffer, p_List->u16_CurSize);
}
/*---------[End Of File]---------------------------------------------------------------------------------------------------------------------------*/

244
dectmngr/src/cmbs/cmbs_util.c Executable file
View File

@@ -0,0 +1,244 @@
/*!
* \file cmbs_util.c
* \brief This file contains utility functions for CMBS API usage
* \Author andriig
*
* @(#) %filespec: cmbs_util.c~DMZD53#2.1.2 %
*
*******************************************************************************
* \par History
* \n==== History ============================================================
* date name version action
* ---------------------------------------------------------------------------
*
* 17-Oct-14 tcmc_asa ---GIT-- added CMBS_PARAM_INL_DEL
* 30-Jul-2013 tcmc_asa --GIT-- added CMBS_PARAM_FP_CUSTOM_FEATURES(_LENGTH )
*
*******************************************************************************/
#include "cmbs_util.h"
#include "cfr_debug.h"
u16 cmbs_util_GetParameterLength( E_CMBS_PARAM e_Param )
{
switch ( e_Param )
{
case CMBS_PARAM_RFPI:
return CMBS_PARAM_RFPI_LENGTH;
case CMBS_PARAM_RVBG:
return CMBS_PARAM_RVBG_LENGTH;
case CMBS_PARAM_RVREF:
return CMBS_PARAM_RVREF_LENGTH;
case CMBS_PARAM_RXTUN:
return CMBS_PARAM_RXTUN_LENGTH;
case CMBS_PARAM_MASTER_PIN:
case CMBS_PARAM_AUTH_PIN:
return CMBS_PARAM_PIN_CODE_LENGTH;
case CMBS_PARAM_COUNTRY:
return CMBS_PARAM_COUNTRY_LENGTH;
case CMBS_PARAM_SIGNALTONE_DEFAULT:
return CMBS_PARAM_SIGNALTONE_LENGTH;
case CMBS_PARAM_TEST_MODE:
return CMBS_PARAM_TEST_MODE_LENGTH;
case CMBS_PARAM_ECO_MODE:
return CMBS_PARAM_ECO_MODE_LENGTH;
case CMBS_PARAM_AUTO_REGISTER:
return CMBS_PARAM_AUTO_REGISTER_LENGTH;
case CMBS_PARAM_NTP:
return CMBS_PARAM_NTP_LENGTH;
case CMBS_PARAM_GFSK:
return CMBS_PARAM_GFSK_LENGTH;
case CMBS_PARAM_RESET_ALL:
return CMBS_PARAM_RESET_ALL_LENGTH;
case CMBS_PARAM_SUBS_DATA:
return CMBS_PARAM_SUBS_DATA_LENGTH;
case CMBS_PARAM_AUXBGPROG:
return CMBS_PARAM_AUXBGPROG_LENGTH;
case CMBS_PARAM_AUXBGPROG_DIRECT:
return CMBS_PARAM_AUXBGPROG_DIRECT_LENGTH;
case CMBS_PARAM_ADC_MEASUREMENT:
return CMBS_PARAM_ADC_MEASUREMENT_LENGTH;
case CMBS_PARAM_PMU_MEASUREMENT:
return CMBS_PARAM_PMU_MEASUREMENT_LENGTH;
case CMBS_PARAM_RSSI_VALUE:
return CMBS_PARAM_RSSI_VALUE_LENGTH;
case CMBS_PARAM_DECT_TYPE:
return CMBS_PARAM_DECT_TYPE_LENGTH;
case CMBS_PARAM_MAX_NUM_ACT_CALLS_PT:
return CMBS_PARAM_MAX_NUM_ACT_CALLS_PT_LENGTH;
case CMBS_PARAM_ANT_SWITCH_MASK:
return CMBS_PARAM_ANT_SWITCH_MASK_LENGTH;
case CMBS_PARAM_PORBGCFG:
return CMBS_PARAM_PORBGCFG_LENGTH;
case CMBS_PARAM_BERFER_VALUE:
return CMBS_PARAM_BERFER_VALUE_LENGTH;
case CMBS_PARAM_INBAND_COUNTRY:
return CMBS_PARAM_INBAND_COUNTRY_LENGTH;
case CMBS_PARAM_FP_CUSTOM_FEATURES:
return CMBS_PARAM_FP_CUSTOM_FEATURES_LENGTH;
case CMBS_PARAM_HAN_DECT_SUB_DB_START:
case CMBS_PARAM_HAN_DECT_SUB_DB_END:
case CMBS_PARAM_HAN_ULE_SUB_DB_START:
case CMBS_PARAM_HAN_ULE_SUB_DB_END:
case CMBS_PARAM_HAN_FUN_SUB_DB_START:
case CMBS_PARAM_HAN_FUN_SUB_DB_END:
case CMBS_PARAM_HAN_FUN_GROUP_LIST_START:
case CMBS_PARAM_HAN_FUN_GROUP_LIST_END:
case CMBS_PARAM_HAN_FUN_GROUP_TABLE_START:
case CMBS_PARAM_HAN_FUN_GROUP_TABLE_END:
case CMBS_PARAM_HAN_ULE_BROADCAST_CONVERSION_TABLE_START:
case CMBS_PARAM_HAN_ULE_BROADCAST_CONVERSION_TABLE_END:
return CMBS_PARAM_HAN_DB_ADDR_LENGTH;
case CMBS_PARAM_HAN_ULE_NEXT_TPUI:
return CMBS_PARAM_HAN_ULE_NEXT_TPUI_LENGTH;
case CMBS_PARAM_DHSG_ENABLE:
return CMBS_PARAM_DHSG_ENABLE_LENGTH;
case CMBS_PARAM_PREAM_NORM:
return CMBS_PARAM_PREAM_NORM_LENGTH;
case CMBS_PARAM_RF_FULL_POWER:
return CMBS_PARAM_RF_FULL_POWER_LENGTH;
case CMBS_PARAM_RF_LOW_POWER:
return CMBS_PARAM_RF_LOW_POWER_LENGTH;
case CMBS_PARAM_RF_LOWEST_POWER:
return CMBS_PARAM_RF_LOWEST_POWER_LENGTH;
case CMBS_PARAM_RF19APU_MLSE:
return CMBS_PARAM_RF19APU_MLSE_LENGTH;
case CMBS_PARAM_RF19APU_KCALOVR:
return CMBS_PARAM_RF19APU_KCALOVR_LENGTH;
case CMBS_PARAM_RF19APU_KCALOVR_LINEAR:
return CMBS_PARAM_RF19APU_KCALOVR_LINEAR_LENGTH;
case CMBS_PARAM_RF19APU_SUPPORT_FCC:
return CMBS_PARAM_RF19APU_SUPPORT_FCC_LENGTH;
case CMBS_PARAM_RF19APU_DEVIATION:
return CMBS_PARAM_RF19APU_DEVIATION_LENGTH;
case CMBS_PARAM_RF19APU_PA2_COMP:
return CMBS_PARAM_RF19APU_PA2_COMP_LENGTH;
case CMBS_PARAM_RFIC_SELECTION:
return CMBS_PARAM_RFIC_SELECTION_LENGTH;
case CMBS_PARAM_MAX_USABLE_RSSI:
return CMBS_PARAM_MAX_USABLE_RSSI_LENGTH;
case CMBS_PARAM_LOWER_RSSI_LIMIT:
return CMBS_PARAM_LOWER_RSSI_LIMIT_LENGTH;
case CMBS_PARAM_PHS_SCAN_PARAM:
return CMBS_PARAM_PHS_SCAN_PARAM_LENGTH;
case CMBS_PARAM_JDECT_LEVEL1_M82:
return CMBS_PARAM_JDECT_LEVEL1_M82_LENGTH;
case CMBS_PARAM_JDECT_LEVEL2_M62:
return CMBS_PARAM_JDECT_LEVEL2_M62_LENGTH;
case CMBS_PARAM_AUXBGP_DCIN:
return CMBS_PARAM_AUXBGP_DCIN_LENGTH;
case CMBS_PARAM_AUXBGP_RESISTOR_FACTOR:
return CMBS_PARAM_AUXBGP_RESISTOR_FACTOR_LENGTH;
case CMBS_PARAM_DAC1_VOL:
return CMBS_PARAM_DAC_VOL_LENGTH;
case CMBS_PARAM_DAC2_VOL:
return CMBS_PARAM_DAC_VOL_LENGTH;
case CMBS_PARAM_INL_DEL:
return CMBS_PARAM_INL_DEL_LENGTH;
case CMBS_PARAM_SYPO_GPIO:
return CMBS_PARAM_SYPO_GPIO_LENGTH;
case CMBS_PARAM_SYPO_WAIT_FOR_SYNC:
return CMBS_PARAM_SYPO_WAIT_FOR_SYNC_LENGTH;
case CMBS_PARAM_SYPO_MODE:
return CMBS_PARAM_SYPO_MODE_LENGTH;
case CMBS_PARAM_UART_DELAY_TIMER:
return CMBS_PARAM_UART_DELAY_TIMER_LENGTH;
case CMBS_PARAM_MAX_TRANSFER_SIZE:
return CMBS_PARAM_MAX_TRANSFER_SIZE_LENGTH;
case CMBS_PARAM_IOM_TEST_MODE:
return CMBS_PARAM_IOM_TEST_MODE_LENGTH;
case CMBS_PARAM_RING_ON_OFF:
return CMBS_PARAM_RING_ON_OFF_LENGTH;
case CMBS_PARAM_NEMO_MODE:
return CMBS_PARAM_NEMO_MODE_LENGTH;
case CMBS_PARAM_HS_CW_DISABLED:
return CMBS_PARAM_HS_CW_DISABLED_LENGTH;
case CMBS_PARAM_ENC_DISABLE:
return CMBS_PARAM_ENC_DISABLE_LENGTH;
case CMBS_PARAM_INL_ADD:
return CMBS_PARAM_INL_ADD_LENGTH;
case CMBS_PARAM_BBD_UPDATE:
return CMBS_PARAM_BBD_UPDATE_LENGTH;
case CMBS_PARAM_CLOCK_MASTER_EDIT:
return CMBS_PARAM_CLOCK_MASTER_EDIT_LENGTH;
case CMBS_PARAM_FXS_CALLEE_REGRET_TIME:
case CMBS_PARAM_FXS_FIRST_DIGIT_TIMER:
case CMBS_PARAM_FXS_INTER_DIGIT_TIMER:
case CMBS_PARAM_FXS_STAR_HASH_CON_TIMER:
return CMBS_PARAM_FXS_TIMER_LENGTH;
case CMBS_PARAM_FXS_TONE_CONFIG:
return CMBS_PARAM_FXS_TONE_CONFIG_LENGTH;
case CMBS_PARAM_PREP_QSPI_FOR_HW_RESET:
return CMBS_PARAM_PREP_QSPI_FOR_HW_RESET_LENGTH;
case CMBS_PARAM_INT_START_CALL_TO_HOST:
return CMBS_PARAM_INT_START_CALL_TO_HOST_LENGTH;
case CMBS_PARAM_SUBS_DATA_EX:
return CMBS_PARAM_SUBS_DATA_EX_LENGTH;
case CMBS_PARAM_ULE_MULTICAST_ENC_PARAMS:
return CMBS_PARAM_ULE_MULTICAST_ENC_PARAMS_LENGTH;
case CMBS_PARAM_NEMO_CONTROL:
return CMBS_PARAM_NEMO_CONTROL_LENGTH;
case CMBS_PARAM_REPEATER_TYPE:
return CMBS_PARAM_REPEATER_TYPE_LENGTH;
case CMBS_PARAM_REPEATER_SUBS_START:
return CMBS_PARAM_REPEATER_SUBS_ADDR_LENGTH;
case CMBS_PARAM_REPEATER_SUBS_END:
return CMBS_PARAM_REPEATER_SUBS_ADDR_LENGTH;
case CMBS_PARAM_TEST_FLAGS:
return CMBS_PARAM_TEST_FLAGS_LENGTH;
case CMBS_PARAM_CP_FEATURES:
return CMBS_PARAM_CP_FEATURES_LENGTH;
case CMBS_PARAM_SUBS_DATA_EX_EEP_SIZE:
return CMBS_PARAM_SUBS_DATA_EX_EEP_SIZE_LENGTH;
default:
break;
}
return CMBS_RC_ERROR_PARAMETER;
}
E_CMBS_RC cmbs_util_ParameterValid( E_CMBS_PARAM e_Param, u16 u16_DataLen )
{
// get parameter length
u16 u16_RequiredLength = cmbs_util_GetParameterLength(e_Param);
// Check parameter length
if ( !u16_RequiredLength || u16_DataLen != u16_RequiredLength )
{
if(e_Param != CMBS_PARAM_BBD_UPDATE) // CMBS_PARAM_BBD_UPDATE is a special case that we do not know the size in advance
{
CFR_DBG_ERROR( "Parameter ERROR: Length mismatch. Required:%d <-> Got:%d\n",
u16_RequiredLength, u16_DataLen );
return CMBS_RC_ERROR_PARAMETER;
}
}
return CMBS_RC_OK;
}
bool cmbs_util_RawPayloadEvent( u16 u16_EventID )
{
switch(u16_EventID)
{
case CMBS_EV_DSR_FW_UPD_START:
case CMBS_EV_DSR_FW_UPD_PACKETNEXT:
case CMBS_EV_DSR_FW_UPD_END:
case CMBS_EV_DEM_OPUS_DATA:
return TRUE;
default:
break;
}
return FALSE;
}

28
dectmngr/src/cmbs/cmbs_util.h Executable file
View File

@@ -0,0 +1,28 @@
/*!
* \file cmbs_util.h
* \brief This file contains utility functions for CMBS API usage
* \author andriig
*
* @(#) %filespec: cmbs_util.h~DMZD53#2 %
*
*******************************************************************************/
#if !defined( CMBS_UTIL_H )
#define CMBS_UTIL_H
#include "cmbs_api.h" /* CMBS API definition */
#ifdef WIN32
#define SleepMs(x) Sleep(x)
#else
#define SleepMs(x) usleep(1000*x)
#endif
u16 cmbs_util_GetParameterLength( E_CMBS_PARAM e_Param );
E_CMBS_RC cmbs_util_ParameterValid( E_CMBS_PARAM e_Param, u16 u16_DataLen );
bool cmbs_util_RawPayloadEvent( u16 u16_EventID );
#endif

389
dectmngr/src/frame/cfr_ie.c Executable file
View File

@@ -0,0 +1,389 @@
/*!
* \file cfr_ie.c
* \brief
* \Author kelbch
*
* @(#) %filespec: cfr_ie.c~DMZD53#8 %
*
*******************************************************************************
* \par History
* \n==== History ============================================================\n
* date name version action \n
* ----------------------------------------------------------------------------\n
*******************************************************************************/
#if defined(__arm)
#include "tclib.h"
#include "embedded.h"
#else
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#endif
#if defined( __linux__ )
#include <pthread.h>
#endif
#include "cmbs_int.h" /* internal API structure and defines */
#if defined( CMBS_API_TARGET )
#include "tapp_log.h"
#endif
#include "cfr_debug.h" /* debug handling */
#if !defined ( CMBS_API_TARGET )
E_CMBS_RC cfr_ie_DeregisterThread(u32 u32_ThreadId)
{
u8 u8_idx;
u8 u8_idx_max = sizeof(g_CMBSInstance.st_ApplSlot.u8_IEBuffers) / sizeof(g_CMBSInstance.st_ApplSlot.u8_IEBuffers[0]);
for (u8_idx = 0; u8_idx < u8_idx_max; ++u8_idx)
{
if ( g_CMBSInstance.st_ApplSlot.u32_ThreadIdArray[u8_idx] == u32_ThreadId )
{
// Current u8_idx represents the index of u8_IEBuffers
g_CMBSInstance.st_ApplSlot.u32_ThreadIdArray[u8_idx] = 0;
return CMBS_RC_OK;
}
}
// not found
return CMBS_RC_ERROR_PARAMETER;
}
u8 cfr_ie_getThreadIdx(void)
{
u32 u32_CurrentThreadId;
u8 u8_idx;
u8 u8_idx_max = sizeof(g_CMBSInstance.st_ApplSlot.u8_IEBuffers) / sizeof(g_CMBSInstance.st_ApplSlot.u8_IEBuffers[0]);
#if defined ( WIN32 )
u32_CurrentThreadId = (u32)GetCurrentThreadId();
#endif // defined ( WIN32 )
#if defined ( __linux__ )
u32_CurrentThreadId = (u32)pthread_self();
#endif // defined ( __linux__ )
for (u8_idx = 0; u8_idx < u8_idx_max; ++u8_idx)
{
if ( g_CMBSInstance.st_ApplSlot.u32_ThreadIdArray[u8_idx] == u32_CurrentThreadId )
{
// Current u8_idx represents the index of u8_IEBuffers
break;
}
}
if ( u8_idx == u8_idx_max )
{
u8_idx = CMBS_UNKNOWN_THREAD;
}
return u8_idx;
}
u8 cfr_ie_AllocThreadIdx(void)
{
u32 u32_CurrentThreadId;
u8 u8_idx;
u8 u8_idx_max = sizeof(g_CMBSInstance.st_ApplSlot.u8_IEBuffers) / sizeof(g_CMBSInstance.st_ApplSlot.u8_IEBuffers[0]);
#if defined ( WIN32 )
u32_CurrentThreadId = (u32)GetCurrentThreadId();
#endif // defined ( WIN32 )
#if defined ( __linux__ )
u32_CurrentThreadId = (u32)pthread_self();
#endif // defined ( __linux__ )
for ( u8_idx = 0; u8_idx < u8_idx_max; ++u8_idx )
{
if ( g_CMBSInstance.st_ApplSlot.u32_ThreadIdArray[u8_idx] == 0 )
{
// We found a free entry
g_CMBSInstance.st_ApplSlot.u32_ThreadIdArray[u8_idx] = u32_CurrentThreadId;
// CFR_DBG_OUT("New entry %d assign to thread id %d\n", u8_idx, u32_CurrentThreadId);
break;
}
}
if ( u8_idx == u8_idx_max )
{
u8_idx = CMBS_UNKNOWN_THREAD;
}
return u8_idx;
}
#endif
void* cfr_ie_ListNew(u8 *pu8_Buffer, u16 u16_Size)
{
PST_CFR_IE_LIST p_List;
u8 u8_idx;
if ( !u16_Size || !pu8_Buffer )
{
#if defined ( CMBS_API_TARGET )
// When target, always use index 0
u8_idx = 0;
p_List = &g_CMBSInstance.st_ApplSlot.st_TransmitterIEList;
memset(p_List, 0, sizeof(ST_CFR_IE_LIST));
#else
// Linux or WIN32 on host
u8_idx = cfr_ie_getThreadIdx();
if ( u8_idx == CMBS_UNKNOWN_THREAD )
{
// Try to allocate new entry for this thread
u8_idx = cfr_ie_AllocThreadIdx();
if ( u8_idx == CMBS_UNKNOWN_THREAD )
{
CFR_DBG_OUT("Not enough entries to store Thread Id !!!\n");
return NULL;
}
}
p_List = &g_CMBSInstance.st_ApplSlot.st_TransmitterIEList[u8_idx];
memset(p_List, 0, sizeof(ST_CFR_IE_LIST));
#endif // defined ( CMBS_API_TARGET )
p_List->pu8_Buffer = g_CMBSInstance.st_ApplSlot.u8_IEBuffers[u8_idx];
p_List->u16_MaxSize = sizeof(g_CMBSInstance.st_ApplSlot.u8_IEBuffers[u8_idx]);
return p_List;
}
else
{
CFR_DBG_OUT("cfr_ie_ListNew: Dynamic is not implemented, yet\n");
}
return NULL;
}
int cfr_ie_ItemAdd(PST_CFR_IE_LIST p_List, u8 *pu8_Buffer, u16 u16_Size)
{
if ( p_List->u16_MaxSize > (u16_Size + p_List->u16_CurSize) )
{
memcpy(p_List->pu8_Buffer + p_List->u16_CurSize, pu8_Buffer, u16_Size);
p_List->u16_CurSize += u16_Size;
return 0;
}
CFR_DBG_ERROR("[ERROR] cfr_ie_ItemAdd MaxSize=%d u16_Size=%d u16_CurSize=%d", p_List->u16_MaxSize, u16_Size, p_List->u16_CurSize);
return -1;
}
u8* cfr_ie_ItemGet(PST_CFR_IE_LIST p_List)
{
// check if IE length is correct
if ( p_List->u16_CurSize - p_List->u16_CurIE < CFR_IE_HEADER_SIZE )
return NULL;
// return pointer to IE
return p_List->pu8_Buffer + p_List->u16_CurIE;
}
u8* cfr_ie_ItemFirstGet(PST_CFR_IE_LIST p_List)
{
// set current IE to first one
p_List->u16_CurIE = 0;
// return IE item
return cfr_ie_ItemGet(p_List);
}
u8* cfr_ie_ItemNextGet(PST_CFR_IE_LIST p_List)
{
u16 u16_NextIE = 0, u16_IESize = 0;
// 16 bit size
cfr_ie_dser_u16(p_List->pu8_Buffer + p_List->u16_CurIE + CFR_IE_SIZE_POS, &u16_IESize);
u16_NextIE = p_List->u16_CurIE + // start of current IE
CFR_IE_HEADER_SIZE + // IE type 16 bit + IE length 16 bit
u16_IESize; // size of current IE
if ( p_List->u16_CurSize > u16_NextIE )
{
p_List->u16_CurIE = u16_NextIE;
return cfr_ie_ItemGet(p_List);
}
return NULL;
}
u16 cfr_ie_ser_u8(u8 *pu8_Buffer, u8 u8_Value)
{
if ( !pu8_Buffer )
return 0;
pu8_Buffer[0] = u8_Value;
return sizeof(u8);
}
u16 cfr_ie_ser_u16(u8 *pu8_Buffer, u16 u16_Value)
{
u8 *pu8_16 = (u8 *)&u16_Value;
if ( !pu8_Buffer )
return 0;
#if defined( CMBS_API_TARGET )
memcpy(pu8_Buffer, pu8_16, sizeof(u16_Value));
#else // Host
if ( g_CMBSInstance.e_Endian == E_CMBS_ENDIAN_LITTLE )
{
memcpy(pu8_Buffer, &u16_Value, sizeof(u16_Value));
}
else
{
pu8_Buffer[0] = pu8_16[1];
pu8_Buffer[1] = pu8_16[0];
}
#endif
return sizeof(u16_Value);
}
u16 cfr_ie_ser_u32(u8 *pu8_Buffer, u32 u32_Value)
{
u8 *pu8_32 = (u8 *)&u32_Value;
if ( !pu8_Buffer )
return 0;
#if defined( CMBS_API_TARGET )
memcpy(pu8_Buffer, pu8_32, sizeof(u32));
#else // Host
if ( g_CMBSInstance.e_Endian == E_CMBS_ENDIAN_LITTLE )
{
memcpy(pu8_Buffer, &u32_Value, sizeof(u32));
}
else if ( g_CMBSInstance.e_Endian == E_CMBS_ENDIAN_BIG )
{
pu8_Buffer[0] = pu8_32[3];
pu8_Buffer[1] = pu8_32[2];
pu8_Buffer[2] = pu8_32[1];
pu8_Buffer[3] = pu8_32[0];
}
else if ( g_CMBSInstance.e_Endian == E_CMBS_ENDIAN_MIXED )
{
pu8_Buffer[0] = pu8_32[1];
pu8_Buffer[1] = pu8_32[0];
pu8_Buffer[2] = pu8_32[3];
pu8_Buffer[3] = pu8_32[2];
}
else
{
return 0;
}
#endif
return sizeof(u32);
}
u16 cfr_ie_ser_pu8(u8 *pu8_Buffer, u8 *pu8_Data, u16 u16_DataSize)
{
if ( !pu8_Data )
return 0;
memcpy(pu8_Buffer, pu8_Data, u16_DataSize);
return u16_DataSize;
}
u16 cfr_ie_dser_u8(u8 *pu8_Buffer, u8 *pu8_Value)
{
if ( !pu8_Buffer || !pu8_Value )
return 0;
*pu8_Value = pu8_Buffer[0];
return sizeof(u8);
}
u16 cfr_ie_dser_u16(u8 *pu8_Buffer, u16 *pu16_Value)
{
u8 *pu8_16 = (u8 *)pu16_Value;
if ( !pu8_Buffer || !pu16_Value )
return 0;
#if defined( CMBS_API_TARGET )
pu8_16[1] = pu8_Buffer[1];
pu8_16[0] = pu8_Buffer[0];
#else // Host
if ( g_CMBSInstance.e_Endian == E_CMBS_ENDIAN_LITTLE )
{
memcpy(pu8_16, pu8_Buffer, sizeof(u16));
}
else
{
pu8_16[1] = pu8_Buffer[0];
pu8_16[0] = pu8_Buffer[1];
}
#endif
return sizeof(u16);
}
u16 cfr_ie_dser_s32(u8 *pu8_Buffer, s32 *ps32_Value)
{
return cfr_ie_dser_u32(pu8_Buffer, (u32 *)ps32_Value);
}
u16 cfr_ie_dser_u32(u8 *pu8_Buffer, u32 *pu32_Value)
{
u8 *pu8_32 = (u8 *)pu32_Value;
if ( !pu8_Buffer || !pu32_Value )
return 0;
#if defined( CMBS_API_TARGET )
memcpy(pu8_32, pu8_Buffer, sizeof(u32));
#else // Host
if ( g_CMBSInstance.e_Endian == E_CMBS_ENDIAN_LITTLE )
{
memcpy(pu8_32, pu8_Buffer, sizeof(u32));
}
else if ( g_CMBSInstance.e_Endian == E_CMBS_ENDIAN_BIG )
{
pu8_32[3] = pu8_Buffer[0];
pu8_32[2] = pu8_Buffer[1];
pu8_32[1] = pu8_Buffer[2];
pu8_32[0] = pu8_Buffer[3];
}
else if ( g_CMBSInstance.e_Endian == E_CMBS_ENDIAN_MIXED )
{
pu8_32[1] = pu8_Buffer[0];
pu8_32[0] = pu8_Buffer[1];
pu8_32[3] = pu8_Buffer[2];
pu8_32[2] = pu8_Buffer[3];
}
else
{
*pu32_Value = 0;
return 0;
}
#endif
return sizeof(u32);
}
u16 cfr_ie_dser_pu8(u8 *pu8_Buffer, u8 *pu8_Data, u16 u16_DataSize)
{
if ( !pu8_Buffer || !pu8_Data )
return 0;
memcpy(pu8_Data, pu8_Buffer, u16_DataSize);
return u16_DataSize;
}
//*/

168
dectmngr/src/frame/cfr_ie.h Executable file
View File

@@ -0,0 +1,168 @@
/*!
* \file cfr_ie.h
* \brief
* \Author kelbch
*
* @(#) %filespec: cfr_ie.h~DMZD53#6 %
*
*******************************************************************************
* \par History
* \n==== History ============================================================\n
* date name version action \n
* ----------------------------------------------------------------------------\n
* 27-05-14 ronenw GIT Added common ie for cmbs and han
*
*******************************************************************************/
#if !defined( CFR_IE_H )
#define CFR_IE_H
#include "cmbs_ie.h"
#include "cmbs_han.h"
#define CFR_IE_TYPE_POS 0
#define CFR_IE_SIZE_POS 2
#define CFR_IE_HEADER_SIZE 4
typedef struct
{
u16 u16_MaxSize;
u16 u16_CurSize;
u16 u16_CurIE;
u8 * pu8_Buffer;
} ST_CFR_IE_LIST, * PST_CFR_IE_LIST;
#define TEMP_SIZE (CMBS_PARAM_MAX_LENGTH+100)
typedef union
{
u8 u8_BufferByteValueAdd[CFR_IE_HEADER_SIZE + sizeof(u8)];
u8 u8_BufferShortValueAdd[CFR_IE_HEADER_SIZE + sizeof(u16)];
u8 u8_BufferByteU32ValueAdd[CFR_IE_HEADER_SIZE + sizeof(u32)];
u8 u8_BufferReqAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_CALLTRANSFERREQ)];
u8 u8_BufferInternalReqAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_INTERNAL_TRANSFER)];
u8 u8_BufferCallerPartyAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_CALLERPARTY)+ CMBS_CALLER_NUM_MAX_LEN];
u8 u8_BufferCalledPartyAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_CALLEDPARTY)+ CMBS_CALLER_NUM_MAX_LEN];
u8 u8_BufferCallerNameAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_CALLINFO)+ TEMP_SIZE];
u8 u8_BufferCallInfoAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_CALLINFO)+ TEMP_SIZE];
u8 u8_BufferDisplayStringAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_DISPLAY_STRING)+ CMBS_DISPLAY_STRING_LENGTH];
u8 u8_BufferReleaseReasonAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_RELEASE_REASON)];
u8 u8_BufferCallStateAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_CALL_STATE)];
u8 u8_BufferChannelAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_MEDIA_CHANNEL)];
u8 u8_BufferAudioShmemAdd[ CFR_IE_HEADER_SIZE + sizeof(ST_IE_AUDIO_SHMEM)];
u8 u8_BufferICAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_MEDIA_INTERNAL_CONNECT)];
u8 u8_BufferDescAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_MEDIA_DESCRIPTOR)];
u8 u8_BufferInfoAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_HANDSETINFO)];
u8 u8_BufferParameterAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_PARAMETER)+ TEMP_SIZE];
u8 u8_BufferHsListAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_SUBSCRIBED_HS_LIST)+ TEMP_SIZE];
u8 u8_BufferSettingsAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_LINE_SETTINGS_LIST)];
u8 u8_BufferVersionAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_FW_VERSION)];
u8 u8_BufferLogAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_SYS_LOG)];
u8 u8_BufferAreaAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_PARAMETER_AREA)+ TEMP_SIZE];
u8 u8_BufferGenEventAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_GEN_EVENT)];
u8 u8_BufferPropEventAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_PARAMETER_AREA)+ TEMP_SIZE];
u8 u8_BufferDateAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_DATETIME)];
u8 u8_BufferSessionTypeAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_DATA_SESSION_TYPE)];
u8 u8_BufferDataAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_DATA)+ TEMP_SIZE];
u8 u8_BufferFieldsAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_LA_FIELDS)];
u8 u8_BufferCriteriaAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_LA_SEARCH_CRITERIA)];
u8 u8_BufferATESettingsAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_ATE_SETTINGS)];
u8 u8_BufferVersionAvailAdd[CFR_IE_HEADER_SIZE + sizeof(ST_SUOTA_UPGRADE_DETAILS)+ 1];// because of bit fields
u8 u8_BufferVersionBufAdd[CFR_IE_HEADER_SIZE + sizeof(ST_VERSION_BUFFER)];
u8 u8_BufferVersionIndAdd[CFR_IE_HEADER_SIZE + sizeof(ST_SUOTA_HS_VERSION_IND)];
u8 u8_BufferURLAdd[CFR_IE_HEADER_SIZE + sizeof(ST_URL_BUFFER)];
u8 u8_BufferChangeNotifAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_TARGET_LIST_CHANGE_NOTIF)];
u8 u8_BufferHwVersionAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_HW_VERSION)];
u8 u8_BufferDectSettingsAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_DECT_SETTINGS_LIST)];
u8 u8_BufferPropSettingsAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_PROP_FIELDS_LIST)];
u8 u8_BufferSessionInfoAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_RTP_SESSION_INFORMATION)];
u8 u8_BufferDTMFEventAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_RTP_DTMF_EVENT)];
u8 u8_BufferDTMFEventInfoAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_RTP_DTMF_EVENT_INFO)];
u8 u8_BufferPropCmdAdd[CFR_IE_HEADER_SIZE + sizeof(ST_LA_PROP_CMD)];
u8 u8_BufferBaseNameAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_BASE_NAME)];
u8 u8_BufferHsPropEventAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_HS_PROP_EVENT)+ TEMP_SIZE];
u8 u8_BufferSYPOSpecificationAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_SYPO_SPECIFICATION)];
u8 u8_BufferAFEEndpointConnectionAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_AFE_ENDPOINTS_CONNECT)];
u8 u8_BufferAFEEndpointAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_AFE_ENDPOINT)];
u8 u8_BufferAFEEndpointGainAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_AFE_ENDPOINT_GAIN)];
u8 u8_BufferAFEEndpointGainDBAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_AFE_ENDPOINT_GAIN)];
u8 u8_BufferAFEAUXMeasureSettingsAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_AFE_AUX_MEASUREMENT_SETTINGS)];
u8 u8_BufferAFEAUXMeasureResultAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_AFE_AUX_MEASUREMENT_RESULT)];
u8 u8_BufferGPIOIDAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_GPIO_ID)];
u8 u8_BufferPWMIDAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_PWM_ID)];
u8 u8_BufferExtINTConfigAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_INT_CONFIGURATION)];
u8 u8_BufferTerminalCapabilitiesAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_TERMINAL_CAPABILITIES)];
u8 u8_BufferChecksumErrorAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_CHECKSUM_ERROR)];
u8 u8_BuffeCallHoldReasonAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_CALL_HOLD_REASON)];
u8 u8_BufferCalledNameAdd[CFR_IE_HEADER_SIZE + 3 * sizeof(u8) + 2 * CMBS_CALLED_NAME_MAX_LEN];
u8 u8_BufferSuotaFileInfoAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_SUOTA_FILE_INFO)];
u8 u8_DTAMStartSessionCfmAdd[CFR_IE_HEADER_SIZE + sizeof(ST_CMBS_DTAM_START_SESSION_CFM)];
u8 u8_DTAMCommandNackAdd[CFR_IE_HEADER_SIZE + sizeof(ST_CMBS_DTAM_NACK)];
u8 u8_DTAMStatusAdd[CFR_IE_HEADER_SIZE + sizeof(ST_CMBS_DTAM_STATUS)];
u8 u8_BufferLineTestResultsAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_SLIC_LINE_TEST_RES)];
u8 u8_BufferNltCapTestResultsAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_SLIC_NLT_CAP_TEST_RES)];
u8 u8_BufferJEDECIdAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_CMBS_JEDEC_ID)];
u8 u8_BufferUpdatedDeviceStateAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_UPDATED_DEVICE_STATE)];
u8 u8_BufferCallListAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_CALL_LIST)+ TEMP_SIZE];
u8 HanTableAdd[ CFR_IE_HEADER_SIZE + CMBS_HAN_IE_TABLE_SIZE]; // HAN part
u8 FunDeviceInfo[ CFR_IE_HEADER_SIZE + CMBS_HAN_IE_FUN_DEVICE_INFO_SIZE];
u8 BindRecordAdd[ CFR_IE_HEADER_SIZE + CMBS_HAN_IE_BIND_ENTRY_SIZE];
u8 GroupTableRecordAdd[ CFR_IE_HEADER_SIZE + CMBS_HAN_IE_GROUP_TABLE_ENTRY_SIZE];
u8 GroupListRecordAdd[ CFR_IE_HEADER_SIZE + CMBS_HAN_IE_GROUP_LIST_ENTRY_SIZE];
u8 RegInfoAdd[ CFR_IE_HEADER_SIZE + sizeof(ST_HAN_MSG_REG_INFO)];
u8 HanMsgAdd[ CFR_IE_HEADER_SIZE + sizeof(ST_IE_HAN_MSG) + CMBS_HAN_MAX_MSG_LEN];
u8 UpdateInfoAdd[ CFR_IE_HEADER_SIZE + sizeof(ST_IE_HAN_TABLE_UPDATE_INFO)];
u8 Stage1ParamsAdd[ CFR_IE_HEADER_SIZE + sizeof(ST_HAN_REG_STAGE_1_STATUS)];
u8 Stage2ParamsAdd[ CFR_IE_HEADER_SIZE + sizeof(ST_HAN_REG_STAGE_2_STATUS)];
u8 HanBaseInfoAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_HAN_BASE_INFO)];
u8 UnknownDeviceParamsAdd[ CFR_IE_HEADER_SIZE + sizeof(ST_HAN_UNKNOWN_DEVICE_CONTACT_PARAMS)];
u8 HanFullRegistrationInfo[ CFR_IE_HEADER_SIZE + sizeof(ST_HAN_FULL_DEVICE_REGISTRATION_INFO)];
u8 HanULEDeviceIPUI[ CFR_IE_HEADER_SIZE + sizeof(ST_IE_HAN_ULE_DEVICE_IPUI)];
u8 HanULETBR6Statistics[ CFR_IE_HEADER_SIZE + sizeof(ST_IE_HAN_ULE_TBR6_STATISTICS)];
u8 u8_BufferDeviceListAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_DEVICE_LIST_STATUS)];
u8 BufferHSRelReasonAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_HS_RELEASE_REASON)];
u8 u8_BufferEntryRageAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_LA_ENTRY_RANGE)];
u8 u8_BufferEntryIdsAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_LA_ENTRY_IDS)];
u8 u8_BufferGenEventDetailsAdd[CFR_IE_HEADER_SIZE + sizeof(ST_IE_GEN_EVENT_DETAILS)];
}
U_Buffer;
#if defined( __cplusplus )
extern "C"
{
#endif
void * cfr_ie_ListNew( u8* pu8_Buffer, u16 u16_Size );
int cfr_ie_ItemAdd( PST_CFR_IE_LIST p_List, u8 * pu8_Buffer, u16 u16_Size );
u8* cfr_ie_ItemGet( PST_CFR_IE_LIST p_List );
u8* cfr_ie_ItemNextGet( PST_CFR_IE_LIST p_List );
u8* cfr_ie_ItemFirstGet ( PST_CFR_IE_LIST p_List );
void cfr_ie_Serialize( PST_CFR_IE_LIST p_List, E_CMBS_IE_TYPE e_IE, void * pv_Data );
u16 cfr_ie_ser_pu8 ( u8 * pu8_buffer, u8 * pu8_Data, u16 u16_DataSize );
u16 cfr_ie_ser_u8 ( u8 * pu8_Buffer, u8 u8_Value );
u16 cfr_ie_ser_u16 ( u8 * pu8_buffer, u16 u16_Value );
u16 cfr_ie_ser_u32 ( u8 * pu8_buffer, u32 u32_Value );
u16 cfr_ie_dser_pu8 ( u8 * pu8_Buffer, u8 * pu8_Data, u16 u16_DataSize );
u16 cfr_ie_dser_u8 ( u8 * pu8_Buffer, u8 * pu8_Value );
u16 cfr_ie_dser_u16 ( u8 * pu8_Buffer, u16 * pu16_Value );
u16 cfr_ie_dser_u32 ( u8 * pu8_Buffer, u32 * pu32_Value );
u16 cfr_ie_dser_s32(u8 *pu8_Buffer, s32 *ps32_Value);
E_CMBS_RC cfr_ie_DeregisterThread (u32 u32_ThreadId);
#if !defined ( CMBS_API_TARGET )
u8 cfr_ie_getThreadIdx(void);
u8 cfr_ie_AllocThreadIdx(void);
#endif
#if defined( __cplusplus )
}
#endif
#endif // CFR_IE_H
//*/

View File

@@ -0,0 +1,470 @@
/*!
* \file cfr_cmbs.c
* \brief Target side
* \author stein
*
* @(#) %filespec: cfr_cmbs.c~10 %
*
*******************************************************************************
* \par History
* \n==== History ============================================================ \n
* date name version action \n
* --------------------------------------------------------------------------- \n
* 14-feb-09 R.Stein 1 Initialize \n
* 14-feb-09 D.Kelbch 2 Project integration - VONE \n
* 09-Apr-09 Kelbch 161 Update of Media Configuration during start-up\n
*******************************************************************************/
#include <syslog.h>
#include "cmbs_platf.h"
#include "cmbs_int.h" /* internal API structure and defines */
#include "cfr_uart.h" /* packet handler */
#ifdef CMBS_COMA
#include "cfr_coma.h" /* packet handler */
#endif
#include "cfr_debug.h" /* debug handling */
void * _cmbs_int_CbThread( void * pVoid );
void cmbs_exit_callbThread(void);
static int G_MsgQueue;
volatile int g_WaitForResponseFlag = 0;
/* GLOBALS */
ST_CMBS_API_INST g_CMBSInstance; // global CMBS instance object
// ========== _cmbs_int_StartupBlockSignal ===========
/*!
\brief signal to block statement that CMBS is available
\param[in] pst_CMBSInst pointer to CMBS instance object
\return <none>
*/
void _cmbs_int_StartupBlockSignal( PST_CMBS_API_INST pst_CMBSInst )
{
// Update flag to CMBS host API, target available
g_WaitForResponseFlag = 1;
}
// ========== _cmbs_int_MsgQCreate ===========
/*!
\brief Create a message queue
\param[in,out] < none >
\return < int > return identifier of queue. If there was an error, a value of -1 is returned.
*/
int _cmbs_int_MsgQCreate( void )
{
int id = -1;
id = msgget( IPC_PRIVATE, IPC_CREAT | IPC_EXCL | 0666 );
if( id == -1 )
{
switch( errno )
{
case EEXIST:
CFR_DBG_ERROR( "[ERROR]msgget, message queue exists (EEXIST)\n" );
break;
case ENOMEM:
CFR_DBG_ERROR( "[ERROR]msgget, not enough memory (ENOMEM)\n" );
break;
case ENOSPC:
CFR_DBG_ERROR( "[ERROR]msgget, max. number of queues (MSGMNI) exceeded\n" );
break;
default:
perror( "[ERROR]msgget" );
}
}
return id;
}
// ========== _cmbs_int_MsgQDestroy ===========
/*!
\brief Destroy message queue
\param[in] nMsgQId message queue identifier
\return < none >
*/
void _cmbs_int_MsgQDestroy( int nMsgQId )
{
if( msgctl(nMsgQId, IPC_RMID, 0) == -1 )
{
perror( "[ERROR]msgctl" );
}
}
// ========== cmbs_int_EnvCreate ===========
/*!
\brief build up the environment of CMBS-API. Open the relevant devices and starts the pumps.
\param[in,out] e_Mode to be used CMBS mode, currently only CMBS Multiline is supported
\param[in,out] pst_DevCtl pointer to device call control properties
\param[in,out] pst_DevMedia pointer to device media control properties
\return < E_CMBS_RC >
*/
E_CMBS_RC cmbs_int_EnvCreate( E_CMBS_API_MODE e_Mode, ST_CMBS_DEV * pst_DevCtl, ST_CMBS_DEV * pst_DevMedia )
{
int rc;
UNUSED_PARAMETER(pst_DevMedia);
openlog("cmbs_api.c", LOG_CONS | LOG_PID, LOG_NEWS);
memset( &g_CMBSInstance, 0, sizeof(g_CMBSInstance) );
// initialize the device control
if( !pst_DevCtl )
{
CFR_DBG_ERROR( "[ERROR] cmbs_int_EnvCreate: Device type is not specified\n");
return CMBS_RC_ERROR_PARAMETER;
}
pthread_cond_init( &g_CMBSInstance.cond_UnLock, NULL );
pthread_mutex_init( &g_CMBSInstance.cond_Mutex, NULL );
CFR_CMBS_INIT_CRITICALSECTION ( g_CMBSInstance.h_CriticalSectionTransmission );
CFR_CMBS_INIT_CRITICALSECTION ( g_CMBSInstance.h_TxThreadCriticalSection);
g_CMBSInstance.u32_CallInstanceCount = 0x80000000;
g_CMBSInstance.e_Mode = e_Mode; // useful later, if the API is connected to target side.
g_CMBSInstance.e_Endian = cmbs_int_EndiannessGet();
g_CMBSInstance.eDevCtlType = pst_DevCtl->e_DevType;
g_CMBSInstance.eDevMediaType= pst_DevMedia->e_DevType;
do
{
// create message queue
if( (g_CMBSInstance.msgQId = _cmbs_int_MsgQCreate() ) == -1 )
{
CFR_DBG_ERROR( "cmbs_int_EnvCreate: ERROR creating message queue\n" );
break;
}
// initialize device configuration
if(pst_DevCtl->e_DevType == CMBS_DEVTYPE_UART)
{
g_CMBSInstance.fdDevCtl = cfr_uartInitialize( pst_DevCtl->u_Config.pUartCfg);
}
else if(pst_DevCtl->e_DevType == CMBS_DEVTYPE_USB)
{
g_CMBSInstance.fdDevCtl = cfr_usbInitialize( pst_DevCtl->u_Config.pUartCfg);
}
#ifdef CMBS_COMA
else if(pst_DevCtl->e_DevType == CMBS_DEVTYPE_COMA)
{
g_CMBSInstance.fdDevCtl = cfr_comaInitialize( pst_DevCtl->u_Config.pUartCfg);
}
#endif
else
{
CFR_DBG_ERROR( "[ERROR] cmbs_int_EnvCreate: Specified device type is not supported now\n");
break;
}
if( g_CMBSInstance.fdDevCtl == -1 )
{
CFR_DBG_ERROR( "[ERROR] cmbs_int_EnvCreate: Couldn't open Serial device\n" );
break;
}
#ifdef CMBS_COMA
rc = pthread_create( &g_CMBSInstance.serialThreadId, NULL, & cfr_comaThread, &g_CMBSInstance );
#else
rc = pthread_create( &g_CMBSInstance.serialThreadId, NULL, & cfr_uartThread, &g_CMBSInstance );
#endif
if( rc != 0 )
{
CFR_DBG_ERROR( "[ERROR] cmbs_int_EnvCreate: Couldn't create Serial Thread. ErrorCode: %d\n", rc );
break;
}
// control device pipe is established, start control thread
rc = pthread_create( &g_CMBSInstance.callbThreadId, NULL, &_cmbs_int_CbThread, &g_CMBSInstance );
if( rc != 0 )
{
CFR_DBG_ERROR( "[ERROR] cmbs_int_EnvCreate: Couldn't create CB Thread. ErrorCode: %d\n", rc );
break;
}
return CMBS_RC_OK;
}while(FALSE);
CFR_CMBS_DELETE_CRITICALSECTION ( g_CMBSInstance.h_CriticalSectionTransmission );
CFR_CMBS_DELETE_CRITICALSECTION ( g_CMBSInstance.h_TxThreadCriticalSection );
return CMBS_RC_ERROR_GENERAL;
}
// ========== cmbs_int_WaitForResponse ===========
/*!
\brief Waits for target response using timeout in ms
\param[in,out] u32_TimeoutMs waiting timeout in ms
\return < E_CMBS_RC >
*/
E_CMBS_RC cmbs_int_WaitForResponse(u32 u32_TimeoutMs)
{
u32 u32_TimeoutSec = u32_TimeoutMs/1000;
u32 u32_numOfSec = 0;
while(u32_numOfSec < u32_TimeoutSec)
{
if(g_WaitForResponseFlag== 1)
{
g_WaitForResponseFlag = 0;
return CMBS_RC_OK;
}
u32_numOfSec++;
sleep(1);
}
CFR_DBG_ERROR( "[ERROR] cmbs_int_WaitForResponse: pthread_cond_timedwait returned error\n");
return CMBS_RC_ERROR_OPERATION_TIMEOUT;
}
// ========== cmbs_int_EnvDestroy ===========
/*!
\brief clean up the CMBS environment
\param[in,out] < none >
\return < E_CMBS_RC >
*/
E_CMBS_RC cmbs_int_EnvDestroy( void )
{
// maybe we need to de-register on module side
if( g_CMBSInstance.serialThreadId )
{
pthread_cancel( g_CMBSInstance.serialThreadId );
pthread_join(g_CMBSInstance.serialThreadId, NULL);
}
if( g_CMBSInstance.callbThreadId )
{
cmbs_exit_callbThread();
pthread_join(g_CMBSInstance.callbThreadId, NULL);
}
pthread_cond_destroy( &g_CMBSInstance.cond_UnLock );
pthread_mutex_destroy( &g_CMBSInstance.cond_Mutex );
CFR_CMBS_DELETE_CRITICALSECTION ( g_CMBSInstance.h_CriticalSectionTransmission );
CFR_CMBS_DELETE_CRITICALSECTION ( g_CMBSInstance.h_TxThreadCriticalSection );
if( g_CMBSInstance.msgQId != -1 )
_cmbs_int_MsgQDestroy( g_CMBSInstance.msgQId );
close( g_CMBSInstance.fdDevCtl );
closelog();
return CMBS_RC_OK;
}
void cmbs_exit_callbThread(void)
{
ST_CMBS_LIN_MSG LinMsg;
LinMsg.msgType = 2;
LinMsg.msgData.nLength = 4;
LinMsg.msgData.u8_Data[0] = 'E';
LinMsg.msgData.u8_Data[1] = 'X';
LinMsg.msgData.u8_Data[2] = 'I';
LinMsg.msgData.u8_Data[3] = 'T';
if( msgsnd( G_MsgQueue, &LinMsg, (LinMsg.msgData.nLength + sizeof(LinMsg.msgData.nLength)), 0 ) < 0 )
{
CFR_DBG_ERROR( "UartThread: msgsnd ERROR:%d\n", errno );
}
}
// ========== _cmbs_int_CbThread ===========
/*!
\brief callback pump to receive and call application call-back
\param[in,out] pVoid pointer to CMBS instance object
\return < void * > always NULL
*/
void * _cmbs_int_CbThread( void * pVoid )
{
PST_CMBS_API_INST
pInstance = (PST_CMBS_API_INST)pVoid;
int msgQId = pInstance->msgQId;
int nRetVal;
size_t nMsgSize;
ST_CMBS_LIN_MSG
LinMsg;
U_CMBS_SER_DATA
CmbsMsg;
u32 u32_Sync = CMBS_SYNC;
static u32 nDataIndex = 0;
static bool bNewMessage = TRUE;
G_MsgQueue = msgQId;
nMsgSize = sizeof( LinMsg.msgData );
// never ending loop
// thread will be exited automatically when parent thread finishes
while( 1 )
{
/*
msgrcv() returns -1 if error.
A signal can arrive and be handled while an I/O primitive such as msgrcv(), open() or read() is waiting for an I/O device.
When msgrcv() returned error of EINTR, it is means that this call did not succeed because it was interrupted.
However, if you try again, it will probably work.
In other words, EINTR is not a fatal error - it just means you should retry msgrcv().
*/
nRetVal = msgrcv( msgQId, &LinMsg, nMsgSize, 0, 0);
if( nRetVal == -1 )
{
if (EINTR == errno)
{
return NULL;
}
CFR_DBG_ERROR( "[ERROR]CB Thread: !!!! msgrcv ERROR:%d\n", errno );
}
else
{
u32 i;
u32 LinMsgIndex = 0;
/*
CFR_DBG_OUT( "Received raw data %2d bytes:", LinMsg.msgData.nLength );
for( i = 0; i < (u32)LinMsg.msgData.nLength; i++ )
{
CFR_DBG_OUT( " %02X", LinMsg.msgData.u8_Data[i] );
}
CFR_DBG_OUT( "\n" );
*/
if (bNewMessage)
{
if( ( LinMsg.msgType == 2) &&
( LinMsg.msgData.nLength == 4 ) &&
( LinMsg.msgData.u8_Data[0] == 'E' ) &&
( LinMsg.msgData.u8_Data[1] == 'X' ) &&
( LinMsg.msgData.u8_Data[2] == 'I' ) &&
( LinMsg.msgData.u8_Data[3] == 'T' ))
{
CFR_DBG_OUT("--> EXIT message arrived to CbThread \n" );
return NULL;
}
else
// If waiting for a new message, eliminate any non DA preceeding
for (i=0; i<(u32)LinMsg.msgData.nLength; i++)
{
if (LinMsg.msgData.u8_Data[i] != 0xDA)
{
LinMsgIndex++;
}
else
{
break;
}
}
if (LinMsgIndex >0)
{
//shift arriving bytes to beginning of buffer (to start with DA)
for (i=0; i<(u32)LinMsg.msgData.nLength - LinMsgIndex ; i++)
{
LinMsg.msgData.u8_Data[i] = LinMsg.msgData.u8_Data[LinMsgIndex + i];
}
CFR_DBG_OUT("LinMsgIndex = %d \n",LinMsgIndex);
LinMsg.msgData.nLength -= LinMsgIndex;
}
}
if (LinMsg.msgData.nLength > 0)
{
// parse received message
for( i = 0; i < (u32)LinMsg.msgData.nLength; i++ )
{
if( nDataIndex == 0 )
{
memset( &CmbsMsg, 0, sizeof(CmbsMsg) );
}
// save message data
if( i < sizeof(CmbsMsg.serialBuf) )
{
CmbsMsg.serialBuf[nDataIndex] = LinMsg.msgData.u8_Data[i];
nDataIndex++;
}
else
{
CFR_DBG_ERROR( "[ERROR]CB Thread: !!!! msgrcv ERROR: buffer overflow\n" );
nDataIndex = 0;
break;
}
// validate syc dword
if((bNewMessage) && nDataIndex == sizeof(u32) )
{
if( memcmp( CmbsMsg.serialBuf, &u32_Sync, sizeof(u32)) == 0 )
{
// synch dword detected
bNewMessage = FALSE;
}
else
{
CFR_DBG_ERROR("CmbsMsg.serialBuf = %x %x %x %x \n",CmbsMsg.serialBuf[0],CmbsMsg.serialBuf[1],CmbsMsg.serialBuf[2],CmbsMsg.serialBuf[3]);
CFR_DBG_ERROR( "[ERROR]CB Thread: !!!! msgrcv ERROR: NO sync word detected\n" );
nDataIndex = 0;
break;
}
}
// check cmbs message length
if( nDataIndex >= sizeof(u32) + sizeof(u16) ) // sizeof(u32_Sync) + sizeof(u16_TotalLength)
{
u16 u16_Total ;
if( g_CMBSInstance.e_Endian == E_CMBS_ENDIAN_BIG )
{
u16_Total = cmbs_int_EndianCvt16(CmbsMsg.st_Data.st_Msg.st_MsgHdr.u16_TotalLength);
}
else
{
u16_Total = CmbsMsg.st_Data.st_Msg.st_MsgHdr.u16_TotalLength;
}
if( nDataIndex == sizeof(CmbsMsg.st_Data.u32_Sync) + u16_Total )
{
// we assume that cmbs message is complete
if( g_CMBSInstance.e_Endian == E_CMBS_ENDIAN_BIG )
{
cmbs_int_HdrEndianCvt( &CmbsMsg.st_Data.st_Msg.st_MsgHdr );
}
if( g_CMBSInstance.st_ApplSlot.pFnCbLogBuffer.pfn_cmbs_api_log_incoming_packet_write_finish_cb != NULL )
{
g_CMBSInstance.st_ApplSlot.pFnCbLogBuffer.pfn_cmbs_api_log_incoming_packet_write_finish_cb((u8 *)&CmbsMsg.st_Data.st_Msg, CmbsMsg.st_Data.st_Msg.st_MsgHdr.u16_TotalLength);
}
cmbs_int_EventReceive( (u8 *)&CmbsMsg.st_Data.st_Msg, CmbsMsg.st_Data.st_Msg.st_MsgHdr.u16_TotalLength );
// reset; we might have received more than one cmbs message
nDataIndex = 0;
bNewMessage = TRUE;
}
}
}
}
}
}
return NULL;
}
//*/

View File

@@ -0,0 +1,36 @@
/*!
* \file cfr_coma.h
* \brief
* \author
*******************************************************************************/
#if !defined( CFR_COMA_H )
#define CFR_COMA_H
#include "cmbs_int.h"
/*! current packet transmission size */
#define CFR_BUFFER_WINDOW_SIZE 3
/*! identifier for receive path */
#define CFR_BUFFER_COMA_REC 0
/*! identifier for transmit path */
#define CFR_BUFFER_COMA_TRANS 1
#if defined( __cplusplus )
extern "C"
{
#endif
void * cfr_comaThread( void * pVoid );
int cfr_comaInitialize( void *p );
int cfr_comaPacketPartWrite( u8* pu8_Buffer, u16 u16_Size );
void cfr_comaPacketWriteFinish( u8 u8_BufferIDX );
CFR_E_RETVAL cfr_comaPacketPrepare ( u16 u16_size );
void cfr_comaDataTransmitKick ( void );
void cfr_comaStop(void);
#if defined( __cplusplus )
}
#endif
#endif // CFR_COMA_H
//*/

View File

@@ -0,0 +1,482 @@
/*!
* \file cfr_uart.c
* \brief UART implementation of linux host side
* \author stein
*
* @(#) %filespec: cfr_uart.c~DMZD53#4.1.2 %
*
*******************************************************************************
* \par History
* \n==== History ============================================================\n
* date name version action \n
* ----------------------------------------------------------------------------\n
* 14-feb-09 R.Stein 1 Initialize \n
*******************************************************************************/
#include <stdlib.h>
#include <stddef.h> // for offsetof
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <string.h>
#include <sys/time.h> // we need <sys/select.h>; should be included in <sys/types.h> ???
#include <pthread.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <errno.h>
#include "cmbs_int.h" /* internal API structure and defines */
#include "cfr_uart.h" /* packet handler */
#include "cfr_debug.h" /* debug handling */
// ========== cfr_uartThread ===========
/*!
\brief UART data receive pump. if data is available a message is send
to cfr_cmbs task.
\param[in] pVoid pointer to CMBS instance object
\return <void *> return always NULL
*/
void * cfr_uartThread( void * pVoid )
{
PST_CMBS_API_INST
pInstance = (PST_CMBS_API_INST)pVoid;
int fdDevCtl = pInstance->fdDevCtl;
int msgQId = pInstance->msgQId;
fd_set input_fdset;
ST_CMBS_LIN_MSG LinMsg;
int retval;
// CFR_DBG_OUT( "UART Thread: ID:%lu running\n", (unsigned long)pthread_self() );
/*
Never ending loop.
Thread will be exited automatically when parent thread finishes.
*/
while( 1 )
{
FD_ZERO( &input_fdset );
FD_SET( fdDevCtl, &input_fdset);
/*
select() returns 0 if timeout, 1 if input available, -1 if error.
A signal can arrive and be handled while an I/O primitive such as select(), open() or read() is waiting for an I/O device.
When select() returned error of EINTR, it is means that this call did not succeed because it was interrupted.
However, if you try again, it will probably work.
In other words, EINTR is not a fatal error - it just means you should retry select().
*/
retval = select(fdDevCtl+1, &input_fdset, NULL, NULL, NULL);
if (-1 == retval)
{
if (EINTR == errno)
{
return NULL;
}
CFR_DBG_ERROR( "UartThread Error: select() failed with error %d\n",errno );
/*!\todo exception handling is needed !*/
}
else if (0 == retval)
{
CFR_DBG_ERROR( "UartThread Error: select() failed on timeout error\n");
}
else
{
if( FD_ISSET(fdDevCtl, &input_fdset) )
{
//memset( &LinMsg.msgData, 0, sizeof(LinMsg.msgData) );
/* Reading available data from serial interface */
if( (LinMsg.msgData.nLength = read(fdDevCtl, LinMsg.msgData.u8_Data, sizeof(LinMsg.msgData.u8_Data))) <= 0 )
{
CFR_DBG_ERROR( "UartThread Error: read() failed len=%d\n", LinMsg.msgData.nLength);
#if SU_XHOST
#if SU_XHOST_USB
// Detected disconnection of USB, sending CMBS_EV_DSR_TARGET_UP message to try and reconnect
LinMsg.msgType = 1;
LinMsg.msgData.nLength = 12;
LinMsg.msgData.u8_Data[0] = 0xDA;
LinMsg.msgData.u8_Data[1] = 0xDA;
LinMsg.msgData.u8_Data[2] = 0xDA;
LinMsg.msgData.u8_Data[3] = 0xDA;
LinMsg.msgData.u8_Data[4] = 0x08;
LinMsg.msgData.u8_Data[5] = 0x00;
LinMsg.msgData.u8_Data[6] = 0x00;
LinMsg.msgData.u8_Data[7] = 0x00;
LinMsg.msgData.u8_Data[8] = 0x7D;
LinMsg.msgData.u8_Data[9] = 0x00;
LinMsg.msgData.u8_Data[10] = 0x00;
LinMsg.msgData.u8_Data[11] = 0x00;
if( msgsnd( msgQId, &LinMsg, (LinMsg.msgData.nLength + sizeof(LinMsg.msgData.nLength)), 0 ) < 0 )
{
CFR_DBG_ERROR( "UartThread Error: reconnect msgsnd ERROR:%d\n", errno );
}
return NULL;
#endif
#endif //SU_XHOST
}
else
{
// CFR_DBG_OUT( "UartThread: received %d bytes\n", LinMsg.msgData.nLength );
/* Send what we received to callback thread */
if( msgQId >= 0 )
{
LinMsg.msgType = 1;
// CFR_DBG_OUT( "UartThread: sent %d bytes\n", LinMsg.msgData.nLength + 4 );
if( msgsnd( msgQId, &LinMsg, (LinMsg.msgData.nLength + sizeof(LinMsg.msgData.nLength)), 0 ) < 0 )
{
CFR_DBG_ERROR( "UartThread: msgsnd ERROR:%d\n", errno );
}
else
{
// CFR_DBG_OUT( "UartThread: msgsnd sent ok.\n");
}
}
else
{
CFR_DBG_ERROR( "UartThread: invalid msgQId:%d\n", msgQId );
}
}
}
}
}
return NULL;
}
// ========== cfr_wait_till_characters_transmitted ===========
/*!
\brief Wait till characters are transmitted
\param[in,out] fd pointer to packet part
\return < none >
*/
void cfr_uartWaitPacketPartTransmitFinished(int fd)
{
int rv;
fd_set writefds;
while(1)
{
FD_ZERO(&writefds);
FD_SET(fd, &writefds);
rv=select(fd+1, NULL, &writefds, NULL, NULL);
if (rv >= 0) break;
if (errno != EINTR) break;
}
}
// ========== cfr_uartPacketPartWrite ===========
/*!
\brief write partly the packet into communication device
\param[in,out] pu8_Buffer pointer to packet part
\param[in,out] u16_Size size of packet part
\return < int > currently, alway 0
*/
int cfr_uartPacketPartWrite( u8* pu8_Buffer, u16 u16_Size )
{
// int i;
// CFR_DBG_OUT( "PacketPartWrite: " );
// for (i=0; i < u16_Size; i++ )
// {
// CFR_DBG_OUT( "%02x ",pu8_Buffer[i] );
// write( g_CMBSInstance.fdDevCtl, pu8_Buffer + i, 1 );
// }
// CFR_DBG_OUT( "\n" );
write( g_CMBSInstance.fdDevCtl, pu8_Buffer, u16_Size);
cfr_uartWaitPacketPartTransmitFinished(g_CMBSInstance.fdDevCtl);
return 0;
}
// ========== cfr_uartPacketWriteFinish ===========
/*!
\brief Currently dummy function is not needed on host side
\param[in,out] u8_BufferIDX buffer index
\return < none >
*/
void cfr_uartPacketWriteFinish( u8 u8_BufferIDX )
{
// For logging sent data packets
UNUSED_PARAMETER(u8_BufferIDX);
}
// ========== cfr_uartPacketPrepare ===========
/*!
\brief Currently dummy function is not needed on host side
\param[in,out] u16_size size of to be submitted packet for transmission
\return < CFR_E_RETVAL >
*/
CFR_E_RETVAL cfr_uartPacketPrepare( u16 u16_size )
{
// dummy function
UNUSED_PARAMETER(u16_size);
return CFR_E_RETVAL_OK;
}
// ========== cfr_uartDataTransmitKick ===========
/*!
\brief Currently dummy function is not needed on host side
\param[in,out] < none >
\return < CFR_E_RETVAL >
*/
void cfr_uartDataTransmitKick( void )
{
// dummy function
}
// ========== cfr_uartInitialize ===========
/*!
\brief open the serial communication interface with relevant parameter sets
\param[in,out] pst_Config pointer to UART configuration
\return < int > if failed returns -1, otherwise 0
*/
int cfr_uartInitialize( PST_UART_CONFIG pst_Config )
{
char szDevName[128] = {0};
int fd;
struct termios term_attr;
unsigned int baud = B115200; /* defaults */
// generate device name
if( pst_Config->psz_ComDevName )
{
sprintf( szDevName, "/dev/%s", pst_Config->psz_ComDevName );
}
else if( pst_Config->u8_Port < 1 )
{
// CFR_DBG_WARN( "Warning: Invalid port COM%d. Using default COM1\n", pst_Config->u8_Port );
sprintf( szDevName, "/dev/ttyS0" );
}
else
{
sprintf( szDevName, "/dev/ttyS%d", pst_Config->u8_Port );
}
// open device
if( (fd = open(szDevName, O_RDWR | O_NOCTTY | O_NDELAY)) == -1 )
{
CFR_DBG_ERROR( "Error: Can't open device %s\n", szDevName );
return -1;
}
else
{
CFR_DBG_OUT( "Opened %s\n", szDevName );
/* Configure terminal attributes */
if( tcgetattr(fd, &term_attr) != 0 )
{
CFR_DBG_ERROR( "Error: tcgetattr() for TERM_DEVICE failed\n" );
close ( fd );
return -1;
}
/* setup the serial device communication properties */
term_attr.c_cflag = CS8|CREAD|CLOCAL;//|CRTSCTS;
/* Control flag
CS8 : 8n1 (8bit,no parity,1 stopbit)
CREAD : enable receiving characters
CLOCAL : local connection, no modem control
CRTSCTS : output hardware flow control
*/
/* Raw data transmission; No pre- or post-processing */
term_attr.c_iflag = 0; // Input flag
term_attr.c_oflag = 0; // Output flag
term_attr.c_lflag = 0; // Local flag
switch(pst_Config->u32_BaudRate)
{
case 4800:
baud = B4800;
break;
case 9600:
baud = B9600;
break;
case 19200:
baud = B19200;
break;
case 57600:
baud = B57600;
break;
case 115200:
baud = B115200;
break;
case 230400:
baud = B230400;
break;
default :
baud = B115200;
break;
}
if( cfsetispeed(&term_attr, baud) == -1 )
{
CFR_DBG_ERROR( "Error: failed to set input baud rate\n" );
close (fd);
return -1;
}
if( cfsetospeed(&term_attr, baud) == -1 )
{
CFR_DBG_ERROR( "Error: failed to set output baud rate\n" );
close (fd);
return -1;
}
if( tcsetattr(fd, TCSAFLUSH, &term_attr) != 0 )
{
CFR_DBG_ERROR( "Error: tcsetattr() for TERM_DEVICE failed\n" );
close (fd);
return -1;
}
}
return fd;
}
//todo: rename ST_UART_CONFIG to ST_SERIAL_CONFIG
int cfr_usbInitialize( PST_UART_CONFIG pst_Config )
{
char szDevName[128];
int fd;
struct termios term_attr;
unsigned int baud = B115200; /* defaults */
if(pst_Config->psz_ComDevName)
{
sprintf( szDevName, "/dev/%s", pst_Config->psz_ComDevName );
fd = open(szDevName, O_RDWR | O_NOCTTY | O_NDELAY);
}
else
{
// generate device name /dev/ttyACM
sprintf( szDevName, "/dev/ttyACM%d", pst_Config->u8_Port );
// open device
fd = open(szDevName, O_RDWR | O_NOCTTY | O_NDELAY);
if(fd == -1)
{
// generate device name /dev/ttyUSB
sprintf( szDevName, "/dev/ttyUSB%d", pst_Config->u8_Port );
// open device
fd = open(szDevName, O_RDWR | O_NOCTTY | O_NDELAY);
}
}
if(fd == -1)
{
CFR_DBG_ERROR( "Error: Can't open device /dev/ttyACM%d or /dev/ttyUSB%d\n", pst_Config->u8_Port, pst_Config->u8_Port );
return -1;
}
CFR_DBG_OUT( "Opened %s\n", szDevName );
/* Configure terminal attributes */
if( tcgetattr(fd, &term_attr) != 0 )
{
CFR_DBG_ERROR( "Error: tcgetattr() for TERM_DEVICE failed\n" );
close ( fd );
return -1;
}
/* setup the serial device communication properties */
term_attr.c_cflag = CS8|CREAD|CLOCAL;//|CRTSCTS;
/* Control flag
CS8 : 8n1 (8bit,no parity,1 stopbit)
CREAD : enable receiving characters
CLOCAL : local connection, no modem control
CRTSCTS : output hardware flow control
*/
/* Raw data transmission; No pre- or post-processing */
term_attr.c_iflag = 0; // Input flag
term_attr.c_oflag = 0; // Output flag
term_attr.c_lflag = 0; // Local flag
switch(pst_Config->u32_BaudRate)
{
case 4800:
baud = B4800;
break;
case 9600:
baud = B9600;
break;
case 19200:
baud = B19200;
break;
case 57600:
baud = B57600;
break;
case 115200:
baud = B115200;
break;
case 230400:
baud = B230400;
break;
default :
baud = B115200;
break;
}
if( cfsetispeed(&term_attr, baud) == -1 )
{
CFR_DBG_ERROR( "Error: failed to set input baud rate\n" );
close (fd);
return -1;
}
if( cfsetospeed(&term_attr, baud) == -1 )
{
CFR_DBG_ERROR( "Error: failed to set output baud rate\n" );
close (fd);
return -1;
}
if( tcsetattr(fd, TCSAFLUSH, &term_attr) != 0 )
{
CFR_DBG_ERROR( "Error: tcsetattr() for TERM_DEVICE failed\n" );
close (fd);
return -1;
}
return fd;
}

View File

@@ -0,0 +1,44 @@
/*!
* \file cmbs_uart.h
* \brief
* \author stein
*
* @(#) %filespec: cfr_uart.h~DMZD53#2 %
*
*******************************************************************************
* \par History
* \n==== History ============================================================\n
* date name version action \n
* ----------------------------------------------------------------------------\n
*******************************************************************************/
#if !defined( CFR_UART_H )
#define CFR_UART_H
/*! current packet transmission size */
#define CFR_BUFFER_WINDOW_SIZE 3
/*! identifier for receive path */
#define CFR_BUFFER_UART_REC 0
/*! identifier for transmit path */
#define CFR_BUFFER_UART_TRANS 1
#if defined( __cplusplus )
extern "C"
{
#endif
void * cfr_uartThread( void * pVoid );
int cfr_uartInitialize( PST_UART_CONFIG pst_Config );
int cfr_usbInitialize( PST_UART_CONFIG pst_Config );
int cfr_uartPacketPartWrite( u8* pu8_Buffer, u16 u16_Size );
void cfr_uartPacketWriteFinish( u8 u8_BufferIDX );
CFR_E_RETVAL cfr_uartPacketPrepare ( u16 u16_size );
void cfr_uartDataTransmitKick ( void );
#if defined( __cplusplus )
}
#endif
#endif // CFR_UART_H
//*/

View File

@@ -0,0 +1,29 @@
FRAMEBASE:=$(PROJDIR)/frame
cfr_objects:=
####################################################################
# settle includes
includes += -I$(FRAMEBASE) -I$(FRAMEBASE)/linux
ifdef CMBS_COMA
includes += -I$(LIBCOMA)/inc/ -I$(LIBCOMA)/../include
endif
####################################################################
# settle objects
cfr_objects += $(OBJDIR)/cfr_uart.o
cfr_objects += $(OBJDIR)/cfr_cmbs.o
cfr_objects += $(OBJDIR)/cfr_ie.o
ifdef CMBS_COMA
cfr_objects += $(OBJDIR)/cfr_coma.o
endif
####################################################################
# settle vpath
vpath %.c $(FRAMEBASE)
# linux
vpath %.c $(FRAMEBASE)/linux

View File

@@ -0,0 +1,32 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := osl
#LOCAL_CFLAGS := \
LOCAL_C_INCLUDES:= \
$(LOCAL_PATH)/inc
LOCAL_SRC_FILES := \
linux/OsLiteCritSect.c \
linux/OsLiteEvents.c \
linux/OsLiteInit.c \
linux/OsLiteIntr.c \
linux/OsLiteQueue.c \
linux/OsLiteSem.c \
linux/OsLiteTask.c \
linux/OsLiteTick.c \
linux/Smartlog.c \
linux/TimeUtils.c
#LOCAL_STATIC_LIBRARIES :=
include $(BUILD_STATIC_LIBRARY)

View File

@@ -0,0 +1,41 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file OsLite.h
/// @brief This file exports all OS Lite module functionality. It simply includes all OsLite
/// @n .h files. Application should include this file in order to have interfaces of all
/// @n OsLite headers.
///
/// @internal
/// @author Shlomi Mor
/// @date 26/12/2006
/// @version version 1.0
///
/// Copyright (C) 2006 DSP GROUP, INC . All Rights Reserved
///
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _OS_LITE_H
#define _OS_LITE_H
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "OsLiteInit.h"
#include "OsLiteTask.h"
#include "OsLiteIntr.h"
#include "OsLiteCritSect.h"
#include "OsLiteEvents.h"
#include "OsLiteQueue.h"
#include "OsLiteSem.h"
#include "OsLiteTimers.h"
#include "OsLiteTls.h"
#include "OsLiteTick.h"
#include "OsLiteKernel.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#endif // _OS_LITE_H

View File

@@ -0,0 +1,109 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file OsLiteCritSect.h
/// @brief This file exports the Critical Section kernel object functionality
/// @n
/// @n A critical section is a binary semaphore, which can be taken more than once by the
/// @n same task. It can be used in order to get mutual exclusion access to piece of code
/// @n by several tasks.
///
/// @internal
/// @author Shlomi Mor
/// @date 26/12/2006
/// @version version 1.0
///
/// Copyright (C) 2006 DSP GROUP, INC . All Rights Reserved
///
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _OS_LITE_CRITSECT_H
#define _OS_LITE_CRITSECT_H
#ifdef __cplusplus
extern "C" {
#endif
#include "OsLiteDefs.h"
#include "TypeDefs.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Critical Section handle
DECLARE_OPAQUE(HCRITICAL_SECTION);
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Create a critical section object
///
/// @param None
///
/// @note This function shouldn't be called from an ISR context
///
/// @return An handle to a critical section object
///
/// @see OSL_CS_Close
///////////////////////////////////////////////////////////////////////////////////////////////////
HCRITICAL_SECTION OSL_CS_Create( void );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Destroy a critical section object
///
/// @param[in] hCriticalSection - An handle to a valid critical section object
///
/// @note Destroying a critical section which is taken by a task is forbidden
/// @n This function shouldn't be called from an ISR context
///
/// @return None
///
/// @see OSL_CS_Create
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_CS_Close( HCRITICAL_SECTION hCriticalSection );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Enter (take) into a critical section
///
/// @param[in] hCriticalSection - An handle to a valid critical section object
/// @param[in] TimeoutMs - Timeout (in milli seconds) to wait for the critical section,
/// OSL_TIMEOUT_INFINITE for infinity
///
/// @note A task can enter the same critical section more than once, but it must leave it the
/// exact amount of times that it entered it.
/// @n This function shouldn't be called from an ISR context
///
/// @return True if the critical section is entered successfully, or False if not and the
/// timeout expired
///
/// @see OSL_CS_Leave
///////////////////////////////////////////////////////////////////////////////////////////////////
bool OSL_CS_Enter( HCRITICAL_SECTION hCriticalSection,
uint16 TimeoutMs );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Leave (give) a critical section
///
/// @param[in] hCriticalSection - An handle to a valid critical section object
///
/// @note A task is allowed to leave a critical section only if it currently holds it
/// @n This function shouldn't be called from an ISR context
///
/// @return None
///
/// @see OSL_CS_Enter
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_CS_Leave( HCRITICAL_SECTION hCriticalSection );
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif
#endif // _OS_LITE_CRITSECT_H

View File

@@ -0,0 +1,37 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file OsLiteDefs.h
/// @brief This file exports global definition values for the OS Lite module
///
/// @internal
/// @author Shlomi Mor
/// @date 26/12/2006
/// @version version 1.0
///
/// Copyright (C) 2006 DSP GROUP, INC . All Rights Reserved
///
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _OS_LITE_DEFS_H
#define _OS_LITE_DEFS_H
#ifdef __cplusplus
extern "C" {
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Define value for infinite timeout waiting
#define OSL_TIMEOUT_INFINITE 0xffff
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif
#endif // _OS_LITE_DEFS_H

View File

@@ -0,0 +1,150 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file OsLiteEvents.h
/// @brief This file exports the Event kernel object functionality
/// @n
/// @n Events are synchronization objects, allowing few tasks to be blocked until a
/// @n specific event is happening. The waiter tasks are slipping on the event, and the
/// @n producer task is signaling it in order to notify the waiters.
///
/// @internal
/// @author Shlomi Mor
/// @date 26/12/2006
/// @version version 1.0
///
/// Copyright (C) 2006 DSP GROUP, INC . All Rights Reserved
///
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _OS_LITE_EVENTS_H
#define _OS_LITE_EVENTS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "OsLiteDefs.h"
#include "TypeDefs.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Event handle type
DECLARE_OPAQUE(HEVENT);
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Create an event object
///
/// @param None
///
/// @note This function shouldn't be called from an ISR context
///
/// @return An handle to the created event object
///
/// @see OSL_EVENT_Close
///////////////////////////////////////////////////////////////////////////////////////////////////
HEVENT OSL_EVENT_Create( void );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Destroy an event object
///
/// @param[in] hEvent - Handle to a valid event object for destroying
///
/// @note Destroyig of event on which a task is waiting is forbidden
/// @n This function shouldn't be called from an ISR context
///
/// @return None
///
/// @see OSL_EVENT_Create
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_EVENT_Close( HEVENT hEvent );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Set (Signal) an event
///
/// @param[in] hEvent - Handle to a valid event object
///
/// @note When calling this function, all tasks which are currently waiting for the event
/// (using OSL_EVENT_Wait) will be waken up. The state of the event after this call is
/// dependent on the parameters sent by the waiters tasks to the OSL_EVENT_Wait function:
/// If one of these tasks set Clear = True, then the event will be cleared, otherwise
/// it will remain signaled until reset by OSL_EVENT_Reset or OSL_EVENT_Wait.
///
/// @return None
///
/// @see OSL_EVENT_Reset
/// @see OSL_EVENT_Test
/// @see OSL_EVENT_Wait
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_EVENT_Set ( HEVENT hEvent );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Reset (Clear) an event
///
/// @param[in] hEvent - Handle to a valid event object
///
/// @note This function clears the state of the event. Other way to clear the state of the
/// event is using the Clear parameter for the OSL_EVENT_Wait function.
///
/// @return None
///
/// @see OSL_EVENT_Set
/// @see OSL_EVENT_Test
/// @see OSL_EVENT_Wait
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_EVENT_Reset( HEVENT hEvent );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Get the state of an event
///
/// @param[in] hEvent - Handle to a valid event object
///
/// @note This function retrieves the current state of the event
///
/// @return True if the event is currently signaled, or False if it is cleared
///
/// @see OSL_EVENT_Set
/// @see OSL_EVENT_Reset
/// @see OSL_EVENT_Wait
///////////////////////////////////////////////////////////////////////////////////////////////////
bool OSL_EVENT_Test ( HEVENT hEvent );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Wait for an event to be signaled
///
/// @param[in] hEvent - Handle to a valid event object
/// @param[in] Clear - Should the event be cleared (reset) right after it is being signaled?
/// @param[in] TimeoutMs - Timeout to wait for the event, OSL_TIMEOUT_INFINITE for infinity
///
/// @note This function allows a task to be blocked until an event object is being signaled,
/// or a timeout is expired. In case the event was signaled before the timeout is
/// expired, the event will be cleared (reset) if we passed True in the Clear parameter
/// to this function.
/// @n This function shouldn't be called from an ISR context
///
/// @return True if the event is signaled, or False if the timeout expired before the event was
/// signaled
///
/// @see OSL_EVENT_Set
/// @see OSL_EVENT_Reset
/// @see OSL_EVENT_Test
///////////////////////////////////////////////////////////////////////////////////////////////////
bool OSL_EVENT_Wait( HEVENT hEvent ,
bool Clear,
uint16 TimeoutMs );
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif
#endif // _OS_LITE_EVENTS_H

View File

@@ -0,0 +1,113 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file OsLiteInit.h
/// @brief This file exports the RTOS initialization functions
/// @n
/// @n The application should call OSL_Init() in order to inialize RTOS memory.
/// @n OSL_Start() should be called in order to start the scheduler.
///
/// @internal
/// @author Shlomi Mor
/// @date 26/12/2006
/// @version version 1.0
///
/// Copyright (C) 2006 DSP GROUP, INC . All Rights Reserved
///
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _OS_LITE_INIT_H
#define _OS_LITE_INIT_H
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// @brief Callback function prototype, called by Idle for Stop mode
//
typedef void (*IdleHookProc)( void );
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Initialize the RTOS
///
/// @param None
///
/// @note This function should be called from the main() function, before calling OSL_Start
///
/// @return None
///
/// @see OSL_Start
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_Init( void );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Start running the RTOS scheduler
///
/// @param None
///
/// @note This function should be called from the main() function, after calling OSL_Init
/// @n The user must create at least one task (using OSL_TASK_Create function), before
/// calling this function
///
/// @return This function won't return (it will start running the highest priority task)
///
/// @see OSL_Start
/// @see OSL_TASK_Create
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_Start( void );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Notify the RTOS that the main task has started to run
///
/// @param None
///
/// @note This function should be called only once, from a context of a task, and after the
/// @n the RTOS tick timer was configured.
/// @n Usually, the application will call it from the context of it's main task, but it
/// @n can be called also from any other task as well.
/// @n Please noe that it should be called as soon as possible after the ROTS has started
/// @n running tasks.
/// @n NOTE: it should be called only once, from a selected task which starts running on
/// @n application startup (and not from every task).
///
/// @return None
///
/// @see OSL_Start
/// @see OSL_Init
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_NotifyMainTaskStart( void );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Register a function which will be called by the Idle task
///
/// @param Func - the callback function to be called by Idle task
///
/// @note Usual use of this function is in order to implement stop-mode or
/// some idle time statistics
///
/// @return None
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_RegisterIdleHook( IdleHookProc Func );
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif
#endif // _OS_LITE_INIT_H

View File

@@ -0,0 +1,123 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file OsLiteIntr.h
/// @brief This file exports ISR registration, and interrupts disabling funtionality
/// @n
/// @n ISR registration is used in order to register functions as ISR callbacks.
/// @n Disabling and restoring of interrupts is used in order to prevent ISRs and context
/// @n switches for a short time periods.
/// @n Application should be very careful will ISR disabling, in order not to hurt the
/// @n responsiveness of the whole system.
///
/// @internal
/// @author Shlomi Mor
/// @date 26/12/2006
/// @version version 1.0
///
/// Copyright (C) 2006 DSP GROUP, INC . All Rights Reserved
///
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _OS_LITE_INTR_H
#define _OS_LITE_INTR_H
#ifdef __cplusplus
extern "C" {
#endif
#include "OsLiteDefs.h"
#include "TypeDefs.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Cookie for restoring interrupts
DECLARE_OPAQUE(IntrCookie);
/// @brief ISR callback function prototype
typedef void (*OSL_IsrFunc)(void);
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Disable interrupts
///
/// @param None
///
/// @note This function should be used with a great care. Disabling the intterupts should be
/// done only for a very short periods of time. Otherwise, the system responsiveness
/// will be hurt, and we might also lose interrupts and cause a crash of the system.
///
/// @return A 'cookie' that can be saved in order for restoring the intterupts to the state
/// before calling this function
///
/// @see OSL_INTR_RestoreInterrupts
///////////////////////////////////////////////////////////////////////////////////////////////////
IntrCookie OSL_INTR_DisableInterrupts( void );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Restores the interrupts back to the previous state (enabled or disabled)
///
/// @param[in] Cookie - Previous interrupt state. The return value for the last call to
/// OSL_INTR_DisableInterrupts
///
/// @return None
///
/// @see OSL_INTR_DisableInterrupts
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_INTR_RestoreInterrupts( IntrCookie Cookie );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Register an ISR (Interrupt Service Routine)
///
/// @param[in] Int - ISR type (=bit number in the ICU status register of the chip)
/// @param[in] Isr - Callback function to be called once the intterupt is enabled and active
///
/// @note In case there is already a function registered for the same interrupt, it will be
/// just override by the function given to this function
/// @n ISR functions should be short as possible
///
/// @return None
///
/// @see OSL_IsrFunc
/// @see OSL_INTR_GetRegisteredIsr
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_INTR_RegisterIsr( uint16 Int, OSL_IsrFunc Isr );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Get the current registered ISR (Interrupt Service Routine)
///
/// @param[in] Int - ISR type (=bit number in the ICU status register of the chip)
///
/// @return The currently registered ISR for the specified interrupt
///
/// @see OSL_IsrFunc
/// @see OSL_INTR_RegisterIsr
///////////////////////////////////////////////////////////////////////////////////////////////////
OSL_IsrFunc OSL_INTR_GetRegisteredIsr( uint16 Int );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Test whether we are currently running in an ISR context
///
/// @param None
///
/// @note This function can be used in case we have different behavior dependent on the
/// context in which we are currently running
///
/// @return True if we are at ISR context, and False if we are at RTOS task context
///////////////////////////////////////////////////////////////////////////////////////////////////
bool OSL_INTR_IsIsrContext( void );
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif
#endif // _OS_LITE_INTR_H

View File

@@ -0,0 +1,60 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file OsLiteKernel.h
/// @brief This file exports the kernel object functionality
/// @n
///
/// @internal
/// @author Alex Krayz
/// @date 14/07/2008
/// @version version 1.0
///
/// Copyright (C) 2008 DSP GROUP, INC . All Rights Reserved
///
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _OS_LITE_KERNEL_H
#define _OS_LITE_KERNEL_H
#ifdef __cplusplus
extern "C" {
#endif
#include "TypeDefs.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Returns the number of ms until next event which
/// @n must wake-up the system
///
/// @note
///
/// @return the time in ms for which the system can go to sleep
///////////////////////////////////////////////////////////////////////////////////////////////////
uint32 OSL_KERNEL_GetMaximalSleepTime( void );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Advance internal data structure of RTOS
/// @n by specified number of ms.
///
/// @param[in] SleepTime - number of ms for advancing
///
/// @note
///
/// @return None
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_KERNEL_WakeupFromSleep( uint32 SleepTime );
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif
#endif // _OS_LITE_KERNEL_H

View File

@@ -0,0 +1,84 @@
#ifndef __NETWORK__
#define __NETWORK__
#ifndef WIN32
#include <netinet/in.h>
#else
#include <Winsock2.h>
#endif
typedef void * SELECT_HANDLE;
typedef void * CONNECT_HANDLE;
int InitNetwork(void);
void ReleaseNetwork(void);
int SocketError(void);
typedef enum
{
SOCK_TYPE_TCP,
SOCK_TYPE_UDP
} SOCKET_TYPE;
///////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Socket
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////
int SockCreate(SOCKET_TYPE eType);
void SocketClose(int sock);
CONNECT_HANDLE SocketConnectCreate(const char *IP, unsigned short u16_Port);
void SocketConnectRelease(CONNECT_HANDLE pst_Handle);
int IpAddressByHostName(IN const char *sHostName, OUT char *sIP);
typedef void (*pfnConnectCB)(int res);
typedef int (*pfnStop)(void);
// Asynchronous connect with timeout (-1 infinite)
// create separate thread
// calls pfn_ConnectCB when connected
// check pfn_StopCB if should stop
int SockConnectAsync(int sock, const char* sHost, unsigned short u16_Port,pfnConnectCB pfn_ConnectCB, pfnStop pfn_StopCB, unsigned int u32_Timeout);
int SockConnect(int sock, CONNECT_HANDLE pst_Handle);
int SockBind(int sock, CONNECT_HANDLE pst_Handle);
int SockBindAnyIP(int sock, unsigned intport);
int SocketSend(int sock, const unsigned char*pu8Buffer, unsigned intsize);
int SocketSendTo(int sock, const unsigned char*pu8_Buffer, unsigned intsize, CONNECT_HANDLE pst_Handle);
int SocketSetRxBuffer(int sock, unsigned intSize);
int SocketSetTxBuffer(int sock, unsigned intSize);
// if > 0, Bytes received
// if == 0, Connection closed
// if < 0, recv failed with error
int SocketRecv(int sock, unsigned char *pu8Buffer, unsigned int size,SOCKET_TYPE eType,struct sockaddr *cliaddres);
/////////////////////////////////////////
//// Select
/////////////////////////////////////////
// create select handle
SELECT_HANDLE SocketSelectCreate(void);
// set FDs
void SocketSelectSet(SELECT_HANDLE hHandle, const int *pReadFDs, unsigned int u32_ReadFDsSize, const int *pWriteFDs, unsigned int u32_WriteFDsSize);
// release select handle
// all FDs should be stopped
void SocketSelectRelease(SELECT_HANDLE handle);
// Select for requested sockets
// pu32_Entries with FD_SETSIZE size
// timeout im ms
// return the number of selected
int SocketSelect(SELECT_HANDLE handle, unsigned int*pu32_ReadEntries, unsigned int*pu32_ReadSize, unsigned int*pu32_WriteEntries, unsigned int*pu32_WriteSize, unsigned int u32_Timeout);
// set timeout for socket recieve (0 for infinite)
int SetSocketRecvTimeout(int sock, unsigned int u32_TimeoutSec);
#endif // __NETWORK__

View File

@@ -0,0 +1,123 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file OsLiteQueue.h
/// @brief This file exports the Queue kernel object functionality
/// @n
/// @n This module allows handling of simple queue objects, which can only hold (void*)
/// @n data items. The queue is handling the items in a FIFO (First In First Out) algorithm.
/// @n Supported operations:
/// @n Create a queue
/// @n Destroy a queue
/// @n Send an item to a queue
/// @n Receive an item from a queue
///
/// @internal
/// @author Shlomi Mor
/// @date 26/12/2006
/// @version version 1.0
///
/// Copyright (C) 2006 DSP GROUP, INC . All Rights Reserved
///
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _OS_LITE_QUEUE_H
#define _OS_LITE_QUEUE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "OsLiteDefs.h"
#include "TypeDefs.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Queue handle type
DECLARE_OPAQUE(HQUEUE);
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Create a queue object
///
/// @param[in] pMem - Memory for the queue data
/// @param[in] NumMsgs - Number of messages in the queue. Message type is always (void*)
///
/// @note This function shouldn't be called from an ISR context
///
/// @return An handle to the created queue object
///
/// @see OSL_Q_Close
///////////////////////////////////////////////////////////////////////////////////////////////////
HQUEUE OSL_Q_Create( void* pMem,
uint16 NumMsgs );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Destroy queue object
///
/// @param[in] hQueue - Handle to a valid queue object for destroying.
///
/// @note Destroying of a queue on which a task is waiting (for send or receive) is forbidden
/// @n This function shouldn't be called from an ISR context
///
/// @return None
///
/// @see OSL_Q_Create
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_Q_Close( HQUEUE hQueue );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Put an item in a queue
///
/// @param[in] hQueue - Handle to a valid queue object for destroying
/// @param[in] pData - Item to be pushed into the queue
/// @param[in] TimeoutMs - Timeout (in milli seconds) to wait for an empty slot in the queue.
/// OSL_TIMEOUT_INFINITE for infinity
///
/// @note The function waits until there is free space in the queue (or the timeout expires)
/// and then put the item in the queue
/// @n This function shouldn't be called from an ISR context when TimeoutMs != 0.
/// @n If TimeoutMs == 0, this function can be called from an ISR context.
///
/// @return True if the operation succeeded. False if timeout expired (the queue is full)
///
/// @see OSL_Q_Receive
///////////////////////////////////////////////////////////////////////////////////////////////////
bool OSL_Q_Send( HQUEUE hQueue,
void* pData,
uint16 TimeoutMs );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Read an item from a queue
///
/// @param[in] hQueue - Handle to a valid queue object for destroying
/// @param[out] ppData - Pointer to Item address. *ppData will contain the retrieved value
/// @param[in] TimeoutMs - Timeout (in milli seconds) to wait until there is any item in the
/// queue. OSL_TIMEOUT_INFINITE for infinity
///
/// @note The function waits until there is an item in the queue (or the timeout expires)
/// and then read it
/// @n This function shouldn't be called from an ISR context
///
/// @return True if the operation succeeded. False if timeout expired (the queue is empty)
///
/// @see OSL_Q_Send
///////////////////////////////////////////////////////////////////////////////////////////////////
bool OSL_Q_Receive( HQUEUE hQueue,
void** ppData,
uint16 TimeoutMs );
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif
#endif // _OS_LITE_QUEUE_H

View File

@@ -0,0 +1,109 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file OsLiteSem.h
/// @brief This file exports the Semaphore kernel object functionality
/// @n
/// @n This module gives semaphores functionality. Semaphores are synchronization objects,
/// @n letting the application the ability to share resources between several tasks.
/// @n Semaphore behavior:
/// @n The semaphore can have a value of 0 or more.
/// @n 'Give' increases the semaphore value by 1, 'Take' decreases it by 1.
/// @n When the value is 0, the semaphore cannot be 'Taken'.
///
/// @internal
/// @author Shlomi Mor
/// @date 26/12/2006
/// @version version 1.0
///
/// Copyright (C) 2006 DSP GROUP, INC . All Rights Reserved
///
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _OS_LITE_SEM_H
#define _OS_LITE_SEM_H
#ifdef __cplusplus
extern "C" {
#endif
#include "OsLiteDefs.h"
#include "TypeDefs.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Semaphore handle type
DECLARE_OPAQUE(HSEMAPHORE);
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Create a semaphore object
///
/// @param[in] InitialValue - Initial value of the semaphore. Can be 1 or more
///
/// @note This function shouldn't be called from an ISR context
///
/// @return An handle to a semaphore object
///
/// @see OSL_SEM_Close
///////////////////////////////////////////////////////////////////////////////////////////////////
HSEMAPHORE OSL_SEM_Create( uint16 InitialValue );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Destroy a semaphore object
///
/// @param[in] hSemaphore - Handle to a valid semaphore object
///
/// @note No task should be pending for the deleted semaphore object
/// @n This function shouldn't be called from an ISR context
///
/// @return None
///
/// @see OSL_SEM_Create
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_SEM_Close( HSEMAPHORE hSemaphore );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Give the semaphore. Should be called once the application finished using the
/// resource which is being guarded by the semaphore.
///
/// @param[in] hSemaphore - Handle to a valid semaphore object
///
/// @return None
///
/// @see OSL_SEM_Take
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_SEM_Give( HSEMAPHORE hSemaphore );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Take the semaphore. Should be called before the application start accesing the
/// resource which is being guarded by the semaphore.
///
/// @param[in] hSemaphore - Handle to a valid semaphore object
/// @param[in] TimeoutMs - Timeout to wait for the semaphore. Value of OSL_TIMEOUT_INFINITE for
/// infinity
///
/// @note This function shouldn't be called from an ISR context when TimeoutMs != 0.
/// @n If TimeoutMs == 0, this function can be called from an ISR context.
///
/// @return True if the semaphore was available (not 0). False in case of a timeout
///
/// @see OSL_SEM_Give
///////////////////////////////////////////////////////////////////////////////////////////////////
bool OSL_SEM_Take( HSEMAPHORE hSemaphore,
uint16 TimeoutMs );
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif
#endif // _OS_LITE_SEM_H

View File

@@ -0,0 +1,163 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file OsLiteTask.h
/// @brief This file exports the Task kernel object functionality
/// @n
/// @n This interface allows:
/// @n Creation and destroying of tasks
/// @n Sleep functionality
/// @n Disaling and enabling of preemption (task switching) mechanism
///
/// @internal
/// @author Shlomi Mor
/// @date 26/12/2006
/// @version version 1.0
///
/// Copyright (C) 2006 DSP GROUP, INC . All Rights Reserved
///
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _OS_LITE_TASKS_H
#define _OS_LITE_TASKS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "TypeDefs.h"
#include "OsLiteDefs.h"
#ifndef UNUSED_PARAMETER
#define UNUSED_PARAMETER(x) (void)(x)
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Callback function, which the task starts from
typedef void (*TaskProc)( void* ProcParam );
/// @brief Callback function for retreiving stacks usage
typedef void (*StackUsageProc)( uint16 Priority, uint8 Percentages );
/// @brief Task handle type
DECLARE_OPAQUE(HTASK);
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Application tasks possible priorities range. 0 is highest priority. Lowest priority
/// @n is set according to number of tasks declares in OsLiteConfig.h. Please note that
/// @n if timers are in use, a dedicated task for the timers will be created (which is not
/// @n being count inside OSL_MAX_TASKS definition)
#define OSL_TASK_PRIORITY_HIGHEST 0
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Create and start a task
///
/// @param[in] Proc - Entry point procedure of the created task
/// @param[in] ProcParam - Parameter for the entry point procedure
/// @param[in] Priority - Task priority (two tasks can't have the same priority).
/// Priority must be in range of OSL_TASK_PRIORITY_HIGHEST to
/// OSL_TASK_PRIORITY_LOWEST (lower number is higher priority).
/// @param[in] pStack - Pointer to the task's stack - cannot be NULL
/// @param[in] StackSize - The size of the stack in bytes. Must be greater than 0
///
/// @note Created task runs immediately (according to their priority)
/// @n Task must call OSL_TASK_Kill( OSL_TASK_GetCurrentTask() ) before it exists
/// @n This function shouldn't be called from an ISR context
///
/// @return An handle to a task object. The handle is NULL in case there is already existing
/// task at the same priority. In any other case of error, the function will enter
/// ASSERT internally (so it won't return).
///
/// @see OSL_TASK_Kill
///////////////////////////////////////////////////////////////////////////////////////////////////
HTASK OSL_TASK_Create( TaskProc Proc,
void* ProcParam,
uint16 Priority,
void* pStack,
uint16 StackSize );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Kill a task
///
/// @param[in] hTask - handle to the task object which should be killed
///
/// @note Each task must call OSL_TASK_Kill( OSL_TASK_GetCurrentTask() ) before it exists
/// @n This function shouldn't be called from an ISR context
///
/// @return None
///
/// @see OSL_TASK_Create
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_TASK_Kill( HTASK hTask );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Suspend the current task to a given amount of milli seconds
///
/// @param[in] TimeoutMs - Number of milli seconds for which we want current task to be suspended
///
/// @note Passing TimeoutMs = 0 will do nothing (no context switch will happen, since there
/// is only one task per priority)
/// @n This function shouldn't be called from an ISR context
///
/// @return None
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_TASK_Sleep( uint16 TimeoutMs );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Get handle for current task
///
/// @param None
///
/// @note This function shouldn't be called from an ISR context
///
/// @return Handle to current task object
///
/// @see OSL_TASK_Create
///////////////////////////////////////////////////////////////////////////////////////////////////
HTASK OSL_TASK_GetCurrentTask( void );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Get stack usage (percentages) for all active tasks
///
/// @param[in] StackUsageCb - callback function which is called for each active task
///
/// @note When this function is running, it is looping over all active tasks, compute it's
/// @n stack's usage, and call the given callback. So, the caller's callback will be
/// @n called during the runtime of this function.
///
/// @return None
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_TASK_GetStacksUsage( StackUsageProc StackUsageCb );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Set task property which decides whether a timed-delay
/// @n ( sleep, wait on semaphore/queue/event with timeout )
/// @n should wake-up the system in case of timeout.
///
/// @param[in] hTask - handle to the task object which should be set.
/// @param[in] WakeUp - 1 means wakeup, 0 means freeze
///
/// @note
///
/// @return None
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_TASK_SetWakeupPolicy( HTASK hTask, uint8 WakeUp );
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif
#endif // _OS_LITE_TASKS_H

View File

@@ -0,0 +1,82 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file OsLiteTick.h
/// @brief This file exports the Timer tick configuration, which is needed by the RTOS
/// @n
/// @n This interface supplis all needed information in order to configure timer interrupt
/// @n for the RTOS.
/// @n Every RTOS needs tick function in order to support timed wait and timer kernel
/// @n objects functionality.
///
/// @internal
/// @author Shlomi Mor
/// @date 26/12/2006
/// @version version 1.0
///
/// Copyright (C) 2006 DSP GROUP, INC . All Rights Reserved
///
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _OS_LITE_TICK_H
#define _OS_LITE_TICK_H
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "OsLiteIntr.h"
#include "TypeDefs.h"
#ifdef __cplusplus
extern "C" {
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Get the number of ticks in a second, which should be configured for the RTOS tick
/// handler interrupt
///
/// @param None
///
/// @note Tick handler is used by an RTOS in order to implement timed-wait (waiting for
/// semaphore, sleep, etc.) and timers functionality
///
/// @return The required RTOS's tick handler frequency
///
/// @see OSL_TICK_GetTickFunc
///////////////////////////////////////////////////////////////////////////////////////////////////
uint16 OSL_TICK_GetNumTicksInSec( void );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Get the RTOS tick handler function
///
/// @param None
///
/// @note The returned function will be called every timer tick (according to frequency got
/// by the call to OSL_TICK_GetNumTicksInSec)
///
/// @return RTOS timer tick handler function
///
/// @see OSL_TICK_GetNumTicksInSec
///////////////////////////////////////////////////////////////////////////////////////////////////
OSL_IsrFunc OSL_TICK_GetTickFunc( void );
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
uint32 OSL_Jiffies(void);
#ifdef __cplusplus
}
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#endif // _OS_LITE_TICK_H

View File

@@ -0,0 +1,128 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file OsLiteTimers.h
/// @brief This file exports the Timer kernel object functionality
/// @n
/// @n This file allows creating and destroying timer objects. Timer object can generate
/// @n one time, or periodic callback calls. The timer callbacks are being called from a
/// @n dedicated task's context.
///
/// @internal
/// @author Shlomi Mor
/// @date 26/12/2006
/// @version version 1.0
///
/// Copyright (C) 2006 DSP GROUP, INC . All Rights Reserved
///
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _OS_LITE_TIMERS_H
#define _OS_LITE_TIMERS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "OsLiteDefs.h"
#include "TypeDefs.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Timer handle type
DECLARE_OPAQUE(HTIMER);
/// @brief Callback function prototype, called by the timer
typedef void (*TimerProc)( HTIMER hTimer,
void* ProcParam );
#define OSL_TIMER_PERIODIC (1 << 1)
#define OSL_TIMER_ABSOLUTE (1 << 2)
#define OSL_TIMER_DONT_ACTIVATE_ON_TIME_SHIFT (1 << 3)
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Create and start a timer
///
/// @param[in] TimeoutMs - Timeout for executing the callback. Must be greater than 0
/// @param[in] Flags - Mask of flags (periodic / absolute)
/// @param[in] Proc - Callback to be called when timer expires
/// @param[in] ProcParam - Parameter for the executed callback
///
/// @note You must kill a timer, even if the timer is non-periodic, and was expired
/// @n This function shouldn't be called from an ISR context
///
/// @return An handle to a timer object
///
/// @see TimerProc
/// @see OSL_TIMER_Kill
///////////////////////////////////////////////////////////////////////////////////////////////////
HTIMER OSL_TIMER_Create( uint32 TimeoutMs,
uint32 Flags,
TimerProc Proc,
void* ProcParam );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Stop and destroy a timer
///
/// @param[in] hTimer - handle to an existing timer object
///
/// @note A timer must be killed after finishing using it. If the timer is periodic, calling
/// @n this function will stop and destroy it. If the timer is non-periodic, calling this
/// @n function will cancel and destroy the timer if it wasn't expired, and will only
/// @n destroy it if it was already expired.
/// @n This function shouldn't be called from an ISR context
/// @n You are allowed to call this function from the callback of the timer
///
/// @return None
///
/// @see OSL_TIMER_Create
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_TIMER_Kill( HTIMER hTimer );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Set timer property which will define whether
/// @n this timer should wake-up the system or not.
///
/// @param[in] hTimer - handle to timer object
/// @param[in] WakeUp - 1 means wakeup, 0 means freeze
///
/// @return None
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_TIMER_SetWakeupPolicy( HTIMER hTimer, uint8 WakeUp );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Initializes timers module
///
/// @return None
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_TIMER_Init( void );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Definitalizes timers module, resets SIGALRM and destroys list mutex
/// @return None
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_TIMER_Release();
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Informs Timers that system time was changed
/// @param[in] TimeShiftInMs - Time change in ms (can be negative)
/// @return None
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_TIMER_SystemTimeChanged(int32 TimeShiftInMs);
#ifdef __cplusplus
}
#endif
#endif // _OS_LITE_TIMERS_H

View File

@@ -0,0 +1,64 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file OsLiteTls.h
/// @brief Thread Local Storage interface
///
/// This module allows storing and retreiving one void* variable
/// for each task.
///
/// @internal
/// @author Shlomi Mor
/// @date 26/12/2006
/// @version version 1.0
///
/// Copyright (C) 2006 DSP GROUP, INC . All Rights Reserved
///
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _OS_LITE_TLS_H
#define _OS_LITE_TLS_H
#ifdef __cplusplus
extern "C" {
#endif
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Returns the stored TLS value for the current task
///
/// @param None
///
/// @note This function shouldn't be called from an ISR context.
///
/// @return (void*) value stored for current task
///
/// @see OSL_TLS_SetValue
///////////////////////////////////////////////////////////////////////////////////////////////////
void* OSL_TLS_GetValue( void );
///////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Store TLS value for the current task
///
/// @param[in] Value value to be stored
///
/// @note This function shouldn't be called from an ISR context.
///
/// @return None
///
/// @see OSL_TLS_GetValue
///////////////////////////////////////////////////////////////////////////////////////////////////
void OSL_TLS_SetValue( void* Value );
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif
#endif // _OS_LITE_TLS_H

View File

@@ -0,0 +1,370 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
///
/// @file Typedefs.h
/// @brief Defining types and macros according to specific compiler
///
/// @internal
/// @author Shlomi Mor
/// @date 01/10/2006
/// @version version 0.1
///
/// Copyright (C) 2006 DSP GROUP, INC . All Rights Reserved
///
////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _TYPEDEFS_H
#define _TYPEDEFS_H
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
#include <limits.h>
///////////////////////////////////////////////////////////////////////////////
// DEBUG
///////////////////////////////////////////////////////////////////////////////
///
/// @brief endianess definitions
///
#define HOST_BIG_ENDIAN 0
#define HOST_LITTLE_ENDIAN 1
#define HOST_ENDIAN HOST_LITTLE_ENDIAN
///
/// @brief MIN, MAX and RANGE macros
///
#ifndef MIN
#define MIN(a, b) ( (a) < (b) ? (a) : (b) )
#endif // MIN
#ifndef MAX
#define MAX(a, b) ( (a) > (b) ? (a) : (b) )
#endif // MAX
#ifndef RANGE
#define RANGE(min, x, max) ( (((min) > (x)) || ((x) > (max))) ? false : true )
#endif // RANGE
///
/// @brief IN, OUT and INOUT macros
///
#ifndef IN
#define IN
#endif // IN
#ifndef OUT
#define OUT
#endif // OUT
#ifndef INOUT
#define INOUT
#endif // INOUT
#define NORETURN
#define RAM_FUNC
#define FAST_FUNC
#define VERY_FAST_FUNC
#define END_FUNC
///
/// @brief Obsolete PACKED macro. Use PACKED_STRUCT instead (see below)
///
#ifndef PACKED
#define PACKED "Error: Use PACKED_STRUCT instead!!!"
#endif // PACKED
///
/// @brief Macro to be used when decalring "packed" struct
///
/// Use this macro when you want to declare a "packed" struct. Usage:
/// typedef PACKED_STRUCT _MyPackedStruct
/// {
/// uint32 FourBytes;
/// uint16 Twobytes;
/// uint8 Onebyte;
/// } RESTORE_PACK(MyPackedStruct);
///
/// @note Windows is not supported. If you want to use a "packed" struct
/// in a code that should be compiled for WIN32, take care of it
/// in the code. Example:
///
/// #ifdef WIN32
/// #pragma pack(1)
/// #endif
/// typedef PACKED_STRUCT _MyPackedStruct
/// {
/// uint32 FourBytes;
/// uint16 Twobytes;
/// uint8 Onebyte;
/// } RESTORE_PACK(MyPackedStruct);
/// #ifdef WIN32
/// #pragma pack()
/// #endif
///
#ifndef PACKED_STRUCT
#if defined(WIN32)
#define PACKED_STRUCT struct
#elif defined(__GNUC__)
#define PACKED_STRUCT struct __attribute__((packed))
#elif defined(__CC_ARM) // ARM_ADS
#define PACKED_STRUCT __packed struct
#elif defined(__ICCARM__) // ARM_IAR
#define PACKED_STRUCT _Pragma("pack(push,1)") struct
#endif
#endif // PACKED_STRUCT
///
/// @brief PACKED_UNION macro. To be used when decalring "packed" union (same as for packed struct)
///
#ifndef PACKED_UNION
#if defined(WIN32)
#define PACKED_UNION union
#elif defined(__GNUC__)
#define PACKED_UNION union __attribute__((packed))
#elif defined(__CC_ARM) // ARM_ADS
#define PACKED_UNION __packed union
#elif defined(__ICCARM__) // ARM_IAR
#define PACKED_UNION _Pragma("pack(push,1)") union
#endif
#endif // PACKED_STRUCT
#ifndef RESTORE_PACK
#if defined(WIN32)
#define RESTORE_PACK(Name) Name
#elif defined(__GNUC__)
#define RESTORE_PACK(Name) Name
#elif defined(__CC_ARM) // ARM_ADS
#define RESTORE_PACK(Name) Name
#elif defined(__ICCARM__) // ARM_IAR
#define RESTORE_PACK(Name) _Pragma("pack(pop)") Name
#endif
#endif
///
/// @brief DRAG_INTO_LINKAGE macro. To be used in order to force the linker inserting a symbol
/// @n into the executable. Usually used for ISR functions (Interrupt Service Routine)
///
#define DRAG_INTO_LINKAGE(Symbol) \
{ \
volatile int DragIntoLinkage = (int)(Symbol); \
(void)DragIntoLinkage; \
}
///
/// @brief Size in bytes
///
#define SIZEOF_B(x) ( sizeof(x) )
///
/// @brief Size in chars
///
#define SIZEOF_C(x) ( sizeof(x) )
///
/// @brief Size in words
///
#define SIZEOF_W(x) ( SIZEOF_C(x) / SIZEOF_C(uint16) )
///
/// @brief ARGUSED macro. Use in order to prevent compiler warning because of unused function parameter.
///
#define ARGUSED(x) (void)(x)
///
/// @brief LENGTHOF macro. Use in order to get number of items in array.
///
#define LENGTHOF(x) (sizeof(x) / sizeof((x)[0]))
///
/// @brief SIZE_IN_BYTES macro. Use in order to get the size of a variable/type in bytes.
///
#define SIZE_IN_BYTES(x) (sizeof(x)*CHAR_BIT/8)
///
/// @brief ROUND_UP macros
///
#define ROUND_UP(x,n) ( ( (uint32)(x) + (uint32)(n) - 1 ) & ( ~((n)-1)) )
#define ROUND_UP_TO_TYPE(x,n) ( ( (uint32)(x) + SIZE_IN_BYTES(n) - 1) & ~(SIZE_IN_BYTES(n)-1) )
///
/// @brief ROUND_DOWN macros
///
#define ROUND_DOWN(x,n) ( (uint32)(x) & ~((n)-1) )
#define ROUND_DOWN_TO_TYPE(x,n) ( (uint32)(x) & ~(SIZE_IN_BYTES(n)-1) )
///
/// @brief FIELD_MASK macro. Use in order to create a mask of bits in which bits Low..High are set.
///
#define FIELD_MASK( Low, High ) ( ((1 << ((High)-(Low)+1)) - 1) << (Low) )
///
/// @brief OFFSET_OF macro. Use in order to get the offset of a field in a struct. Should not be
/// @n used on packed structs.
///
#define OFFSET_OF( StructName, FieldName ) \
((int)(&(((StructName*)0)->FieldName)))
///
/// @brief UPWARD_CAST macro. Use in order to implement C++ using C.
///
#define UPWARD_CAST( BaseClassName, DerivedClassName, BaseClassMemberName, BaseClassPtr ) \
((DerivedClassName*)(((int)BaseClassPtr) - OFFSET_OF( DerivedClassName, BaseClassMemberName )))
///
/// @brief Kb macro. Use to specify 1024 multiplier.
///
#define Kb *1024
///
/// @brief Integer types. Portable code MUST use the types below, and not the compiler internal types,
/// @n since they might have different sizes when using different compilers/processors.
///
//#ifdef __LINUX__
#ifndef _TYPEDEFS_NORMAL
#define _TYPEDEFS_NORMAL
typedef signed char int8;
typedef signed short int16;
typedef signed long int32;
#endif
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned long uint32;
typedef unsigned long long uint64;
# ifndef __BIONIC__
typedef unsigned int uint;
#endif // __BIONIC__
typedef signed char sint8;
typedef signed short sint16;
typedef signed long sint32;
typedef signed long long sint64;
typedef signed int sint;
typedef signed long long int64;
//typedef uint16 bool_type;
#if 0
/// Define a 128 bit type
#if defined(__cplusplus)
PACKED_STRUCT uint128
{
// IAR comiler supplies the default behaviour like this (binary operations).
bool operator==(const uint128& other) const {
for (unsigned int i = 0; i < sizeof(octets) / sizeof(uint8); i++)
if (octets[i] != other.octets[i])
return false;
return true;
}
bool operator!=(const uint128& other) const {
return !(*this == other);
}
/// Assignment
uint128& operator=(const uint128 &rhs) {
for (unsigned int i = 0; i < sizeof(octets) / sizeof(uint8); i++)
octets[i] = rhs.octets[i];
return *this;
}
uint128& operator=(uint8 initializer) {
for (unsigned int i = 0; i < sizeof(octets) / sizeof(uint8); i++)
octets[i] = initializer;
return *this;
}
/// Conversion operator
operator uint8* () { return &octets[0]; }
operator const uint8* () const { return &octets[0]; }
uint8 octets[16];
} RESTORE_PACK();
#else
typedef PACKED_STRUCT { uint8 octets[16]; } RESTORE_PACK(uint128);
#endif /// __cplusplus
#endif
///
/// @brief Boolean types
///
#ifndef true
#if !defined(__cplusplus)
#if defined(WIN32)
#if _MSC_VER >= 1310 // VC .NET 2003
//typedef int32 bool_type;
typedef signed char bool_type;
#else
typedef signed char bool_type;
#endif
#elif defined(__LINUX__)
typedef signed char bool_type;
#elif defined(__linux__)
typedef signed char bool_type;
#elif defined(__CC_ARM)
typedef int32 bool_type;
#elif defined(__ICCARM__)
typedef uint8 bool_type;
#endif
#ifndef TEAKLITE
#define true (1)
#define false (0)
#endif
#define bool unsigned char
#endif // !defined(__cplusplus)
#endif
///
/// @brief NULL definition
///
#ifndef NULL
#define NULL 0
#endif // ifndef NULL
///
/// @brief Macros for REGISTERS / FIELDS definitions
///
typedef volatile uint8* Reg8Ptr;
typedef volatile uint16* Reg16Ptr;
typedef volatile uint32* Reg32Ptr;
///
/// @brief DECLARE_OPAQUE macro definition. Use in order to export a (void*) type with compiler's
/// @n type checking support.
///
#ifndef DECLARE_OPAQUE
#define DECLARE_OPAQUE(name) typedef struct name##__ __##name##__; \
typedef __##name##__ * name
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
#endif // _TYPEDEFS_H

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