Commit Graph

14344 Commits

Author SHA1 Message Date
Michael Davidsaver 8b24383e9e arrayOpTest: check initial dbGet value 2017-04-21 16:07:55 -04:00
Andrew Johnson e99fe61e07 Fix postfix.h macro arg and document 2017-04-21 14:18:05 -05:00
Andrew Johnson 23cef0339e Fix buffer allocation bug in lnkCalc.c 2017-04-21 13:56:49 -05:00
Andrew Johnson 611cb3f52e Fix typos, remove FIXMEs from lnkConst.c 2017-04-21 13:55:59 -05:00
Andrew Johnson 7e60faae10 No need to truncate const string array elements 2017-04-21 13:04:53 -05:00
Andrew Johnson dcb1f75b4d Cosmetic cleanups 2017-04-19 16:53:12 -05:00
Andrew Johnson 89f13aa51b Modify soft devices to synchronize TSEL=-2 timestamps
Use dbLinkDoLocked() to ensure a timestamp set by TSEL=-2
comes from the same update as the value.
2017-04-19 16:50:38 -05:00
Andrew Johnson d2db634ed2 Add dbLinkDoLocked() support
New lset method, implemented in all link types.
Includes a test for the dbCa implementation.
2017-04-19 16:44:11 -05:00
Andrew Johnson 17bd1ae6d0 db/test: Fix warning from clang 2017-03-03 12:23:36 -06:00
Michael Davidsaver 1d749ac7e7 dbLock: add assert in dbScanLock
catch locking attempts before iocInit()
2017-02-28 21:00:57 -06:00
Michael Davidsaver 6377c2e1e4 db/test: dbPutLinkTest include json links and more 2017-02-28 20:58:11 -06:00
Andrew Johnson 8069d9d80b dbUnitTest: Improve output slightly 2017-02-28 20:55:05 -06:00
Michael Davidsaver 46993a5e38 dbUnitTest: more informative dbPutField*() 2017-02-28 20:09:21 -06:00
Michael Davidsaver 2bb02e732a libCom: add errSymMsg() error message lookup
Like errSymLookup() but always returns a static string.
2017-02-28 20:06:42 -06:00
Michael Davidsaver 428dfe7a5c add testing lset 2017-02-28 18:00:51 -06:00
Andrew Johnson 00549c832a Fix HTML entities 2017-02-17 14:16:57 -06:00
Andrew Johnson c52088205e Remove constant link checks from test device 2017-02-17 14:15:31 -06:00
Andrew Johnson fab5ce675f Update comments in calcoutRecord 2016-12-12 17:44:01 -06:00
Andrew Johnson da5455ed22 Fixes for Windows builds 2016-09-09 11:14:59 -05:00
Andrew Johnson 58c78af4f9 Initialize all fields of jlink, link types may not use calloc 2016-09-07 23:35:39 -05:00
Andrew Johnson b2012fdfb5 Added test link type, fix dbPutLinkTest for JSON_LINKs 2016-09-07 00:50:40 -05:00
Andrew Johnson c12a35e388 Clean up memory leaks 2016-09-07 00:47:51 -05:00
Andrew Johnson 8a9707e74f Fixed a small memory leak in lnkCalc 2016-09-06 22:28:36 -05:00
Andrew Johnson 2d4301f0bb Fix warnings from clang 2016-09-05 22:36:45 -05:00
Andrew Johnson 268e59b052 Minor updates 2016-09-05 15:38:16 -05:00
Andrew Johnson 5b74799605 Some documentation updates 2016-09-05 15:12:09 -05:00
Andrew Johnson cd49e245c2 Added JLink reporting infrastructure
Command 'dbjlr <record|*> <level>' calls the report method for
all JSON links in all records, or in one named record.
Added level and indent arguments to the jlif::report() method.

Added jlif::map_children() method for recursing through all
JSON links, plus dbJLinkMapChildren() and dbJLinkMapAll() APIs.

Implemented the report and map_children methods in the const
and calc link types.
2016-09-05 14:25:33 -05:00
Andrew Johnson 19447dc7ff Make the long-string buffer for link fields bigger
When representing a link field as a long string (.INP$)
we have to pick some size limit for the buffer.
Previously this was the max length of a PV name + 12 chars,
but with JSON links that's not big enough.

This commit sets it to 1KB and defines a macro so it will be
easier to change in the future if necessary.
2016-09-04 16:56:15 -05:00
Andrew Johnson dd311be319 JLink: Convert parser->linkDepth into jlink->parseDepth
This counter is indicates when we've finished parsing a link,
and needs to be stored with link rather than the parser so it
keeps its value while parsing embedded links. This fixes the
embedded links bug.

Also removed the limit on a link name's length.
2016-09-04 16:33:10 -05:00
Andrew Johnson 4448317d73 Add lnkConst_remove, fix debug messages 2016-09-04 16:02:59 -05:00
Andrew Johnson ec6d86c91c Fix jlink memory leak in dbStaticLib
Added dbFreeLinkInfo(), use everywhere to release dbLinkInfo resources.

Renamed link_type => expected_type in db[Can]SetLink(),
my brain understands this name faster.
2016-09-04 15:56:39 -05:00
Andrew Johnson 4302da3628 Minor fixes to the calc link-type 2016-09-03 22:24:55 -05:00
Andrew Johnson 25315882ec Clean up JSON_LINKs in doCloseLinks 2016-09-03 22:22:12 -05:00
Andrew Johnson f8d6cd98a0 Minor cleanups 2016-09-03 19:44:49 -05:00
Andrew Johnson 5fe3e8bfb5 Added calc link-type 2016-09-03 19:22:55 -05:00
Andrew Johnson 8d1c416551 Moved PV_LINK-specific code out of dbLink.c into link types
This required a change to the lset::getValue arguments, removing
the pstat and psevr pointers. Links can still return a non-zero
value from getValue and trigger a LINK:INVALID alarm, but for any
other alarm settings they must manipulate the record themselves.
2016-09-03 19:21:11 -05:00
Andrew Johnson 07b09eed1f Fixes to dbJLink, added dbJLinkFree()
Moved the clearing of key_is_link to the right place,
embedded links now parse correctly.
2016-09-03 13:36:17 -05:00
Andrew Johnson 1e1c52cb69 Use new epicsStrnDup() API 2016-09-03 13:27:30 -05:00
Andrew Johnson 6e88d48615 Added epicsStrnDup() and dbmfStrndup() routines
The JSON parser passes string arguments with a length
instead or nil-terminating them. These routines make it
simple to copy such strings into either permanent or
temporary storage.
2016-09-03 13:25:19 -05:00
Andrew Johnson 23c71e9965 Various improvements
* Added new lset::openLink() method, called on JSON_LINKs only
* Cleanup in dbJLink.c to prevent memory leaks.
* Removed jlif::start_parse() method.
* Renamed jlif::end_parse() to end_child, which will be called on
the parent link when a child link has succesfully finished parsing.
2016-09-01 23:21:23 -05:00
Andrew Johnson 3992d4b92a Split dbJLinkInit, JLinks are now parsed at load-time 2016-09-01 00:56:26 -05:00
Andrew Johnson 40a3a66745 Added loadLS routine to lset
The long string in/out records use a different initializer
for constant links. The new loadLS method allows a constant
link type to initialize such a long string field.

NB: This routine was added in the middle of the lset table.
Any external link support implementations must be adjusted.
2016-08-31 00:36:23 -05:00
Andrew Johnson d0dcd61b23 Add code for arrays of strings 2016-08-30 23:03:08 -05:00
Andrew Johnson 5ec0633282 Pass link dbfType to jlif allocator; needed! 2016-08-30 01:13:15 -05:00
Andrew Johnson 33e565b67d Fix build warning from clang 2016-08-29 10:41:51 -05:00
Andrew Johnson 7edc0c67ca JSON Links implementation
The lnkConst.c implementation is not yet complete, no support for arrays of
strings (JMOP).

Link error messages should display their record & field name, which is not yet
possible.

The ability to embed links as parameters to other link types is not complete
yet; this will be required for the calc link type.

This code currently passes all existing tests, but additional tests are needed
for the new functionality.
2016-08-29 01:12:09 -05:00
Andrew Johnson 056edc0d8a Undo buggy change 2016-08-28 23:41:35 -05:00
Andrew Johnson fc66793ee2 Start documenting changes 2016-08-27 16:31:49 -05:00
Andrew Johnson 37b6cbb50c Use new dbLink APIs instead of checking link.type 2016-08-27 16:30:48 -05:00
Andrew Johnson cca6a5d05a Add isConstant and isVolatile to LSET 2016-08-27 16:26:55 -05:00